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

Here's my code for the page:




ivoog User Agreement







How can I center my div tag and background image and still have the width be 100%?

2007-12-29 05:42:27 · 1 answers · asked by barlow8166 1 in Computers & Internet Programming & Design

1 answers

Your

tag is not well qualified and very confusing.
Use "position:absolute/relative", set "top:#px", "left:#px".
Check details on www.w3schools.com on "div" and "position"
You can also use style for div where
'background-image:url("full url");'
There are several background types: for div, tables, body etc...
You confuse them!
Your: body{margin: 0 auto; width: 100%}
"width????" Body uses the whole width.
To center your division, get the width of the user's screen (another serious bit of code that works differently with all browsers and will NOT work with CSS).
Your "div" may become:
"
fedest.com, questions and answers