sql
html
php
iphone
c
xml
database
xcode
regex
mysql
objective-c
silverlight
flash
html5
perl
facebook
oracle
apache
mvc
dom
try applying the following css rule to div#header
text-align: center;
First, in your CSS you have this:
#menu li { float: left; }
DELETE THIS!
Second, try with this:
#menu { text-align: center; }
It will only center any text in #menu and you can also add this if it doesn't work:
#menu
#menu ul, #menu ul li { text-align: center; }
If it doesn't work, I don't know why!
add
display: block; width: 600px
margin: 0px auto needs an fixed width and a block element !
This works using firebug:
#menu ul { line-height: normal; list-style: none; margin: 0 auto; padding: 0; width: 600px; }
CSS is used when one has to print text in a specified format like color,positioning,font etc.. repeatedly after certain intervals.For example say you have 2 type of fonts font1,font2. Now you want to print the text as follows,
font1 font2 hyperlink(navigation link) font1 table font2
Here we have used CSS for two type of fonts that we use repeatedly but not continously and writting the logic for same color,position,font type etc.. each time is a tiresome process hen ce CSS comes into picture lo make our job easy.In this case as, it is alreay writtrn in HTML and navigation links have nothing to do with CSS hence a simple <center><a href="link"> CLICK ME</a></center> in HTML code would do the required change. <center> tag here indicates that this should be printed in the center and if dont close the tag </center> properly after the use then all the remaining contents on the page would also be centered by dafault.
<center><a href="link"> CLICK ME</a></center>
<center>
</center>