yldziner Posted October 12, 2007 Share Posted October 12, 2007 I've tried to find the info but it has elduded me. How do I edit the CSS to center the table?http://www.salvagegold.com/home.html Link to comment Share on other sites More sharing options...
jlhaslip Posted October 12, 2007 Share Posted October 12, 2007 body { margin: 0 auto; } Might work Link to comment Share on other sites More sharing options...
ctoz Posted October 16, 2007 Share Posted October 16, 2007 body { margin: 0 auto; } Might workand if it doesn't try this, position with negative left margin:#container {position:relative|absolute|fixed; top:whatever; left:50%; width(essential):whatever; margin-left: -half_the_width; }Your dimensions don't have to be in pixels; ems work well, because if the viewer resizes or if their screen-res is different to yours, the layout won't break. Link to comment Share on other sites More sharing options...
jlhaslip Posted October 16, 2007 Share Posted October 16, 2007 the absolute positioning of the page elements won't allow for centering of that page... Link to comment Share on other sites More sharing options...
ctoz Posted October 17, 2007 Share Posted October 17, 2007 the absolute positioning of the page elements won't allow for centering of that page...Have you checked? the nested absolutley-positioned elements would then be positioned *relative* to the container. Link to comment Share on other sites More sharing options...
yldziner Posted October 18, 2007 Author Share Posted October 18, 2007 Thanks, I tried it but it doesn't change. . .Is it really so difficult? Link to comment Share on other sites More sharing options...
ctoz Posted October 18, 2007 Share Posted October 18, 2007 apologies, my explanation was confusing. Change your container {position:relative|absolute|fixed; top:0; left:50%;width(essential):1000;margin-left: 500; } to container {position:absolute; top:0px; left:50%;width:1000px;margin-left: -500px; } I meant that you could use any version of positioning; and that, in order for the negative left margin to work accurately (it pulls the element back to the left), it has to be half the width of the container: therefore specifying a width for #container is essential. NB the minus sign in fromt of the left-margin; also good to specify your units, although most browsers will read no-units-specified as pixels.Also good practice to specify a doctype:w3schools doctype infohth Link to comment Share on other sites More sharing options...
yldziner Posted October 19, 2007 Author Share Posted October 19, 2007 Splendid. That did it. Thanks so much!! Link to comment Share on other sites More sharing options...
jlhaslip Posted October 19, 2007 Share Posted October 19, 2007 although most browsers will read no-units-specified as pixels.Must be using IE.A Standards Compliant Browser will fail to use the measurement without a unit of measurement qualifier such as px, em, %, etc. which is the correct method. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.