html頭部聲明

來源:互聯網
上載者:User

標籤:做網站   開發   命名   

嚴格類型:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd">

過渡類型(開發使用):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

框架組(做網站後台):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

xmlns:命名空間,解決命名衝突的

<html xmlns="http://www.w3.org/1999/xhtml">

meta:單標記,告訴瀏覽器我們是什麼文件類型

1、結構

html、xhtml、xml

2、表現:

版式,顏色,大小

css3.0

行內式:

<h1 style="color:white;backgroud-color:blue">行內式</h1>

嵌入式:在head中

<style type="text/css">h1{color:white;backgroud-color:blue;}

匯入式:在head中

<style type="text/css">@import"mystyle.css";</style>

連結式:在head中

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

選取器的優先順序別:行內樣式>ID樣式>類別樣式>標記樣式

(1)、標記選取器:標籤名稱


(2)、類別選取器:.

<p class="a">php100中文網</p>.a{color:blue;}

(3)、ID選取器:#

<p id="b">php100中文網</p>#b{color:yellow;}

區別:id只能出現一次,class可以出現多次

(4)、交集選取器:只會選擇h1並且class等於title的

<h1 class="title">php100中文網</h1><h1>創恩教育</h1><p class="title">php學習</p>h1.title{color:red;}

執行:

650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/45/3D/wKioL1PkoHXRLdtxAABUuqi-YhU386.jpg" title="fa2b93b9-b7e3-4fb0-ba42-e0f81ac60c86.png" alt="wKioL1PkoHXRLdtxAABUuqi-YhU386.jpg" />

(5)、並集選取器:所有都能滿足這個樣式

<h1 class="title">php100中文網</h1><h1>創恩教育</h1><p class="title">php學習</p>h1,p,h1.title{color:red;}

執行:

650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/45/3D/wKioL1PkoKeSHkwzAABZG2XXUck086.jpg" title="fa2b93b9-b7e3-4fb0-ba42-e0f81ac60c86.png" alt="wKioL1PkoKeSHkwzAABZG2XXUck086.jpg" />

(6)、後代選取器:

<p><strong>你好</strong></p><strong>創恩教育</strong>p strong{color:red;}

執行:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/45/3C/wKiom1Pkn7qBs3XoAAAVJVnUYdc406.jpg" title="fa2b93b9-b7e3-4fb0-ba42-e0f81ac60c86.png" alt="wKiom1Pkn7qBs3XoAAAVJVnUYdc406.jpg" />

3、行為

javascript


本文出自 “Jerry” 部落格,請務必保留此出處http://alipay.blog.51cto.com/7119970/1537570

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.