I have an image set by css style to 100x75. When it doesn't load, the alt text loads into the space, but expands the container to beyond 100px width.
How can I prevent this? Either by cutting it off or wrapping it.
Use the markup code <BR CLEAR=”left” /> to flow text around images on opposite sides of your Web pages.
Alt text can be read by screen readers, and helps people who are blind or who have low vision understand what images and other objects are in a document. You can add alt text to objects, such as pictures, clip art, charts, tables, shapes, SmartArt, embedded objects, and audio or video objects.
Essentially, alt text should be as long as it needs to be in order to effectively describe the content, but should be succinct. For complex images such as charts, graphs, and diagrams that require more lengthy descriptions, there are other options.
Well, I figured it out to some degree. I just wrapped the image in a container of the same size. I guess my browser (Firefox) was not wrapping the text because it was an inline element.
Thanks everyone for your responses.
Alternatively:
overflow: hidden;
to the image. It will hide the alt text that crosses the image border. Though it will not wrap the text.
#idlogo img {
overflow: hidden;
font-size: 10px;
}
The purpose of alt Text is to let the screen reader know about the image, so I think reducing the alt text size and hiding the overflow should work out best. But, of course avoid using very long text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With