PDA

View Full Version : is that here should i put display and float??


fattat
07-03-2009, 06:29 AM
#menu ul li a{
display:block;
float:left;
margin:0;
padding:0 15px;
color:#fff;
text-decoration:none;
}

is that here should i put display and float??
even put or no put the menu still show properly...


#menu{
clear:both;
width:780px;
height:37px;
margin:0 auto;
padding:0;
background:url(images/menu.jpg) 0 0 repeat-x;
color:#fff;
}
#menu ul{
float:right;
margin:0;
padding:0;
font:bold 14px/40px "Trebuchet MS", Arial, Helvetica, sans-serif;
color:#fff;
text-transform:capitalize;
}
#menu ul li{
display:inline;
}
#menu ul li a{
display:block;
float:left;
margin:0;
padding:0 15px;
color:#fff;
text-decoration:none;
}



<div id="menu">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">about</a></li>
<li><a href="#">partner</a></li>
<li><a href="#">service</a></li>
<li><a href="#">mission</a></li>
<li><a href="#">contact us</a></li>
</ul></div>

fattat
07-04-2009, 01:59 AM
no people answer??

DWcourse
07-04-2009, 02:34 AM
It looks OK. If it works, then it is OK.

fattat
07-04-2009, 11:30 AM
It looks OK. If it works, then it is OK.

but i dont know why the original author need to put the display block??

and when we need apply display block??

DWcourse
07-04-2009, 05:27 PM
Normally, when you make text a link, only the text becomes a link. When you apply the display: block property to the link, the whole "box" surrounding the the text (extending the width of its container unless you set a size) becomes the link. You can get more info here: http://www.quirksmode.org/css/display.html

fattat
07-05-2009, 05:12 AM
Normally, when you make text a link, only the text becomes a link. When you apply the display: block property to the link, the whole "box" surrounding the the text (extending the width of its container unless you set a size) becomes the link. You can get more info here: http://www.quirksmode.org/css/display.html


yes..thank you
i dont know this rule before that..thank for telling me!!:mrgreen: :mrgreen: