English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do I center a

object relative to the browser on HTML?

2006-09-12 08:43:35 · 5 answers · asked by Wai 5 in Computers & Internet Internet

5 answers

try putting it within the

tags or set the align = center in the DIV tag itself.

2006-09-12 08:48:48 · answer #1 · answered by Tangus 4 · 0 1

For browsers that are fairly standards compliant (Firefox, Safari, Opera, IE 7)


text


The two keys are the 'auto' for left & right margins, and the width specification. You can have any width you like, but without a width, the default width of the div is the full width of the page. Therefore centering it on the page is meaningless.

For IE 6-, there is no good way to do it. The following works:


text

2006-09-12 09:41:49 · answer #2 · answered by wfinn 2 · 0 0

i guarantee this to be the correct answer.

do not use

it will not work. do not use the center tag. it has been deprecated by the w3c.

you have to use two different methods so that it will work in both internet explorer and all other css browsers.

text-align:center; is for internet explorer.
margin:0 auto; is for all other browsers.



this will be centered on the page


★★ BEST WEB DESIGN BOOKS ★★

◙ Read these books about html/xhtml/css.
http://www.google.com/search?num=100&hl=en&lr=&newwindow=1&safe=off&q=site%3Awww.oreilly.com+books+html+xhtml+css&btnG=Search

◙◙ More great books ◙◙

◙ css hacks and filters
☞ http://www.idest.com/csshacks

◙ CSS Anthology 101
☞ http://www.oreilly.com/catalog/0957921888/

◙ Read this CSS filters site
☞ http://www.centricle.com/ref/css/filters/

◙ Here is a really good css email list run by eric meyer
☞ http://www.css-discuss.com/

◙ Here are their CSS examples pages
☞ http://css-discuss.incutio.com/

◙ The best free HTML/XHTML/CSS editor with many plugins you can add to it for extra features.
☞ http://www.chami.com/html-kit/

◙ Don't use Microsoft Frontpage. It is just plain junk and very difficult for newcomers.

2006-09-12 08:57:18 · answer #3 · answered by Anonymous · 0 0

It sounds like #backgroundwrapper won't be mandatory, you could basically be conscious CSS to the physique for that. as long as each little thing is interior #wrapper and #wrapper has no parent, then putting left and precise margins to motor vehicle ought to paintings. it style of sounds such as you're having issues considering which you're defining #wrapper like it has no parent, which it does, #backgroundwrapper. additionally evaluate putting the width of #wrapper to a share, and this could make the content circulate with the browser.

2016-11-07 04:39:59 · answer #4 · answered by ? 4 · 0 0

Text


or

answer #5 · answered by Bernz 6 · 0 2

fedest.com, questions and answers