knowledgediarybd.com

Your Virtual Knowledge Campus







Introduction of CSS and CSS Syntax

c1CSS is a most important style sheets in web programming.

CSS stands for Cascading Style Sheets.Used in web designing to do control the style and layout of multiple Web pages all at a time.

Dear, learner in this tutorial you can learn css ,how to declare it,how to use it & also can know how to use an external css and internal css.

Before learning CSS you should have a knowledge about HTML.

Dear learner if you feel that you have to learn HTML then you can see

our Home Page for learning HTML.

What is  CSS ?:

1.CSS: Which means (Cascading Style sheets).

2.CSS:That is used to control the style and multiple layout of a web page.

3.CSS:That can be used as an internal & external cascading style sheets.

4.CSS: which define how to display HTML elements on a web page.

CSS Syntax:

In css rule there are  two main part: one is selector and other is one or more declarations.

For Example:

sdf

How to use CSS ?:

Mainly CSS is used to design  Paragraph, Heading, body, font size etc.

For Example:

P{ color:blackfont-size:14px;  text-align:center;  }

Or

you can also write looks like below.

P

{

color:black;

font-size:14px;

text-align:center;

}

Note: All CSS declarations ends with a semicolon(;) and block of declarations ends with two curly brackets.

How to declare  CSS  Externally?:

For example:

For Body Styling:

body

{

background-color: gray;

}

For Paragraph styling:

p

{

font-family:”Geneva, Arial, Helvetica, sans-serif”;

font-size:14px;

font-color:black;

text-align:left;

}

For Heading Styling:

h1

{

font-size:18px;

color:red;

font-family:”Times New Roman”;

text-align:center;

}

How to declare Internal  CSS ? :

We can also declare css internally.

For Example:

<html>

<head>
<title>www.knowledgediarybd.com</title>
<– For External style.css  file connection -!>
<link a href=”style.css” rel=”stylesheet” type=”text/css” />

      <style type=”text/css”>                        /*>>Internal css start Here*/

 body              {                                       /*>>css id for  web page body*/
background-color :green;
                       padding : 2px;
                       margin : 2px;
                      }

#main_wrapper                                       /*>>css id for css wrapper*/

{
                       width : 920px;
                       margin : 0 auto;
                       border : 2px solid red;
                       padding : 3px;
                    }

</style>                                        /* >End of the Internal CSS*/

</head>

  

<body>                                     /*>main body start here*/

<div id=”main_wrapper“>   /*Internal CSS id main_wrapper call here*/
<p>This is some holder text for now</p>
</div>

   </body>

</html>

Related Post or  you may fell interest:

knowledgediarybd.com © 2017
shares