How to use css in website and why we use it?
CSS is the best way to design your html layout with different browsers compatibility and device responsive.
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language.
CSS describes how HTML elements are to be displayed on screen, paper, or in other media. This tutorial will teach you CSS from basic to advanced.
There are three ways to connect css with your html page
1. Inline CSS in which you can use css as
[code language=”css”] style="width:100px;" [/code]
attribute of any html tag
2. Embedded CSS in which you can create
this tag can be defined anywhere in the page but preferably you should define it inside head tag.
3. External CSS – Create one style.css file and include it in your html page and write complete css code inside that file.
You can use sinple link tag in your page head tag to include css in your html file.
[code language=”css”]<link href="css/style.css" rel="stylesheet"/>[/code]
Create classes, ids and tags in css files as per your need in style.css file and create html layouts. Now days css like a makeup of HTML without css you can complete your html page to work with all browsers and devices perfectly.
To learn about css classes , ids and tags read our next post.