發表文章

目前顯示的是 8月, 2018的文章

「HTML」「DOCTYPE」 HTML文件類型的重要性

<!DOCTYPE> 會告知你的 瀏覽器 這個文件是用哪個版本的 HTML (或 XML )撰寫。Doctype 是一種宣告,而非 tag 。你也可以把它想作「document type declaration」(文件類型宣告),或是縮寫的 「DTD」。 很久以前,網頁通常有兩種版本:網景(Netscape)的 Navigator 以及微軟(Microsoft)的 Internet Explorer。在 W3C 創立網路標準後,為了不破壞當時既有的網站,瀏覽器不能直接起用這些標準。因此,瀏覽器導入了能分辨符合新規範、或屬於老舊網站的兩種模式。 目前瀏覽器的排版引擎有三種模式:怪異模式(Quirks mode)、接近標準模式(Almost standards mode)、以及標準模式(Standards mode)。在 怪異模式 ,排版會模擬 Navigator 4 與 Internet Explorer 5 的非標準行為。為了支持在網路標準被廣泛採用前,就已經建置好的網站,這麼做是必要的。在 標準模式 ,行為(期待)由 HTML 與 CSS 的規範描述起來。在 接近標準模式 ,有少數的怪異行為被實行。 「標準模式」 常用的四種設定方法如下: <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/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 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.

「CSS」「div區塊介紹」 單欄式網頁排版設計

圖片
單欄式網頁排版設計 < style type = "text/css" > #Header { width : 360px ; height : 80px ; text-align : center ; line-height : 80px ; font-size : 15px ; color : #fffaf3 ; font-weight : bold ; background-color : #f9c81e ; } #body { width : 360px ; height : 400px ; text-align : center ; line-height : 280px ; font-size : 15px ; color : #f9c81e ; font-weight : bold ; background-color : #1cf027 ; float : left ; } #Footer { width : 360px ; height : 50px ; text-align : center ; line-height : 50px ; font-size : 15px ;

「CSS」「div區塊介紹」 二欄式網頁排版設計

圖片
二欄式網頁排版設計: <! DOCTYPE HTML PUBLIC > < style type = "text/css" > #Header { width : 360px ; height : 80px ; text-align : center ; line-height : 80px ; font-size : 15px ; color : #fffaf3 ; font-weight : bold ; background-color : #f9c81e ; } #Sidebar { width : 120px ; float : left ; height : 280px ; text-align : center ; line-height : 280px ; font-size : 15px ; color : #ffffff ; font-weight : bold ; background-color : #6a54e2 ; } #body { width : 240px ; height : 280px ; text-align : center ; line-height : 280px ; f