Why is it acceptable for bootstrap to put content directly into a <div> tag? eg.
<div class="alert alert-block">
<a class="close" data-dismiss="alert" href="#">×</a>
<h4 class="alert-heading">Warning!</h4>
Best check yo self, you're not...
</div>
What about semantics? Shouldn’t the text be enclosed in a paragraph in such a situation?
Your question is closely related to this other question. In short,
divis a generic way to structure documents, whilepdenotes a paragraph. Since you’re speaking about semantics, I’m not really sure that all text must be divided in paragraphs. In that particular case (a simple alert) the entirety of the text contained in thedivis a single sentence, so the concept of “dividing a single sentence in paragraphs” doesn’t even make sense to me.Otherwise, for longer texts, it totally makes sense to group related sentences in paragraphs, even search engines can “understand” your contents better if you use them correctly. Some newer HTML5 tags (such as
header,footeretc) serve the same purpose: explicitate the semantics of your document for better treatment by automated agents, even though “generic” divs would be enough for human readers to understand (since for us the visual placement of elements on screen is what matters, regardless of the internal code used to represent it).