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

CSS: An Overview

2013-12-14 12:47 330 查看

INTRODUCTION

CSS: Cascading Style Sheets, it's a language to describe the appearance and formatting of your HTML.

stylesheet.css: It's a file that describes how an HTML file should look.

The Reason why we seperate form(CSS) from function:

1. You can apply the same formatting to several HTML elements without rewriting code (e.g. 
style="color:red":
)
over and over.

2. You can apply similar appearance and formatting to several HTML pages from a single CSS file.


SYNTAX

selector {
      property: value;

      property: value;
      property: value;
      .....

}
A Selector can be any HTML element, such as <p>, <img> or <table>
A property is an aspect of a selector, such as font size, color ,font-family
A value is a possible setting for a property.
Finally, you need a semi-colon(;) to end with property-value.


TAGs or PROPERTY

<link>: link external files, i.e. stylesheet.css. 链接外部文件。
        i.e. <link type="text/css" rel="stylesheet" href="stylesheet.css">
/* comments */: CSS注释。
<px>: pixels, 像素, 字体单位。
<em>: 1em表示设备显示的默认字体大小,便于移植。


SKILLS

#112233: 十六进制格式表示颜色,以#开始。

font-family:Verdana, Tahoma, serif; : 字体使用备份,如果第一种字体不支持使用第二种,依次类推。
border: property of HTML elment, 元素边框的属性,支持多个属性值。如 border: 1px solid blue。
text-decoration: links property, 超链接的文本属性,可选none。
border-radius: 圆角效果,后跟像素为圆角半径。
margin: auto: 两侧空白相同,即居中。

(完)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  HTML CSS INTRODUCTION