ColdFire
10-25-2006, 01:14 PM
Hi all,
I have been using CSS for a few months now and i thought i had started to get to grips with its quirks, however something baffled me today.
I had a parent div which was set to float images right, and then about 2 children in, i had a div which was set to float the images left, however the images would always float right and not take notice of my child div.
So basically the code was...
parentdiv1 {
border: 1px dashed blue;
}
parentdiv1 img {
float: right;
}
...snip
mycurrentchild {
border: 1px dashed red;
}
mycurrentchild img {
float: left;
}
The above code is an example but i would of thought that since i had overwritten the value of the float then it should of floated my images to the left in the "mycurrentchild" div.
I have fixed the problem by removing the "float: right" in the "parentdiv1 img" but it seems a bit wierd because i may have actually wanted an image floating right in that div and one floating left in my child div. Why has it done this?
Incidentally, whilst the rest of the page is absolutely screwed in IE the float actually worked :p
I have been using CSS for a few months now and i thought i had started to get to grips with its quirks, however something baffled me today.
I had a parent div which was set to float images right, and then about 2 children in, i had a div which was set to float the images left, however the images would always float right and not take notice of my child div.
So basically the code was...
parentdiv1 {
border: 1px dashed blue;
}
parentdiv1 img {
float: right;
}
...snip
mycurrentchild {
border: 1px dashed red;
}
mycurrentchild img {
float: left;
}
The above code is an example but i would of thought that since i had overwritten the value of the float then it should of floated my images to the left in the "mycurrentchild" div.
I have fixed the problem by removing the "float: right" in the "parentdiv1 img" but it seems a bit wierd because i may have actually wanted an image floating right in that div and one floating left in my child div. Why has it done this?
Incidentally, whilst the rest of the page is absolutely screwed in IE the float actually worked :p