Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
DIV margin issues (save me...)
Old 10-28-2007, 06:48 PM DIV margin issues (save me...)
Experienced Talker

Posts: 42
Trades: 0
My web page looks perfect when viewed in IE7. However, in IE6 the margins change (I understand there are some issues with IE5/IE6 Quirks Mode). What can I do to make my "news item" DIVs center properly inside their parent "news updates" DIV?

How does one tell a DIV to center itself inside it's parent DIV?

http://www3.telus.net/sprecious/union/home.htm

Ken
Ken Rogers is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-29-2007, 04:21 AM Re: DIV margin issues (save me...)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
to stay out of quirks mode use a full doctype
though it's more likely the doubled-margin bug that is affecting you.

use margin:0 auto; on the element for centering.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-31-2007, 12:47 AM Re: DIV margin issues (save me...)
Junior Talker

Posts: 2
Name: johnmundell
Trades: 0
Try these two example given below:
Example1

The relevant style declarations in the header are:
body{ font-size: 100%; background-color: #ccddcc; color: #000; font-family: arial, helvetica, geneva, sans-serif; margin: 0 15%;}.box{ clear: both; width: 80%; background: #fff url(images/75pxWide.png) no-repeat; color: #000; padding: 1em; border: 2px solid #EFCE8C;}.sidebar{ float: right; width: 15em; font-size: 80%; border: 2px dotted #000; padding: 1em; margin-left: 75px; background-color: #f8eece; color: #000;}The in-line styles used in each demo are documented below those demos.
Each example uses the same basic mark-up:
<div class="box"> <div class="sidebar"> a floated box with some content </div> some content</div>Example:2Xhtml:

<body>
<div id="details">
<form method="post" action="this">
<div id="contentNameCont">
<label for="contentName">Content name:</label>
<input id="contentName" type="text" />
</div> <div id="defaultCulturesCont">
<label for="defaultCulture">Default culture:</label>
<textarea id="defaultCulture" cols="6" rows="4"></textarea>
</div>
</form>
</div>
</body>


CSS:
div#details { margin: 0% 0% 0% 40%; background-color: yellow; }
input, label { display: block; float: left; }
#details div { overflow: auto; width: 100%; margin-bottom: 5px; border: solid 1px black; }
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
johnmundell is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to DIV margin issues (save me...)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.04440 seconds with 12 queries