Sylvan012
09-07-2006, 10:03 AM
Good day, everyone...
I have a very odd occurance that I managed to fix but don't know why. Maybe someone here has run into this, before, and can tell me why my code behaved in this fashion.
Environment: Windows XP, FireFox 1.5.0.6
DOM: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I was trying to target a <p> tag on a page with some specific CSS font traits as well as box-model padding and margins. For some reason my border, font-weight, and similar elements were effecting the targeted region. However, margin and padding were not. In fact, even with an inspection tool, it appeared that there were no padding commands on my <p> tag and a margin command that was not being set anywhere in the document.
Thinking that it was a matter of some style, later in the CSS declaration, that was overriding my code, I placed my snippet at the very end. Still, no luck.
It seems as if the elements governing the internal and external spacing around the item were not targeting correctly but the "soft" changes were.
When I put all of my styles into a "style='xxxxx'" attribute, it worked just fine.
So, I knew my CSS was correct. Somehow, it just wasn't reaching it's target ... selectively.
So, this time I put in the full path -excruciatingly detailed- featuring every last encompassing tag in one, long string.
That made it work.
So, has anyone seen this before? Why should targeting from the nearest unique ID not work but targeting all the way down from the highest named <div> do the job?
I mean, it's working -now- but I'd love to know why...
Yours,
Dave
I have a very odd occurance that I managed to fix but don't know why. Maybe someone here has run into this, before, and can tell me why my code behaved in this fashion.
Environment: Windows XP, FireFox 1.5.0.6
DOM: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I was trying to target a <p> tag on a page with some specific CSS font traits as well as box-model padding and margins. For some reason my border, font-weight, and similar elements were effecting the targeted region. However, margin and padding were not. In fact, even with an inspection tool, it appeared that there were no padding commands on my <p> tag and a margin command that was not being set anywhere in the document.
Thinking that it was a matter of some style, later in the CSS declaration, that was overriding my code, I placed my snippet at the very end. Still, no luck.
It seems as if the elements governing the internal and external spacing around the item were not targeting correctly but the "soft" changes were.
When I put all of my styles into a "style='xxxxx'" attribute, it worked just fine.
So, I knew my CSS was correct. Somehow, it just wasn't reaching it's target ... selectively.
So, this time I put in the full path -excruciatingly detailed- featuring every last encompassing tag in one, long string.
That made it work.
So, has anyone seen this before? Why should targeting from the nearest unique ID not work but targeting all the way down from the highest named <div> do the job?
I mean, it's working -now- but I'd love to know why...
Yours,
Dave