CSS Help
- Started
- Last post
- 12 Responses
- HAMT
I want to center a div
It looks centered in NS7
but not in IE6
can anyone see why?#top {
margin-top: 20px;
margin-right: auto;
margin-left: auto;
width: 800px;
border: 1px solid #000;
}
- unformatted0
put
text-align:center;
in your body tag
- HAMT0
that moved the text/image to the center.
I want the div/layer to be center in the page
- moZmo0
body {margin:0px}
top {margin-left:auto;
margin-right:auto;
width:800px
}you may need to hack the width if you're using any padding on it...
have you set your DTD correctly? xhtml transistional will do....
- moZmo0
just noticed you've got a 1px border... put these classes after the others in your .css file
.top {
width:800px;
voice-family: ""}"";
voice-family:inherit;
width: 798px;
}
html>body .top {
width:798px;
}
this fixes IE5x (pc) box model bug... also IE5x (pc) doesn't understand the "auto" value - are you sure you're on IE6?forgot to put the "." before "top" class in my last post... sorry =/
- moZmo0
a few more helpful resources...
http://glish.com/css/
http://www.bluerobot.com/web/lay…
http://www.nypl.org/styleguide/
http://www.mezzoblue.com/zengard…
http://www.richinstyle.com/bugs/…good luck...
- HAMT0
wow...
I like the zen garde , blue spark rollover effects in mezzoblue.Maybe u would know a like where I could learn how to create a drop-down menu?!
thanks for the links
- moZmo0
javascript/dhtml or form menu?
not used js/dhtml for a while due to accessibility... try a google search...
- HAMT0
yeah I was thinking of a js/dhtml one and I will do a search in google.
but that CSS tricked-out menu @ youngpup.net is nice.
thanks
- Dave™0
Try this, tis so easy...
#centre-page-moz {
text-align: -moz-center;
}#centre-page-moz {
text-align: -moz-center;
}----Yer stuff----
- sparker0
you don't need to use hacks...
use "display" from the classification properties in css along with box properties (i.e., margin, width, etc...)
there are even better css2 implementations to control layouot.