Introduction to CSS

CSS Tutorial


 

 


CSS Tutorial

CSS is an acronym for Cascading Style Sheet and it was created by Håkon Wium Lie in 1996 for web developers to change the layout, colors, and fonts of their websites.

CSS is a style sheet or presentational language that is used to layout, format, and style documents that are written in HTML to make them look beautiful. CSS is generally used with HTML to change the style of web pages and user interfaces. You can use CSS to change the color, backgrounds, borders, paddings, margins, fonts, icons, position and various other properties of HTML elements in a web document.

This tutorial covers all versions of CSS including CSS1, CSS2, and CSS3, and gives a complete understanding of CSS, starting from its basics to advanced concepts. This tutorial will teach you about CSS Box Model, Selectors, The cascade, Color, Sizing Units, Layout, Flexbox, Grid, Pseudo-elements and Pseudo-classes, Borders, Shadows, Focus, Functions, Gradients, Animations, Filters, Lists, Transitions, Overflow, Backgrounds, Text and typography.

CSS Examples

This tutorial teaches you every CSS concept with the help of suitable examples which you can execute in your browser itself without the need for any external HTML editor.

Below HTML & CSS code is editable where you can change the value of the code. You can click the run button icon to see the output of the following code. Try to change the values of width, font-size, and padding, etc., and then run it again to see the modified result.

<html>
<head>
   <style>
      div { 
          background-color: lightgrey; 
          width:100%; 
          padding:5px;
      }

      h1 {
          color: #40a944; 
          text-align: center;
      }

      p {
          font-family: verdana;
          font-size: 20px;
      }
   </style>
</head>
<body>
   <div>
      <h1>CSS Example</h1>
      <p>This is a paragraph.</p>
   </div>
</body>
</html>

Why Learn CSS?

Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable.

CSS is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will list down some of the key advantages of learning CSS:

  • Create Stunning Web site: CSS handles the look and feel part of a web page. Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, layout designs, variations in display for different devices and screen sizes as well as a variety of other effects.
  • Become a web designer: If you want to start a career as a professional web designer, HTML and CSS designing are must-have skills.
  • Control web: CSS is easy to learn and understand but it provides powerful control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.
  • Learn other languages: Once you understand the basics of HTML and CSS then other related technologies like JavaScript, PHP, or Angular become easier to understand.

Applications of CSS

As mentioned before, CSS is one of the most widely used style languages over the web. I'm going to list a few of the CSS applications here:

  • CSS saves time: You can write CSS once and then reuse the same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.
  • Pages load faster: If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.
  • Easy maintenance: To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
  • Superior styles to HTML: CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.
  • Multiple Device Compatibility: Style sheets allow content to be optimized for more than one type of device. By using the same HTML document, different versions of a website can be presented for handheld devices such as PDAs and cell phones or for printing.
  • Global web standards: Now HTML attributes are being deprecated and it is being recommended to use CSS. So it's a good idea to start using CSS in all the HTML pages to make them compatible with future browsers.

Audiences

This CSS tutorial will help both students as well as professionals who want to make their websites or personal blogs more attractive. We recommend reading this tutorial, in the sequence listed in the left side menu.

Today, HTML and CSS are essential languages to learn for anyone involved in the web development process including Web Developers, Web Designers, Graphic Designers, Content Managers, and Project Managers etc.

Prerequisites

Don't worry, you really don't need to be a computer geek to learn CSS. It's a very easy styling and presentational language which anyone can learn on the go. You simply need to be familiar with:

  • Basic word processing using any text editor.
  • How to create directories and files.
  • How to navigate through different directories.
  • Internet browsing using popular browsers like Internet Explorer or Firefox.
  • Developing simple Web Pages using HTML or XHTML.

If you are new to HTML and XHTML, then we would suggest you go through our HTML Tutorial or XHTML Tutorial first.

Previous Post Next Post

Contact Form