Ladies and Gentlemen. how are you all? I hope you are well? I’m good for the grace of God.
Basic Webdesign: Part-10
In the last episode we had discussed about CSS. Today I will talk about the syntax of CSS.
Also Check: Lesson-09: Basic Webdesign: Part-09
CSS structure can be divided into two parts. These are;
- Selectors
- Declaration
Selectors: The selectors HTML tags,
such as body, p, h1, h2, h3, h4. h5, h6, etc. HTML tag selector is selected, and then to work with the selectors. Selectors are discussed in more detail on the next chapter.
Declaration: HTML tag selector to select the style is determined by the declaration. The declaration of the two parts of the punch: They are, Property and Value.
Value of Property and between the colon (:) symbol is used. A CSS file will be formed;
Selector {Property: Value}
Example
p {text-align:center; color:black; font-family:arial; } h1 {color: red; text-align: center; }
* CSS file is saved with the extension .css. For example; style.css
* The second bracket is used to write CSS. For example; h1 {font-size: 36px; }
* Multiple declaration for the semicolon (;) is used. For example; p {color: red; font-family: Times New Roman; }
CSS Comments
Code is very important to reveal the comment. We can easily understand the comments that have been used to code for what reason. Then, subsequent to the advantage of code to change. Comments are not displayed in the browser. HTML tutorial you will also come to know about the comment.
To write CSS comments / * * / is used. For example;
/* This is Comment */ p {text-align:center; color:black; font-family:arial; } h1 {color: red; text-align: center; }
Many of you are just reading this tutorial, but does not practice. There are others who would copy the code and practice. It’s never going to do that. Practice writing your own code to do all the time. If you copy the code of practice, you may be able to understand a little bit now. However, later, you will have many problems. Then again, maybe you will learn. Many do not understand the issue now. So, if I want to learn better to write the code yourself. So, your code will increase writing skills.
Hope, you have understood. If you have any problem, comment in the comment box. I will try to solve your problem.