Intro To CSS: General Rule and L

作者: 此之木 | 来源:发表于2019-04-11 04:35 被阅读24次

I still can’t believe I have already done all the HTML course sections. After I shared all my study notes and learning process in the blog, now I don’t feel scared anymore. Instead, I feel so much earned.

So, it is time to start to learn CSS which will transform our web page into a customized style.

What is CSS?

CSS stands for “cascading style sheets”. It is a language for specifying how documents are presented to users such as how they are styled and laid out. (Defination from MDN “How CSS Work”)

CSS is like a decoration for your store. Nobody wants to visit an boring web page with only text just like nobody likes to enter a store without any creative design.

CSS can make our sites more unique and more attractive, so customers are willing to stay the site and to explore more information.

General Rule of CSS:

“Selector” is the HTML tags which we want to make special style such as<h1>, <p>, <li>, <body>, etc.

“Property: value”is how do you like to change for that tag. For example, if you want to make the <li> text in orange color. You may want to write like below:

By the way, don’t forget to add semicolon at the end of property value. 

How to link to CSS File?

We could add CSS code into the HTML part, but it will make the code too messy. So, it is not a good idea to do that.

The best way is to create a separate CSS file and link to our HTML. This way can make the code more organized and easier to edit.

So, we insert <link> tag under HTML to link our CSS file to HTML. Please see the example slide from the course below:

By the way, remember to save the css file and the html file under the same folder.

相关文章

网友评论

    本文标题:Intro To CSS: General Rule and L

    本文链接:https://www.haomeiwen.com/subject/ijfziqtx.html