Copy link to clipboard
Copied
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
...Copy link to clipboard
Copied
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;
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more