Recommended Answers
Jump to PostUsing css, this code would do it:
position:absolute; left:50%; margin:The number here should be negative half your pages width;
Meaning if your page were 200px wide, the code would be:
margin:-100px;
Jump to Posti have a webpage that i built on my computer. a 1024x768 reslolution screen is what i used. but when i use a bigger monitor, the page is the same size, but its pushed up against the left side of the monitor.
Why don't you just let the page …
Jump to PostThe most popular way of centering your content is to put your whole body in one div with and id (ie container) and add this in your css code:
…div#container { margin: 0 auto; width: (the width you want, could be in %, px, or em) }
Jump to PostHope this will help u up!
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="
Jump to PostThese are the 'bare' essentials of the CSS centering hack: the width and the margin. If you don't specify a width, the margin trick won't work. If you don't specify the left and right margins as
auto
the wrapper won't be centered.You may say: "But I specified …
All 17 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.