HTML&CSS Learning Notes 4

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章