Ok this sound stupid but.. how do i "center" using CSS? The guide i used didnt state it THanks, 007wood
Be more specific. Center a block level element? Center an inline level element? Horizontally center? Vertically center? You probably want to center a block level element, and you have to use horizontal auto margins for that. CSS: HTML:
I think you want to center something but have the text aligned left. If that is the case body { margin:50px 0px; text-align:center; } #Content { width:600px; margin:0px auto; text-align:left; } Code (markup): You can set margins, but I suggest auto.
Just remember that text-align: center; on the body and text-align: left; on the #Content selectors are used to replace margin: 0 auto; in Internet Explorer 5.x (and 6 when in quirks mode), and thus aren't needed unless you have to support that particular browser generation (or can't get IE 6 back into standards mode - like with "My Opera" templates for example).
You'll have to absolutely position the element, set its top and left position to 50% each, and then set the top and left margins to (negative) half the container's size. For example, if I had a Flash file I wanted to be centered within the viewport, here's how I'd do it. [b]CSS Code[/b] div { overflow: none; position: absolute; top: 50%; left: 50%; margin-top: -190px; margin-left: -260px; width: 520px; height: 390px; } [b]HTML Code[/b] <body> <div> <object type="application/x-shockwave-flash" data="c.swf?path=flash-movie.swf" width="520" height="390"> <param name="movie" value="c.swf?path=flash-movie.swf"> </object> </div> </body> Code (markup):