Free2Code
 
Time: 2008-11-21, 09:02pm
creating round button
Subject: creating round button  ·  Posted: 2006-11-08, 04:11pm
Rank: ? (2)
Member #: 29041
Hello all,
I was reading this tutorial here
here...tab menu

Im using their example and trying to create a round button. I have both end caps, which is working fine but I would like to have an image in the center as well (since I have a gradient effect applied to my end caps) so that the center has the gradient as well. I cant figure this one out. I only have been using css for a little bit now, so Im still learning.

Heres the code I have so far


Code:
  1. <head>
  2. <style type="text/css">
  3. #navigation a
  4. {
  5. color: #000;
  6. background: #fb0 url("tab-orange-left2.gif") left top no-repeat;
  7. text-decoration: none;
  8. padding-left: 10px
  9. }
  10. #navigation a span
  11. {
  12. background: url("tab-orange-right2.gif") right top no-repeat;
  13. padding-right: 10px
  14. }
  15. #navigation a:hover {
  16. color: #fff;
  17. background: #2166A4 url("tab-blue-left2.gif") left top no-repeat;
  18. text-decoration: none;
  19. padding-left: 10px
  20. }  
  21. #navigation a:hover span
  22. {
  23. background: url("tab-blue-right2.gif") right top no-repeat;
  24. padding-right: 10px
  25. }
  26. </style>
  27. </head>
  28. <div id="navigation"><a href="/"><span>Home</span></a></div>
  29. <div id="navigation"><a href="#">Home</a></div>



Thanks,
Mark

» Post edited 2006-11-08, 04:31pm by Mark_M.

 
  Reply to this ·  Post link ·  Top
Subject: Re: creating round button  ·  Posted: 2006-11-09, 03:52am
Rank: ? (4821)
Member #: 3416
you could put another span in there and style it with side margins the width of your end caps, then give it the gradient background.

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: creating round button  ·  Posted: 2006-11-11, 07:42am
Rank: ? (2)
Member #: 29041
thanks misterhann,

i assume you mean something like this...which worked

Code:
  1. <head>
  2. <style type="text/css">
  3. #navigation a
  4. {
  5. color: #000;
  6. background: #fb0 url("tab-orange-left2.gif") left top no-repeat;
  7. text-decoration: none;
  8. padding-left: 10px
  9. }
  10. #navigation a span
  11. {
  12. background: url("tab-orange-right2.gif") right top no-repeat;
  13. padding-right: 10px
  14. }
  15. #navigation a span2
  16. {
  17. background: url("center.gif") ;
  18. }
  19. #navigation a:hover {
  20. color: #fff;
  21. background: #2166A4 url("tab-blue-left2.gif") left top no-repeat;
  22. text-decoration: none;
  23. padding-left: 10px
  24. }  
  25. #navigation a:hover span
  26. {
  27. background: url("tab-blue-right2.gif") right top no-repeat;
  28. padding-right: 10px
  29. }
  30. </style>
  31. </head>
  32. <div id="navigation"><a href="/"><span><span2>Home</span></span2></a></div>
  33. <div id="navigation"><a href="#">Home</a></div>


Also do you have any suggestions so that I can have three graphics under it, like a shadow… this is how I would do it in tables..



As you can see first row is the button, second row is the shadow

Thanks,
Mark
Code:
  1. <table cellspacing="0" cellpadding="0" border="0">
  2. <tr height="34">
  3. <td width="18" background ="big_button_left.gif"></td>
  4. <td width="401"background ="big_button_mid.gif">button text</td>
  5. <td width="18" background ="big_button_right.gif"></td>
  6. </tr>
  7. <tr height="8">
  8. <td width="8" background ="big_button_left_shadow.gif"></td>
  9. <td width="484"background ="big_button_mid_shadow.gif"></td>
  10. <td width="8" background ="big_button_right_shadow.gif"></td>
  11. </tr>
  12. </table>


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons