您的位置:首页 > Web前端 > CSS

HTML&CSS Learning Notes 4

2015-09-16 19:26 369 查看

CSS

Basic I

The stylesheet.css tab (which we’ll teach you how to use in this course) contains all the CSS styling information: where HTML elements should go, what color they should be, how big they should be, and more.

<link type="text/css" rel="stylesheet" href="stylesheet.css"/>


Like img tags, the link tags also is the single-tag label. The basic using method is like that, there are
type
rel
href
, three attributes for referring the stylesheet.css file. There is no any punctuation between them.

Three styling methods

Inline styling method:

for example:
<p style="color:white; background-color:aquamarine"></p>


<style></style>


for example:

<style>
p {
color:white;
background-color:aquamarine;
}
</style>


Separate in different files, “.html” and “.css”.

Pattern:

selector {
property: value;
}


<!--I'm a comment!-->
in html file

/*I'm a comment!*/
in css file

em
as the unit of font-size

In general, 1em is equal to the default font size, then you can use this unit to sizing your font. Like 0.5em or 1.5em or 2 em, etc.

Backup values

Different browsers supported different values, if the value you used cannot be supported by the using browser, you should set backup values after your first choice, separately by using “,”.

text-decoration


There are four parameters for this attribute,
overlain
,
underline
,
line-through
,
blink
, and
none
. The meaning of this attribute is to place the line of text.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: