By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,724 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,724 IT Pros & Developers. It's quick & easy.

Multiple Style Sheet Question

Stang02GT
Expert 100+
P: 1,208
I am running into a problem with a style sheet for my menu and the style sheet on my web page.

The style sheet for the web page is over riding some of the items of my menu sheet.

Is there any way i can stop this and exclude my menu from being styled by the web page sheet?
Jan 28 '08 #1
Share this Question
Share on Google+
7 Replies


harshmaul
Expert 100+
P: 490
i guess your styling using html elements

eg...

Expand|Select|Wrap|Line Numbers
  1. ul{
  2. float:left;
  3. }
what you need to do is use classes and IDs

Expand|Select|Wrap|Line Numbers
  1. .myUnorderdList{
  2. float:left;
  3. }
This is only a guess as you haven't included code for me to use to help diagnose.

If this didn't work please include examples
Jan 28 '08 #2

Stang02GT
Expert 100+
P: 1,208
i apologize here is the code that styles my menu

Expand|Select|Wrap|Line Numbers
  1. .horizontalcssmenu ul{
  2. margin: 0;
  3. padding: 0;
  4. max-width: 200;
  5. list-style-type: none;
  6. }
  7.  
  8. /*Top level list items*/
  9. .horizontalcssmenu ul li{
  10. position: relative;
  11. display: inline;
  12. float: left;
  13. }
  14.  
  15. /*Top level menu link items style*/
  16. .horizontalcssmenu ul li a{
  17. display: block;
  18. width: 90px; /*Width of top level menu link items*/
  19. padding: 2px 8px;
  20. border: 1px solid #202020;
  21. border-left-width: 0;
  22. text-decoration: none;
  23. background: url(untitled.bmp) center center repeat-x;
  24. color: white;
  25. font: bold 10px Tahoma;
  26.  
  27. }
  28.  
  29. /*2nd level menu*/
  30. .horizontalcssmenu ul li ul{
  31. left: 0;
  32. top: 0;
  33. position: absolute;
  34. display: block;
  35. visibility: hidden;
  36. z-index: 100;
  37. }
  38.  
  39. /*2nd level menu list items*/
  40. .horizontalcssmenu ul li ul li{
  41. display: inline;
  42. float: none;
  43. }
  44.  
  45.  
  46. /* 2nd level menu links style */
  47. .horizontalcssmenu ul li ul li a{
  48. width: 130px; /*width of sub menu levels*/
  49. font-weight: normal;
  50. padding: 2px 5px;
  51. background: url(untitled1.bmp) center center repeat-x;
  52. border-width: 0 1px 1px 1px;
  53. }
  54.  
  55. .horizontalcssmenu ul li a:hover{
  56. background: url(untitled1.bmp) center center repeat-x;
  57. }
  58.  
  59. .horizontalcssmenu ul li ul li a:hover{
  60. background: url(untitled2.bmp) center center repeat-x;
  61. }
  62.  
  63. .horizontalcssmenu .arrowdiv{
  64. position: absolute;
  65. right: 0;
  66. background: transparent url(menuarrow.gif) no-repeat center left;
  67. }
  68.  
  69. * html p#iepara{ 
  70. padding-top: 1em;
  71. }
  72.  
  73. /*3rd level menu*/
  74. .horizontalcssmenu ul li ul li ul{
  75. left: 0;
  76. top: 0;
  77. border-top: 0px solid #202020;
  78. position: absolute;
  79. left: 70px; /*this is the offset for the sub sub-menu to allow the sub-menu to be seen*/
  80. display: block;
  81. visibility: hidden;
  82. z-index: inherit;
  83. }
  84.  
  85. /*3rd  menu list items*/
  86. .horizontalcssmenu ul li ul li ul li{
  87. display: inherit;
  88. float: right;
  89. }
  90.  
  91.  
  92. /*3rd  menu links style */
  93. .horizontalcssmenu ul li ul li ul li a{
  94. width:120px; /*width of sub menu levels*/
  95. display:block;
  96. font-weight: normal;
  97. padding: 2px 2px;
  98. background:  url(untitled.bmp) center center repeat-x;
  99. border-width: 0 1px 1px 1px;
  100. }

and here is the code for style sheet for the page that the menu is on

Expand|Select|Wrap|Line Numbers
  1. A:link { color: blue; text-decoration: none }
  2. A:active { color: blue; text-decoration: none }
  3. A:visited { color: red; text-decoration: none }
  4. A:hover { color: #00CCFF; text-decoration: none }
  5. BODY    { font: normal 10pt Trebuchet MS; }
  6. P   { font: normal 10pt Trebuchet MS; }
  7. LI { margin-top: 0px; }
  8. TD  { font: normal 10pt Trebuchet MS; }
  9. .m1,.m2,.m3,.m3a,.m4,.m4a,.m5,.m6,.m7,.m8,.m9,.m10 {font-family: Trebuchet MS;}
  10. .m2,.m4,.m6,.m8,.m10 {font-weight:bold;}
  11. .m1,.m2  {font-size:10pt;}
  12. .m3a,.m4a {font-size:11pt;}
  13. .m3,.m4 {font-size:12pt;}
  14. .m5,.m6 {font-size:14pt;}
  15. .m7,.m8 {font-size:18pt;}
  16. .m9,.m10 {font-size:9pt;}
  17. .p8 {font: normal 8pt Trebuchet MS;}
  18. .p9 {font: normal 9pt Trebuchet MS;}
  19.  
  20.  
  21.  
  22.  
  23. BODY {OVERFLOW:scroll;OVERFLOW-X:auto;}
  24. .DEK {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;}
  25.  
Jan 28 '08 #3

Stang02GT
Expert 100+
P: 1,208
My main problem lies in that the Web Page Css file treats all the menu items with drop downs as VISITED Links and makes them red. I need them to remain white at all times (User Request), but if i change the Web Page style sheet to Visited Links being white it fixes the problem with the menu items, but it creates the issue where all other links that were Visited are now white and unreadable.
Jan 28 '08 #4

harshmaul
Expert 100+
P: 490
Best guess is that the achor tags are linking back to the same page. Therefore the href is referencing a page already visited.

If you make sure the anchors that are comming up red AREN'T pointing at the current page.

Many people do this while a sites in dev, if this isn't the case please post a link OR the complete code.

Expand|Select|Wrap|Line Numbers
  1. A:link { color: blue; text-decoration: none }
  2. A:active { color: blue; text-decoration: none }
  3. A:visited { color: red; text-decoration: none }
  4. A:hover { color: #00CCFF; text-decoration: none }
Jan 28 '08 #5

Stang02GT
Expert 100+
P: 1,208
The site is in DEV right now. And the anchor tags are all pointing to different pages, so im not really sure whats going on with it.
Jan 28 '08 #6

just a feeling
P: 87
I guess it's a CSS specifity problem, but I can't figure it out without the HTML markup. So post it plz.
Jan 28 '08 #7

Stang02GT
Expert 100+
P: 1,208
I seemed to have fixed the problem, here is what i did that fixed it.


Expand|Select|Wrap|Line Numbers
  1. #navigation A:link { color: blue; text-decoration: none }
  2. #navigation A:active { color: blue; text-decoration: none }
  3. #navigation A:visited { color: red; text-decoration: none }
  4. #navigation A:hover { color: #00CCFF; text-decoration: none }
Jan 28 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.