skip to Main Content

Getting to Know CSS

When creating a website we all know that CSS is the one that is responsible for making it look nice and appealing to the eyes of the user. Before we go ahead to know more about it, do you know what CSS means? Actually, CSS stands for Cascading Style Sheets. It allows the web designer to control the appearance and layout of multiple pages all at once.

The CSS Syntax

Selector
{

Property:Value;

}

Selector – is the HTML tag or the tag to be defined.

Property – is the elements attribute to be modified.

Value – is the new value assigned to the elements attribute.

There are 3 ways to put CSS in your website and how they can be specified:

A. Inside the HTML element or inline style.

Ex.

<h1 style=”color:red;letter-spacing:2px;”> HELLO WORLD </h1>

B. Next is the inside <head> tag or the internal style sheet.

Ex.

<head>
<style type=”text/css”>
Body{
 Background-color:red;
}
 P {
 Font-size:12px;
}
</style>
</head>

C. Last is an external css file or the external style sheet, when using external style sheet the style written in text editor should be saved with .css extension name and should not contain any HTML tags.

Ex.

Body {
Background-color:red;
 }
 P {
Font-size:12px;
 }

Then save it. It would be better if you save it as ‘style.css.’

How to insert the external style sheet? Inside the head tag of the HTML code is where you put and link the external style sheet.

Ex.

<head>
<link type="text/css" href="http://example.com/css/style.css" rel="stylesheet" />
</head>

And that’s it if you want to explore more things about css and get to know the other css properties try to look in http://www.w3schools.com/css/.   I hope you something new in this article.

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top