Do tags themselves count as content?



In this example, do the <p> tags also count as content or is the content just the sentence contained within the tags?


The content is just the information contained within the tags themselves. The tags are marking up this content so that the browser knows how to properly interpret and structure this information. As you will learn later in this lesson, the content is not always contained within an opening and closing tag. For example, the <img> tag is an example of a self-closing tag and it introduces content into the page differently than the <p> element.

FAQ: Learn HTML Elements - Intro to HTML - HTML Anatomy

should be than not then


Thank you for pointing that out. Fixed.


can someone tell me if this is right so the < p > element can only contain text or can it contain images too? and also it said it the last question that tags like images can’t contain content at all is this because after you finish your content you use the < IMG > to finish the content off? thanks guys in advance


A paragraph may contain any inline level element. B, I, STRONG, EM, SPAN, INPUT, BR, HR and IMG are among such elements. (Check up on BR and HR as to whether block or inline.)

In the old days we used to have an unwritten rule… “No inline elements in the BODY.” That means an IMG would necessarily be contained in either a DIV, an LI or a P. I still recommend containing images, even if this rule is flouted in present day.

An IMG element is known as a void element since it is not a content container. It’s content is written to attributes on the element. For IMG, this would be the src, title and alt attributes.