This is my first post this year,
Today I like to share about the language of CSS.
What is CSS?
CSS is a simple language designed to give some beauty to the webpage by applying some syles. It is also known as cascading style sheet. This is a simple and easy to learn and use language.
How to write css?
Although we have learned to write html.
Here I like to share how to write css. First of all we should point out the element what should be decorated. For example we like to decorate the heading of the page and like to change its colour as blue.
So we want to decorate the element h1, which is heading one.
Now we should select what is the change we like to do. From the above target we have to change the colour of h1.
At last what is our preference to apply in the element as the change.
As in the above example our preference is blue to apply as the colour of the h1 element.
Now we see how to solve our target with CSS.
Element{change : preference}
Its that simple to write css.
Where to write?
We can add CSS in three places.
The first one is inline. It is a method to write css as an attribute. For example
In H1 tag, in style attribute we can add css...
The second method is known as internal css. This is to add within head tag. for that we will add style tag type our codes within them.
The third method is to add css is external css. For this we make a file with the extension css for eg:- style.css.
Then we have to add/ link the file with the working html file.
In the above image in line 6 it shows how to link the css file to the html file.
In the style.css file you can just started to type the css.
Like this you can add styles to your html elements.
Happy coding
![]() |
inline css |
The second method is known as internal css. This is to add within head tag. for that we will add style tag type our codes within them.
![]() |
internal css |
Then we have to add/ link the file with the working html file.
![]() |
External css |
In the style.css file you can just started to type the css.
Like this you can add styles to your html elements.
Happy coding
No comments:
Post a Comment