943,640 Members | Top Members by Rank

Ad:
Jun 11th, 2009
0

css tabs formation problem

Expand Post »
Hi,

I am trying to create tabs using two images, the main background image and then the mouse over image, code i hv written after reading guidelines from a book so thats why cant completly understand where is the problem:

css code:

css Syntax (Toggle Plain Text)
  1. body {
  2. font: 62.5%/1.5 Verdana, Arial, Helvetica, sans-serif;
  3. background-color:#E5E5E5;
  4. }
  5.  
  6. #content {
  7. border-top: 1px solid #898989;
  8. border-right: 1px solid #898989;
  9. border-bottom: 1px solid #898989;
  10. border-left: 1px solid #898989;
  11. }
  12.  
  13. #navContainer {
  14.  
  15. font: 1.1em Arial, Helvetica, sans-serif;
  16. text-align: center;
  17. padding: 20px 0 0;
  18. }
  19.  
  20. #navigation
  21. {
  22. padding:0px;
  23. }
  24.  
  25. #navigation a:link {
  26. text-transform: uppercase;
  27. text-decoration: none;
  28. padding: 5px 10px;
  29. position: relative;
  30. margin-right: 5px;
  31. }
  32.  
  33. #navigation a:visited {
  34. text-transform: uppercase;
  35. text-decoration: none;
  36. padding: 5px 10px;
  37. position: relative;
  38.  
  39. }
  40.  
  41. #navigation #contactDetailsPageLink a:link, #navigation
  42. #contactDetailsPageLink a:visited {
  43. margin-right: 0;
  44. }
  45. <!-- to change font color of links-->
  46. #navigation a:visited {
  47. color:#CCCCCC;
  48.  
  49.  
  50. }
  51. #navigation a:hover {
  52. background-image:url(tab-hover.JPG);
  53. color:#FFFFFF;
  54. }
  55.  
  56.  
  57. #navigation ul {
  58. list-style: none;
  59. margin-bottom:5px;
  60.  
  61. }
  62.  
  63. #navigation li {
  64. display: inline;
  65. padding: 0px 9px;
  66. background-image:url(main_tab.JPG);
  67. }
  68.  
  69. #navigation a:active {
  70. color:#FFFFFF;
  71. }
  72.  
  73. #wrapper {
  74. margin-top:0px;
  75. margin-left:95px;
  76. }
  77. </style>

Html code is:

html Syntax (Toggle Plain Text)
  1.  
  2. <body id="homepage">
  3.  
  4. <div id="navContainer">
  5. <div id="navigation">
  6. <ul>
  7. <li id="pro"><a href="#" onClick="chk('pro')">Provinces</a></li>
  8.  
  9. <li id="loc"><a href="#" onClick="chk('loc')">Locations</a></li>
  10.  
  11. <li id="slide"><a href="#" onClick="chk('slideshow')">Slide Show</a> </li>
  12.  
  13. <li id="users"><a href="#" onClick="chk('users'">Users</a></li>
  14. </ul>
  15. </div>
  16. </div>
  17.  
  18.  
  19. <div id="wrapper">
  20. <iframe height="1000" width="800" id="content" scrolling="no" frameborder="0">
  21. </iframe>
  22. </div>
  23. </body>

I have attached the two images also. First the problem is that there should not be any space between the tabs, and secondly the tab-hover image is not accurate.

Please guide
Thanks
Attached Thumbnails
Click image for larger version

Name:	main_tab.JPG
Views:	63
Size:	1.7 KB
ID:	10432   Click image for larger version

Name:	tab-hover.JPG
Views:	67
Size:	1.5 KB
ID:	10433  
Similar Threads
Reputation Points: 21
Solved Threads: 0
Junior Poster
marjan_m is offline Offline
149 posts
since Apr 2005
Jun 12th, 2009
0

Re: css tabs formation problem

#navigation li { has right padding set. there's your space. It would be better if we could see the page in action.
Reputation Points: 10
Solved Threads: 1
Light Poster
drumichael87 is offline Offline
33 posts
since Jun 2009
Jun 13th, 2009
0

Re: css tabs formation problem

take the padding total to 0 pixel
Reputation Points: 12
Solved Threads: 34
Posting Whiz
sreein1986 is offline Offline
306 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Line break syntax
Next Thread in HTML and CSS Forum Timeline: Alignment of floated elements





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC