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.
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> |
-
And you will get the output.like below.
- 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{ .parag{ |
- Now output will be,
- 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.
0 comments :
Post a Comment