what is css

Cascading style sheets is called shortly as css which is used style websites such as making layouts,fonts and colours.It’s like class and object which is used in c++.We will explain in further lines more.

image

ADVANTAGES OF USING CSS

  • Reduction in lines of codes

    .Using css if you written a code in html each time you have to add style in each code to style the webpage.But if you have written in css code one time you can make a call and thus you can reduce codes.

  • Reduce Complexity
Consider if you are writing a html document for 1000 lines.And  want to change colours you know coding but if there are more chance to make errors and make trouble.But if you css just goto that particular class and one time change for all things.

Some other are fast load and saves time .

EXAMPLE

  • Using html:Use a notepad or some other html editors.And use the below codes..

<h1 style="color:blue"> Heading</h1>
  <p style="color:brown"> Paragraph.</p>                                                             <h1 >Heading2</h1>
  <p >Paragraph2.</p>

  • And you will get the output.like below.
image
  • In the above output if you want to make heading 2 and paragraph2 of above heading and paragraph colour  you have to  write the style once again .

Using css:

  • Copy and paste the below code in html editor.

<style>

.head{
color:blue;
}

.parag{
color:brown;
}
</style>                                                                                                                  <h1 class="head"> Heading</h1>
  <p class="parag"> Paragraph.</p>
<h1 class="head" >Heading2</h1>
  <p class="parag"> Paragraph2.</p>

  • Now output will be,

image

  • It’s for understanding purpose only..If you have website with 20 pages and consider you are styling using html.Now you can understand about css.

When I started to code using html , I don’t know about css.After some months only I came to know about css.Initially I frustrated to use and learn css  but after somedays I realised how css useful in many ways.So friends when you learn html also learn css.It’s a easy,important and useful one.

Print Friendly and PDF
SHARE

About me

Hi. I am interested in blogging.And sometimes play with webdesign,web development,domain sale,designing logo and more.

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment

Pages