Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Div and positioning
Rob Hunter
Ranch Hand
Posts: 838
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm "trying" to have the div tag with id="main" centered on the browser window without luck. Here is the code I'm using. If you could find where the problem lies I would be most appreciative. The below DOES work in IE 8 but not in FireFox. Thanks.
<body> <div id="wrapper"> <div id="main"> <div id="title"> <img /> </div> </div> </div>
CSS is :
#wrapper { text-align: center; width: 100%; } #main { width: 1000px; border: 1px #000000 solid; } #title { text-align: left; width: 1000px; }
Eric Pascarello
author
Posts: 15385
6
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
#wrapper { } #main { width: 1000px; border: 1px #000000 solid; margin: auto; } #title { }
Rob Hunter
Ranch Hand
Posts: 838
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Interesting. I plopped it in the code and it does indeed work fine now - thanks
alot
. Not an obvious include for me :-)
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Left and right margins of
auto
will center an element with an explicit width.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Verticaly Align 3 Column DIV in IE6
DIV layout issues
center a div inside a div
formatting page/placement of buttons
CSS Positioning Issue
More...