Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / April 2008



Tip: Looking for answers? Try searching our database.

help: margin-left not getting applied...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hzgt9b - 23 Apr 2008 17:52 GMT
I am working on a site that is being served to a private network. All
the users are using IE6+.

I am having trouble getting the 1st div added to a containing div to
have its margin-left applied - right now it appears that it is getting
ignored. It only seems to be a problem with the 1st div added to the
containing div. If I add any other element before this first div (even
a comment) then the margin-left gets applied to the offending div.

QUESTIONS:
Does anyone know why the margin-left is not getting applied? If so,
any suggestions on how to fix it?

Here's a page showing the problem:
http://www.freewebtown.com/emailceloftis/noLeftMargin.html

Thoughts?
hzgt9b - 24 Apr 2008 15:51 GMT
> I am working on a site that is being served to a private network. All
> the users are using IE6+.
[quoted text clipped - 12 lines]
>
> Thoughts?

Anyone?
David Stone - 24 Apr 2008 15:57 GMT
In article
<a7661506-9772-40c3-a62a-89d8277975ad@e39g2000hsf.googlegroups.com>,

> > I am working on a site that is being served to a private network. All
> > the users are using IE6+.
[quoted text clipped - 15 lines]
>
> Anyone?

I tried looking at your page earlier, but it didn't actually
seem to exist at the url you provided then.

Looking at it now in both Safari and Firefox (Mac), I see the
same left margin on both divs that you claim appear different.

What browser(s) are you seeing the problem in?
hzgt9b - 24 Apr 2008 18:49 GMT
> In article
> <a7661506-9772-40c3-a62a-89d827797...@e39g2000hsf.googlegroups.com>,
[quoted text clipped - 28 lines]
>
> - Show quoted text -

IE6, IE7
Bergamot - 24 Apr 2008 20:05 GMT
>> I am having trouble getting the 1st div added to a containing div to
>> have its margin-left applied
>>
>> http://www.freewebtown.com/emailceloftis/noLeftMargin.html

What's with all the convoluted containers? This is way more complicated
than it needs to be, plus it's a most serious case of "div-itis".
http://microformats.org/wiki/posh

I bet if you simplified it, the problem would disappear on its own.

BTW, this:
#contents {
   position:relative;
   top:2em;
}

probably doesn't do what you think it does.
http://brainjar.com/css/positioning/

Signature

Berg

hzgt9b - 24 Apr 2008 20:31 GMT
> >> I am having trouble getting the 1st div added to a containing div to
> >> have its margin-left applied
[quoted text clipped - 17 lines]
> --
> Berg

>> What's with all the convoluted containers?
The example page is the most simplified form of the actual problem
that I could create to display the problem and to includ all the CSS
markup that acts on the offending element and/or its ancestors in the
page hierarchy (the other containers serve to hold other content in
the full version of the page).

The #contents div is styled as intended.
hzgt9b - 28 Apr 2008 00:54 GMT
> > >> I am having trouble getting the 1st div added to a containing div to
> > >> have its margin-left applied
[quoted text clipped - 28 lines]
>
> - Show quoted text -

Any other suggestions?
Gus Richter - 28 Apr 2008 02:39 GMT
>>>>> I am having trouble getting the 1st div added to a containing div to
>>>>> have its margin-left applied
[quoted text clipped - 22 lines]
>
> Any other suggestions?

Why IE barfs is probably tied in with its box model problem.
In any case, there is one good rule to go by:

Use margin to position the container.
Use padding to position the content.

Change:
   <div style="margin-left: 30px; .....
To:
   <div style="padding-left: 30px; .....

Signature

Gus

hzgt9b - 28 Apr 2008 17:37 GMT
> >>>>> I am having trouble getting the 1st div added to a containing div to
> >>>>> have its margin-left applied
[quoted text clipped - 38 lines]
>
> - Show quoted text -

Thanks for the tip
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.