国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > CSS > 正文

css教程:CSS基本介紹!

2024-07-11 08:23:18
字體:
供稿:網(wǎng)友
What You Should Already Know
Before you continue you should have some basic understanding of the following:
在繼續(xù)前你應(yīng)該具備相關(guān)的基礎(chǔ)知識(shí):HTML / XHTML

What is CSS? 什么是CSS?
CSS stands for Cascading Style Sheets
Styles define how to display HTML elements
Styles are normally stored in Style Sheets
Styles were added to HTML 4.0 to solve a problem
External Style Sheets can save you a lot of work
External Style Sheets are stored in CSS files
Multiple style definitions will cascade into one

CSS 意思就是 疊層樣式表
樣式定義了HTML元素怎樣去顯示
樣式一般存儲(chǔ)在樣式表中
樣式添加到HTML4.0中用來解決問題
利用外部樣式表可以提高你的工作效率
外部樣式表存儲(chǔ)在CSS文件中

Styles Solve a Common Problem
用樣式來解決一個(gè)共同的問題


HTML tags were originally designed to define the content of a document. They were supposed to say "This is a header", "This is a paragraph", "This is a table", by using tags like <h1>, <p>, <table>, and so on. The layout of the document was supposed to be taken care of by the browser, without using any formatting tags.
As the two major browsers - Netscape and Internet Explorer - continued to add new HTML tags and attributes (like the <font> tag and the color attribute) to the original HTML specification, it became more and more difficult to create Web sites where the content of HTML documents was clearly separated from the document's presentation layout.
To solve this problem, the World Wide Web Consortium (W3C) - the non profit, standard setting consortium, responsible for standardizing HTML - created STYLES in addition to HTML 4.0.
All major browsers support Cascading Style Sheets.

HTML標(biāo)簽起初被設(shè)計(jì)成為定義文檔的內(nèi)容。通過使用像<h1>,<p>,<table>這樣的標(biāo)簽他們應(yīng)該表達(dá)的是"這是一個(gè)標(biāo)題","這是一個(gè)段落","這是一張表格",而布局該由瀏覽器來處理并非使用格式化標(biāo)簽.
作為兩大瀏覽器 - 網(wǎng)景 和 IE - 不斷的添加新的HTML標(biāo)簽和屬性(像<font>標(biāo)簽和顏色屬性)來初始HTML的規(guī)格,這讓建立清楚的HTML文檔內(nèi)容并從形式中分離出來變的越來越困難.
為了解決這個(gè)難題,W3C 這個(gè)非贏利的,建立標(biāo)準(zhǔn)的組織,為HTML4.0增加了樣式
所有主流瀏覽器都支持樣式表

Style Sheets Can Save a Lot of Work
樣式表可以提高工作效率


Styles sheets define HOW HTML elements are to be displayed, just like the font tag and the color attribute in HTML 3.2. Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in your Web, just by editing one single CSS document!
CSS is a breakthrough in Web design because it allows developers to control the style and layout of multiple Web pages all at once. As a Web developer you can define a style for each HTML element and apply it to as many Web pages as you want. To make a global change, simply change the style, and all elements in the Web are updated automatically.

樣式表定義元素怎樣去顯示,就像在HTML3.2中字體標(biāo)簽和顏色屬性一般保存在一個(gè)外部的.css文件一樣.外部樣式表能夠讓你改變所有出現(xiàn)在你WEB中的外觀和布局,而僅僅通過編輯一個(gè)單獨(dú)的CSS文檔.(原理就是一動(dòng)多變)
CSS是一個(gè)在設(shè)計(jì)領(lǐng)域中的突破,因?yàn)樗饝?yīng)開發(fā)者一下就能控制多個(gè)WEB頁的樣式和布局.作為譯名WEB開發(fā)者你可以為每個(gè)HTML元素和應(yīng)用他的每個(gè)頁面定義一個(gè)你想要的樣式.來實(shí)現(xiàn)全面的改變,簡單的改變樣式,所有與之相關(guān)的元素都會(huì)自動(dòng)更新

Multiple Styles Will Cascade Into One

Style sheets allow style information to be specified in many ways. Styles can be specified inside a single HTML element, inside the <head> element of an HTML page, or in an external CSS file. Even multiple external style sheets can be referenced inside a single HTML document.
樣式表答應(yīng)樣式信息用多種方式來定義.樣式可以在一單獨(dú)的HTML元素中指定,在<head>元素中或在一外部CSS文件中.甚至多個(gè)外部樣表能集中在一個(gè)單一的HTML文檔中

Cascading order

What style will be used when there is more than one style specified for an HTML element?
當(dāng)多于一種的樣式指定一HTML元素時(shí)使用怎樣的樣式呢?

Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
一般說來所有樣式有下面的規(guī)則(第四個(gè)最有優(yōu)先性)

Browser default
瀏覽器默認(rèn)
External style sheet
外部樣式表
Internal style sheet (inside the <head> tag)
內(nèi)嵌樣式表(在<head>標(biāo)簽內(nèi))
Inline style (inside an HTML element)
行內(nèi)樣式(在一HTML元素內(nèi))
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default value).
所以寫在HTML元素中的樣式有最高的優(yōu)先權(quán)(寫在HTML元素內(nèi)的),它會(huì)替代其他形式的樣式.

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 怀来县| 印江| 田林县| 乌拉特中旗| 洪雅县| 南京市| 德州市| 遂川县| 邢台市| 甘泉县| 商南县| 大理市| 敦煌市| 南川市| 太白县| 台南县| 承德市| 汝州市| 正定县| 松滋市| 沙湾县| 勃利县| 上饶县| 镇康县| 会宁县| 永兴县| 郯城县| 腾冲县| 云南省| 西贡区| 潜江市| 定西市| 牟定县| 来安县| 兴义市| 长垣县| 射洪县| 沙田区| 巧家县| 宁化县| 彭山县|