Design and CSS styles
Version 3.x > Design and CSS styles > CSS style not working for Menu View modes: 
User avatar
Member
Member
ubo-hurontel.on - 9/8/2008 11:42:22 AM
   
CSS style not working for Menu
I am working through my first web page. My Master page has the following code placed in it:
<div class="navigation">
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td class="MainCMSMenuHighlightedMenuItem">Home</td>
<td class="MainCMSMenuItem">Page 1</td>
</tr>
</table>
</div>
And the CSS inside Kentico has the following for #navigation
#navigation {
margin-right: 10px;
margin-left: 10px;
background-color: #d3d3d3;
overflow: hidden;
width: auto;
margin: 0;
padding: 0;
border: 0;
clear: both;
}
Also
/* Styles for Navigation */
#navigation ul {
list-style-type: none;
width: 100%;
margin: 0;
padding: 0;
}
#navigation li {
float: left;
}
#navigation a {
color: #000;
text-decoration: none;
margin: 0 1px;
padding: 5px;
display: block;
border: 1px solid #d3d3d3;
}
#navigation a:hover {
background-color: #f2f2f2;
border: 1px solid #f2f2f2;
}

I have copied the CSS style sheet from a MS Expression Web template...where it works fine. In the Kentico program the background colour is white not #d3d3d3.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 9/9/2008 3:38:18 AM
   
RE:CSS style not working for Menu
Hello,

Please note, that you are using IDs for your navigation in CSS (#navigation). That's why you may need to use "id=navigation" instead of "class=navigation" to reference it.

I don't know how it could work in MS Expression, but this the right approach according to W3C standards.

You are also missing <ul>, <li>, and <a> tags in your HTML code, but I suppose this is only an example ;-)

Best regards
Ondrej Vasil

User avatar
Member
Member
ubo-hurontel.on - 9/9/2008 7:33:44 AM
   
RE:CSS style not working for Menu
Thanks for the reply.
You are correct about class="navigation" not working in MicroSoft Expression. I must have made some mistakes in coping back and forth while following the tutorial.

Also, thanks for the reference to the W3C standard. I think that I need to spend some time getting fully up to speed on CSS. This link looks like a good place to start: http://www.w3schools.com/css/default.asp