style vs. tag
Why is it that on an img tag the float property only works if applied to the inline style tag of img... why does it not apply when added to the CSS rule in the external stylesheet?
Thank you.
Why is it that on an img tag the float property only works if applied to the inline style tag of img... why does it not apply when added to the CSS rule in the external stylesheet?
Thank you.
r_tist wrote:
Why is it that on an img tag the float property only works if applied to the inline style tag of img... why does it not apply when added to the CSS rule in the external stylesheet?
Thank you.
Sometimes you might need to dig a bit deeper like:
<div class="container"><img src="my_image.jpg" class="img_float_left"></div>
Rather than:
.img_float_left {
float: left;
}
You may have to use
.container .img_float_left {
float: left;
}
or if youre completely stuck but I don't advice it give the img tag a unique id (if that doesnt kill it then you have something else going on in your code)
<img src="my_image.jpg" id="img_float_left">
#img_float_left {
float: left;
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.