HTML&CSS Learning Notes 4

来源:互联网 发布:相宜本草专卖店淘宝 编辑:程序博客网 时间:2024/06/07 15:40

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

  1. Inline styling method:
    for example: <p style="color:white; background-color:aquamarine"></p>

  2. <style></style>
    for example:

    <style>    p {        color:white;        background-color:aquamarine;    }</style>
  3. 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.

0 0
原创粉丝点击