One Syntax, one Semantics Question

That’s the problem though – people thinking about it as the print term for it, instead of the GRAMMATICAL term for it. In print, it’s a presentational element used to mark a break between text elements – in GRAMMAR it is for all intents and purposes punctuation! Used to distinguish separate thoughts and concepts into easily digested blocks. If you are talking semantic markup, you should be thinking grammar, because again, if you are choosing your tags because of what they look like (typography/presentation) you’re choosing the wrong tags!

Paragraphs within a heading are generally related to the topic, but should be separate and distinct ideas. Because of that I typically restrict the use of paragraphs to flow text of sentences in the content and sidebar areas. Rarely will I use it in a footer since the disparate elements are, well… separate ideas.

In a lot of ways non-paragraph text is like Porn… It’s hard to define but I know it when I see it. Sometimes it’s easy to tell – like if you have a list of short options, bullet points, etc – rarely does it make sense for them to even have paragraphs… Just as if they are all getting headings, there’s no reason to give them a list.

Some links:

http://grammar.ccc.commnet.edu/grammar/paragraphs.htm
http://hospitality.hud.ac.uk/studyskills/writing/structure/paragraphs.htm
http://www.myenglishgrammar.com/english/writing-paragraph.html

Most languages have some such form of separation (even ruby ones!) – the difference is how it’s presented; from a semantic standpoint it does not mean double line-break, or line-break with indent, or any of the other presentational affectations used to deliver it’s meaning. That it can in fact HAVE different presentations shows exactly why it’s a grammatical block, NOT a presentational one.

It’s also worth noting the term paragraph, or at least the root concept on which it’s based (paragraphos), goes back to the time of ancient Greece circa the 5th century BC in the west, and related language concepts can be found in both the east and west LONG before that – while Bi-Sheng was ~1000 AD and Gutenburg made his press in 1350 AD?

Oh yes, it’s a typographical term… :rofl:

Yes, I used the term ‘in print’ loosely. I really mean in spoken/written language. What I described is both the grammatical concept and the usual visual presentation (to help people understand what I was talking about. [Side note: the problem with most programmers is that they wax on about the grammar of their language without giving enough practical demonstrations of what they are talking about. You don’t have to look further than the W3C specs or the blasted PHP Manual to see examples of what I mean.]).

Because you keep repeating this same argument I will keep repeating that I disagree and I think that (in most cases) a p element can be a suitable tag to wrap around an image when there is no other context for it. It’s no big issue either way but I do dislike divs around images and worse I also dislike images without block containers around them.:slight_smile:

e.g.
This is invalid:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<img src="images/flag-gb.gif" width="16" height="11" alt="GB Flag">
<p>Lorem ispum dolor sit ...</p>
</body>
</html>

The inline element must be in a block container when it is a direct child of the body or it is invalid. So what element do we put around it? If you place a div around it then you are saying that it is a division of content which it may not be as in most cases the image is related to whatever the current context is (otherwise why is it there at all).

I see the image above as being equivalent to saying this:

<p>This is what the English Flag looks like</p>

That is clearly a sentence and should be in a p element and therefore so should the image.

There can be cases made for the image to be in a div at times also or indeed in a heading element if the page was about flags with each flag starting the new section about that flag. I know you disagree but pictures are worth a 1000 words and words go inside p elements in most cases.

However, I see it as a minor semantic issue and perhaps the specs originally got it wrong and an image should have been a suitable block element by default with the img tag containing the content inside semantically.

If we’re using divs as background-image-holding sandbags and wrapping sometimes three divs around something for multiple background images, or to help center things, or for positioning stuff around… and with div (along with span) having for this very reason no semantic value, I’d say having a div around an image means… nothing. Or, it means, “the developer needed a block around this stuff” (for styling reasons, or Javascript reasons, or image reasons, or because they put something in their coffee that day).

Since div doesn’t mean “division of content” they had to go make new tags that did refer to grouping content (article, section, etc).

That said, I’d rather wrap a p around random text phrases than divs. A random text phrase to me is closer to a paragraph than an utterly meaningless div.

Which, would then support my argument a little more wouldn’t it :slight_smile: (Although I know what you meant ;))

That said, I’d rather wrap a p around random text phrases than divs. A random text phrase to me is closer to a paragraph than an utterly meaningless div.

My thoughts also.

I do see that there are merits for both sides of the argument but I just feel the p element is the lesser of two evils for phrases.

I agree w/ Paul in that having a p around the image makes sense - the image adds to the ongoing material - if it doesn’t, then it shouldn’t be there.

~TehYoyo