Hi! I disappeared for a while but now I'm back with a question.
For images placed within a block of text, either left-aligned (default) or right-aligned, is there a way to target images (or anything really) with CSS based on their alignment? I realize that this is not likely. In the last six years I've never seen anything that specific for CSS but I thought I'd ask. shrug
I've encountered this situation many times over the years, and I always just make classes to float the image left or right and add the appropriate padding (with no padding where the image meets the edge of the container div).
The attached diagram probably explains the use it better than I can in words. [Blue is the container div, red is padding or margin around the image, text wraps around the images when they are aligned (or floated).]
It would be nice to have the padding/margin automatically added, tailored to the image's alignment rather than needing to add special classes to each image. I don't have a problem with the class method normally, but now I've got a project that will be handed off to someone else and unfortunately they have shown that even if I give them the classes and descriptions they won't use them and will mangle things trying to get it to look right on their own - the more I can assign to be automatic the better.
Since I kind of doubt there's a way to target by alignment, how do you guys usually handle alignment issues like this? Just live with extra padding/margins on all sides of your images? Rely on specific classes like I do? Or is there a better way to do all this?