{"id":17,"date":"2012-05-04T23:56:24","date_gmt":"2012-05-04T23:56:24","guid":{"rendered":"https:\/\/learnwebcode.com\/?p=17"},"modified":"2016-03-29T01:36:43","modified_gmt":"2016-03-29T01:36:43","slug":"what-is-css","status":"publish","type":"post","link":"https:\/\/learnwebcode.com\/what-is-css\/","title":{"rendered":"CSS Lesson 1: What is CSS?"},"content":{"rendered":"<p>So you want to learn CSS?  Great decision; CSS is <strong><em>the<\/em><\/strong> language for web and graphic designers to learn.  Short for Cascading Style Sheet, CSS is the language used to add style to HTML elements.  If you are unfamiliar with HTML you will have little use for CSS, so I recommend you begin reading my <a title=\"Learn HTML\" href=\"https:\/\/learnwebcode.com\/xhtml-lessons\/\">HTML Lessons<\/a>.<\/p>\n<h2>A World Without Style<\/h2>\n<p>Imagine you have a web page written in HTML with your main heading inside a &lt;h1&gt; element and a few paragraphs in &lt;p&gt; elements.  Without any CSS, most web browsers will render your page in a plain black text, with your &lt;h1&gt; in a large, bold font.  Your paragraphs will fill the entire width of the browser, resulting in impossible-to-read line lengths (the human eye prefers only around 12 words per line).  To put it bluntly; your pages will look horrible.<\/p>\n<h2>CSS To The Rescue<\/h2>\n<p>We need CSS to add our own custom styles; we need CSS to add color, size, columns, and layout; we need CSS to beautify our typography; we need CSS to add background textures and images.  If good HTML is the key to an organized, accessible web, then CSS is the key to a beautiful web.  CSS puts the <em>design<\/em> in Web Design.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif\" alt=\"With and without css example\" width=\"447\" height=\"417\" \/><\/p>\n<h2>How It Works<\/h2>\n<p>Cascading Style Sheets are simple text files saved in a &#8220;.css&#8221; extension which contain style <strong>Rules<\/strong>.  For example, let&#8217;s imagine we had a &lt;h1&gt; heading element on a page, and we wanted to make it orange, and center aligned.  Here is the code we would add to our .css file:<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">h1 {\r\n    color: orange;\r\n    text-align: center;\r\n}<\/pre>\n<h2>Let&#8217;s Dissect The Code<\/h2>\n<p>Relax, I don&#8217;t expect you to understand this code yet!  Although you have zero training to understand the syntax of the code, if you speak English odds are you can make a little sense of it.  The following graphic explains the syntax of the code:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"anatomy-of-a-css-rule\" src=\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/anatomy-of-a-css-rule.gif\" alt=\"Anatomy of a CSS Rule\" width=\"447\" height=\"307\" \/><\/p>\n<p>Our CSS Rule begins with \u201ch1\u201d which is our <strong>CSS selector<\/strong>.  The selector tells the web browser which HTML element we wish to style.<\/p>\n<p>Next, the word \u201ccolor\u201d is a <strong>property<\/strong> and \u201corange\u201d is its <strong>value<\/strong>.  A property and value pair together and create a <strong>declaration<\/strong>.  We create complex style rules by stringing together multiple declarations, which are separated by semicolons.  This entire piece of code, including the selector and declarations, is known as a <strong>CSS Rule<\/strong>.<\/p>\n<p>Finally, directly preceding, and directly following the declarations we enclose our Rule in curly brackets (found on your keyboard by holding shift and pressing the buttons directly to the right of your P key).<\/p>\n<p>That\u2019s it for today\u2019s lesson.  You\u2019ve learned a great deal of new material, so let\u2019s recap.<\/p>\n<ul>\n<li>CSS styles the HTML elements of a web page<\/li>\n<li>Cascading Style Sheets are simple text files<\/li>\n<li>Style sheets are made up of Rules<\/li>\n<li>Rules are made up of selectors and declarations.<\/li>\n<li>Declarations are made up of properties  and values.<\/li>\n<\/ul>\n<p>In our next lesson we will learn how to write and save our first CSS file, and more importantly, how to link it to an HTML page.<\/p>\n<p>If you prefer to watch video lessons instead of reading written lessons check out <a href=\"\/web-design-for-beginners-real-world-coding-html-css\/\">my 8 hour video course<\/a> and learn pro-level HTML, CSS, and responsive design.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you want to learn CSS? Great decision; CSS is the language for web and graphic designers to learn. Short for Cascading Style Sheet, CSS is the language used to add style to HTML elements. If you are unfamiliar with HTML you will have little use for CSS, so I recommend you begin reading my [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-css-lessons"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSS Lesson 1: What is CSS? - LearnWebCode<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnwebcode.com\/what-is-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Lesson 1: What is CSS? - LearnWebCode\" \/>\n<meta property=\"og:description\" content=\"So you want to learn CSS? Great decision; CSS is the language for web and graphic designers to learn. Short for Cascading Style Sheet, CSS is the language used to add style to HTML elements. If you are unfamiliar with HTML you will have little use for CSS, so I recommend you begin reading my [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnwebcode.com\/what-is-css\/\" \/>\n<meta property=\"og:site_name\" content=\"LearnWebCode\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-04T23:56:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-29T01:36:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif\" \/>\n<meta name=\"author\" content=\"Brad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/\"},\"author\":{\"name\":\"Brad\",\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\"},\"headline\":\"CSS Lesson 1: What is CSS?\",\"datePublished\":\"2012-05-04T23:56:24+00:00\",\"dateModified\":\"2016-03-29T01:36:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/\"},\"wordCount\":555,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\"},\"image\":{\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif\",\"articleSection\":[\"CSS Lessons\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/learnwebcode.com\/what-is-css\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/\",\"url\":\"https:\/\/learnwebcode.com\/what-is-css\/\",\"name\":\"CSS Lesson 1: What is CSS? - LearnWebCode\",\"isPartOf\":{\"@id\":\"https:\/\/learnwebcode.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif\",\"datePublished\":\"2012-05-04T23:56:24+00:00\",\"dateModified\":\"2016-03-29T01:36:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnwebcode.com\/what-is-css\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage\",\"url\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif\",\"contentUrl\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnwebcode.com\/what-is-css\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learnwebcode.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS Lesson 1: What is CSS?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnwebcode.com\/#website\",\"url\":\"https:\/\/learnwebcode.com\/\",\"name\":\"LearnWebCode\",\"description\":\"Become a Web Developer\",\"publisher\":{\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnwebcode.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\",\"name\":\"Brad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\",\"url\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\",\"contentUrl\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\",\"width\":400,\"height\":400,\"caption\":\"Brad\"},\"logo\":{\"@id\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\"},\"url\":\"https:\/\/learnwebcode.com\/author\/lwcadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS Lesson 1: What is CSS? - LearnWebCode","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnwebcode.com\/what-is-css\/","og_locale":"en_US","og_type":"article","og_title":"CSS Lesson 1: What is CSS? - LearnWebCode","og_description":"So you want to learn CSS? Great decision; CSS is the language for web and graphic designers to learn. Short for Cascading Style Sheet, CSS is the language used to add style to HTML elements. If you are unfamiliar with HTML you will have little use for CSS, so I recommend you begin reading my [&hellip;]","og_url":"https:\/\/learnwebcode.com\/what-is-css\/","og_site_name":"LearnWebCode","article_published_time":"2012-05-04T23:56:24+00:00","article_modified_time":"2016-03-29T01:36:43+00:00","og_image":[{"url":"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif","type":"","width":"","height":""}],"author":"Brad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Brad","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnwebcode.com\/what-is-css\/#article","isPartOf":{"@id":"https:\/\/learnwebcode.com\/what-is-css\/"},"author":{"name":"Brad","@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6"},"headline":"CSS Lesson 1: What is CSS?","datePublished":"2012-05-04T23:56:24+00:00","dateModified":"2016-03-29T01:36:43+00:00","mainEntityOfPage":{"@id":"https:\/\/learnwebcode.com\/what-is-css\/"},"wordCount":555,"commentCount":5,"publisher":{"@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6"},"image":{"@id":"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage"},"thumbnailUrl":"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif","articleSection":["CSS Lessons"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/learnwebcode.com\/what-is-css\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/learnwebcode.com\/what-is-css\/","url":"https:\/\/learnwebcode.com\/what-is-css\/","name":"CSS Lesson 1: What is CSS? - LearnWebCode","isPartOf":{"@id":"https:\/\/learnwebcode.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage"},"image":{"@id":"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage"},"thumbnailUrl":"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif","datePublished":"2012-05-04T23:56:24+00:00","dateModified":"2016-03-29T01:36:43+00:00","breadcrumb":{"@id":"https:\/\/learnwebcode.com\/what-is-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnwebcode.com\/what-is-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learnwebcode.com\/what-is-css\/#primaryimage","url":"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif","contentUrl":"https:\/\/learnwebcode.com\/wp-content\/uploads\/2010\/02\/with-and-without-css.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/learnwebcode.com\/what-is-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learnwebcode.com\/"},{"@type":"ListItem","position":2,"name":"CSS Lesson 1: What is CSS?"}]},{"@type":"WebSite","@id":"https:\/\/learnwebcode.com\/#website","url":"https:\/\/learnwebcode.com\/","name":"LearnWebCode","description":"Become a Web Developer","publisher":{"@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnwebcode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6","name":"Brad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg","url":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg","contentUrl":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg","width":400,"height":400,"caption":"Brad"},"logo":{"@id":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg"},"url":"https:\/\/learnwebcode.com\/author\/lwcadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":12,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":1010,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts\/17\/revisions\/1010"}],"wp:attachment":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}