{"id":473,"date":"2018-02-26T07:00:00","date_gmt":"2018-02-26T14:00:00","guid":{"rendered":"https:\/\/coreassistance.com\/tips\/?p=473"},"modified":"2018-02-15T12:18:12","modified_gmt":"2018-02-15T19:18:12","slug":"css-terminology","status":"publish","type":"post","link":"https:\/\/coreassistance.com\/tips\/2018\/02\/26\/css-terminology\/","title":{"rendered":"CSS Terminology"},"content":{"rendered":"<p>A few weeks ago, I showed you what all the various bits and pieces of HTML are called in <a href=\"\/tips\/2018\/02\/05\/html-terminology\/\">the HTML Terminology tip<\/a>.  Today we&#8217;re going to find out what all the basic CSS terms refer to.<\/p>\n<p>Let&#8217;s use this CSS as a starting point:<\/p>\n<pre><code class=\"css\">.example {\r\n    color: green;\r\n    font-weight: bold;\r\n}<\/code><\/pre>\n<p>That entire thing is called a <strong>rule<\/strong>.  In older versions of the CSS specification it was also referred to as a <strong>rule set<\/strong>.<\/p>\n<p>The first part of this rule is the <strong>selector<\/strong>:<\/p>\n<pre><code class=\"css\">.example<\/code><\/pre>\n<p>The selector specifies which elements this CSS rule applies to.  It <em>selects<\/em> the elements (hence the name).  In this case this CSS rule applies to all elements with the <code>example<\/code> class.<\/p>\n<p>CSS rules can have multiple selectors, separated by commas, like this:<\/p>\n<pre><code class=\"css\">.example, h2, #primary<\/code><\/pre>\n<p>That would select all elements with the <code>example<\/code> class, all <code>h2<\/code> elements, and the elements with an <code>id<\/code> of <code>primary<\/code>.<\/p>\n<p>The second part of our example rule above are the <strong>declarations<\/strong>, which is everything between the curly braces:<\/p>\n<pre><code class=\"css\">color: green;\r\nfont-weight: bold;<\/code><\/pre>\n<p>The declarations define how the elements specified by the selector will be altered.  In this case there are two declarations, one to make the foreground color green, and the other to make the font weight bold.<\/p>\n<p>Each declaration is made up of a <strong>property<\/strong> and a <strong>value<\/strong>.  Take this declaration, for example:<\/p>\n<pre><code class=\"css\">color: green;<\/code><\/pre>\n<p>In this declaration the property is <code>color<\/code> and the value is <code>green<\/code>.<\/p>\n<p>A CSS rule can have as few or as many declarations as you wish.<\/p>\n<p>Now you know the basics of CSS terminology!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wondering what a selector is in CSS?  What about a rule, or a declaration?  Find out in this tip!<\/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-473","post","type-post","status-publish","format-standard","hentry","category-htmlcss"],"_links":{"self":[{"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts\/473","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=473"}],"version-history":[{"count":8,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts\/473\/revisions"}],"predecessor-version":[{"id":558,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/posts\/473\/revisions\/558"}],"wp:attachment":[{"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/media?parent=473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/categories?post=473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coreassistance.com\/tips\/wp-json\/wp\/v2\/tags?post=473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}