Friday, February 23, 2018

WebDesign: HTML Tags vs. Elements vs. Attributes (W7-P3)


Before we may have used the terms tags and elements synonymously.

However, we can now make a clear distinction among tags, elements and something called attributes.

We can and should make these distinctions when we are using HTML code like the following.

<p class="para1"> Welcome to the Fish Web Site. Everything you want to know about fish is in this web site. </p>
<img class="imagec" src="barracuda.jpg">

The above comes from some HTML code we played with in a recent post.

Read the following and note the definitions and distinctions among tags, elements and attributes.


After reading the page linked to above, we should be above to identify the elements, the tags and the attributes in the above HTML code.  Some questions: How many elements do we have above?  How many attributes are there in the img element?  Does the img element have a closing tag?

Also, based on the code we worked with recently, what is the purpose of the class attribute?  What does the class attribute have to do with the CSS code?  How are they linked?




Share this post with others. See the Twitter, Facebook and other buttons below.
Please follow, add, friend or subscribe to help support this blog.
See more about me at my web site WilliamHartPhD.com.






No comments:

Post a Comment

Thank you for your comment.
Your comment will be reviewed.
If acceptable, it will be posted after it is carefully reviewed. The review process may take a few minutes or maybe a day or two.