CSS - Cascading Style Sheets

CSS - Cascading Style Sheets

CSS3 BASICS

WHAT IS CSS ?

what.PNG CSS is an acronym for Cascading Style Sheet. It is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML. CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript. Just as it's name implies, it is used for adding styles to a web page . Read more about CSS HERE.

FORMAT OF CSS

CSS files are saved using the .css extension. For example First.css, Resume.css. It takes a combination of several. It has the syntax:

selector {
        attribute name: attribute value;
}

ADDING CSS TO AN HTML FILE

CSS can be added to HTML in three (3) ways:

  • Inline method
  • Internal method
  • External method

1- Inline method: In this method, the CSS codes are added inside the tags to be styles. This is done inside the HTML file. It looks like this:

<p style="color:red;"> I am a red paragraph</p>

2- Internal method: In this method, the style element is added in the head section of the HTML file. It looks like this:

<head> 
<style type="text/css">
......
</style>
</head

3- External method: In this method, the CSS codes are written in another document/file and then linked with the HTML file through an HTML link tag which has the format: <link rel="stylesheet" href="CSS_fileName.css"> External method is most recomended .