|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
</div> not reverting to parent div position info
I defined several css styles to be nested within an overall "pageBlock" style and some of the nested divs don't seem to revert to the settings of the parent pageBlock div after a </div>. Safari is the only browser that does what intuitively I think should happen. IE, OmniWeb, FireFox, iCab all do their own squirrely things.
In general though, in all browsers except Safari, elements are being positioned not relative to the parent (pageBlock) but relative to left edge of the item directly above them. This causes them to get farther and farther from the left edge of the page the more blocks are used. Is this rightward creep what's "supposed" to happen and it's Safari that's getting it "wrong"? Thanks Ken Here's the styles: Code:
.pageBlock {
margin-right: auto;
margin-left: auto;
top: 32px;
width: 80%;
height: auto
}
.indentBlock {
color: black;
font-size: 14px;
line-height: 18px;
font-family: "Times New Roman", Georgia, Times;
text-align: left;
padding-bottom: 4px;
position: relative;
top: 8px;
left: 32px
}
.imageBlock {
padding-bottom: 8px
}
And here's how I'm using them... Code:
<div class="pageBlock"> <p>bla bla bla</p> <div class="indentBlock"> <p>rah rah rah</p> </div> <p>cha cha cha</p> <div class="indentBlock"> <p>rah rah rah</p> </div> </div> |
|
#2
|
||||
|
||||
|
Hmm. I didn't try this code, but I would expect a rendering similar to your Safari description. Relative position is referenced to its normal position in the flow, not its parent element. One thing to correct is the parent div. A positioned element must descend from a positioned element. So as far as the "indentBlock" is concerned, its positioned parent is not "pageBlock" but it nearest positioned ancestor—likely <body>. I would look closely for a syntax error like a missing closing tag or missing quote.
If the problem persists, post a live link for us to look at. cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. Last edited by kk5st : June 8th, 2004 at 03:22 PM. |
|
#3
|
|||
|
|||
|
Strange, I just launched all my test browsers and they are all rendering the divs as expected except for IE (and iCab which doesn't support css)
I don't remember changing a thing. Divs are cool! They heal themselves! Now if someone could write self healing C/Objective C... Thanks for the response, Ken |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > </div> not reverting to parent div position info |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|