{"id":251,"date":"2018-02-05T07:00:00","date_gmt":"2018-02-05T14:00:00","guid":{"rendered":"https:\/\/coreassistance.com\/tips\/?p=251"},"modified":"2018-02-01T13:45:17","modified_gmt":"2018-02-01T20:45:17","slug":"html-terminology","status":"publish","type":"post","link":"https:\/\/coreassistance.com\/tips\/2018\/02\/05\/html-terminology\/","title":{"rendered":"HTML Terminology"},"content":{"rendered":"<p>Elements, tags, attributes&#8230; there are a lot of terms used to describe the various bits of HTML.  Understanding the most common of these terms will help you understand and discuss HTML with confidence, so in this tip I&#8217;m going to describe all the terms that apply to this snippet of HTML:<\/p>\n<pre><code class=\"html\">&lt;a href=\"https:\/\/coreassistance.com\/\"&gt;Core Assistance&lt;\/a&gt;<\/code><\/pre>\n<p>That entire thing, the entire link from start to finish, is called an <strong>element<\/strong>.  Specifically, this is an <strong>anchor element<\/strong> (the <code>a<\/code> stands for anchor).<\/p>\n<p>This anchor element is made up of several components, the first of which is the <strong>opening tag<\/strong>, which is this part:<\/p>\n<pre><code class=\"html\">&lt;a href=\"https:\/\/coreassistance.com\/\"&gt;<\/code><\/pre>\n<p>This opening tag contains an <strong>attribute<\/strong>:<\/p>\n<pre><code class=\"html\">href=\"https:\/\/coreassistance.com\/\"<\/code><\/pre>\n<p>Attributes are made up of name-value pairs.  In this example, the <strong>name<\/strong> of this attribute is <code>href<\/code> and the <strong>value<\/strong> of the attribute is <code>https:\/\/coreassistance.com\/<\/code>.<\/p>\n<p>That&#8217;s the opening tag.  Next comes the <strong>content<\/strong> of the element, also commonly called the <strong>text content<\/strong>:<\/p>\n<pre><code class=\"html\">Core Assistance<\/code><\/pre>\n<p>Finally, we have the <strong>closing tag<\/strong>:<\/p>\n<pre><code class=\"html\">&lt;\/a&gt;<\/code><\/pre>\n<p>So, to recap, here&#8217;s the entire <strong>element<\/strong>:<\/p>\n<pre><code class=\"html\">&lt;a href=\"https:\/\/coreassistance.com\/\"&gt;Core Assistance&lt;\/a&gt;<\/code><\/pre>\n<p>This <strong>element<\/strong> has:<\/p>\n<ul>\n<li>An <strong>opening tag<\/strong>:<br \/><code>&lt;a href=\"https:\/\/coreassistance.com\/\"&gt;<\/code>\n<ul>\n<li>Containing an <strong>attribute<\/strong>:<br \/><code>href=\"https:\/\/coreassistance.com\/\"<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Some <strong>text content<\/strong>:<br \/><code>Core Assistance<\/code><\/li>\n<li>A <strong>closing tag<\/strong>:<br \/><code>&lt;\/a&gt;<\/code><\/li>\n<\/ul>\n<p>There are, of course, a couple of exceptions worth pointing out.<\/p>\n<p>Some HTML elements do not have both opening and closing tags, and contain no text content.  Take the <strong>image element<\/strong>, for example:<\/p>\n<pre><code class=\"html\">&lt;img src=\"...\" alt=\"...\"&gt;<\/code><\/pre>\n<p>In this case the code above is still referred to as an <strong>element<\/strong>, but instead of calling this an opening or closing tag, it&#8217;s simply referred to as a <strong>tag<\/strong>.<\/p>\n<p>This can lead to a bit of confusion.  Most of the time an HTML <strong>element<\/strong> has both a <strong>start tag<\/strong> and an <strong>end tag<\/strong>, with neither tag representing the whole element, but rather being part of it.  With some elements, however, that have no content, only a single tag is used, and that single tag represents the entire element.<\/p>\n<p>Another exception applies to <strong>attributes<\/strong>.  Most of the time an attribute consists of a <strong>name<\/strong> and a <strong>value<\/strong>, but some attributes have no value.  The <code>checked<\/code> attribute is a good example of this:<\/p>\n<pre><code class=\"html\">&lt;input type=\"checkbox\" checked&gt;<\/code><\/pre>\n<p>This <strong>input element<\/strong> contains two <strong>attributes<\/strong>.  The first has a <strong>name<\/strong> (<code>type<\/code>) and <strong>value<\/strong> (<code>checkbox<\/code>), but the second attribute just has a name: <code>checked<\/code>.  The mere presence of this attribute is enough to indicate the state of the checkbox, so no value is required.<\/p>\n<p>Now you know the most common terms used in HTML!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever wonder what the difference is between a tag and an element?  Or what, exactly, an attribute is?  If so, this is the tip for you!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-251","post","type-post","status-publish","format-standard","hentry","category-htmlcss"],"_links":{"self":[{"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts\/251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":17,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts\/251\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}