I know ive been struggling with positioning a nav in the middle & Ive poured over previous posts. I was quite elated when i did it without having to post a question but in IE all the work gets undone
Please could some one give me an insight into whats causing th balls up.
Make sure IE 9 is not in quirks mode. Press F12 to open the console, then make sure the browser mode is IE9 Compat View and the Document mode is “Standards”
EDIT: In IE 10 I had to coerce it back to IE 7 standards mode to get the error you’re observing. So I’m guessing you have broken pages mode turned on.
Remember that when you create a div, you must tell the browser how wide it is, how tall it is, and any other attribute that you want it to have. In your code you have told the browser to align the text within the div in the center. Your margin property is not written correctly. If you are only going to have one value (the 20px) you must specify which margin (i.e. top, right, left, bottom).
You could right it like this
#centre
{
margin-top: 20px;
}
Or
#centre
{
margin: 20px 0 0 0;
}
Try this code to center that div that contains the menu
When only one margin value is specified, it applies to all 4 sides.
It is generally not recommended to set a fixed height on an object unless such a fixed height is required by the design of the page, such as an image, otherwise the object will be unable to increase in height in response to the users browser settings.
Are you sure about that? This has not been my experience. If you specify margin-top,left,right or bottom, that is where the margin is applied. If you specify values (even 0) after the broader margin (i.e. margin: 1px 2px 0 20px;) then top, right, bottom, left are applied accordingly.
Edit: Just figured out why you said that. I think you misinterpreted what I wrote to the OP. Yes if you just write margin and then one value it will apply to all sides. Note that in my statement (If you are only going to have one value (the 20px) you must specify which margin (i.e. top, right, left, bottom) I mentioned that you must tell the browser which side you are talking about.