Enclosing <img> in <p>?

^interesting.

*edit now I’m curious, how would dropdowns work?

Usually we have <li><a href=“#”>some anchor</a> and then a sibling <ul> stuff inside</ul></li> and now we should be having issues. Or not?

I’m someone who prefers a One True Way and very strict rules, maybe because I am someone who is easily confused.

Hmm, maybe I should go do Java : (

When HTML5 did this, it used complex rules that no-one understood where <ul> was a so-called structured inline element which was considered an inline element (for the purposes of content models) when there were other content in the same parent that could only be considered inline (such as text or <span>), and was otherwise considered a block element.

I’d just like to commenty on what Felgall said in post #9. There is an attribute called alt. The alt attribute is required by the w3c to be valid code. The text inside the alt attribute is what screen readers read to users when they come across an image, so this text should only be about a sentence long. IF you need to provide a longer description of an image you use the longdesc attribute, where you provide a link to preferabily a text file, where you can go for broke.

One thing I do is:


<div> //usually floated/styled
 <p><img src="" alt=""/></p>
 <p>Above: [my paragraph]</p>
</div>

This is valid code, it tells the screen reader to essentially skip that there is an image and read the text below it.

Yeah my screen reader skips the image unless the image is in an anchor (then it says Link graphic and if there’s no other text it reads out the url). But usually (not always) an image with an empty alt attribute belongs in the CSS in the first place.

Except obviously when you need a floated image so text wraps around.

That said, there’s no reason not to


<div> //usually floated/styled
 <p><img src="" alt=""/> Plain ol tekst</p>
</div>

There, the inline image is together with all the anonymous inline boxes of the block p, and passes Paul’s perilous pedantic… can’t think of a word that means “rules” that starts with a p… paradigm? Lawlz.

Perhaps “parameters”…

…and passes Paul’s perilous pedantic parameters…

Pure poetry :slight_smile: