XHTML網(wǎng)頁圖片應(yīng)用

 

合理的添加圖片可以使一個(gè)網(wǎng)頁更加的美觀。

圖片標(biāo)簽<img>

<img>標(biāo)簽用于在網(wǎng)頁里插入圖片。<img>標(biāo)簽有一個(gè)重要的屬性"src",它的屬性值就是圖片的地址。下面我們就在我們的index.html里插入一個(gè)圖片。打開”index.html“文件,在</body>前加上如下代碼:

<p><img src="http://images.sj33.cn/uploads/allimg/200712/20071224141723713.gif" border=0 cellSpacing=0 cellPadding=6 width="95%" align=center>
<p><a ><img src="http://images.sj33.cn/uploads/allimg/200712/20071224141723713.gif"alt="技術(shù)支持"/></a>< /p>

保存后瀏覽網(wǎng)頁,請(qǐng)?jiān)俅未_認(rèn)您的網(wǎng)頁與這個(gè)網(wǎng)頁相同。看看圖片是不是變成了超級(jí)鏈接,點(diǎn)擊一下圖片就會(huì)進(jìn)入菜鳥吧的主頁了。

關(guān)于XHTML的效驗(yàn)

從本節(jié)開始我們就不再修改"index.html"這個(gè)網(wǎng)頁的外觀了,現(xiàn)在將我們制作的網(wǎng)頁送交權(quán)威機(jī)構(gòu)檢驗(yàn)一下。首先進(jìn)入:http: //validator.w3.org/,該頁面就是一個(gè)XHTML效驗(yàn)工具,它用來檢驗(yàn)我們制作的網(wǎng)頁是否符合XHTML的標(biāo)準(zhǔn)。您可以選擇用網(wǎng)址效驗(yàn),也可以上傳文件效驗(yàn)。您可以選擇文件上傳效驗(yàn),方法如下:

在”Validate by File Upload“有“Local File”一欄,點(diǎn)擊瀏覽,找到并選中之前保存的"index.html",然后點(diǎn)擊“check”按鈕。您的結(jié)果應(yīng)該與我們通過網(wǎng)址效驗(yàn)的結(jié)果一樣。返回如下錯(cuò)誤信息:

Sorry, I am unable to validate this document because on line 3, 6-9, 12-14, 16-22 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.

難道我們的網(wǎng)頁不符合XHTML標(biāo)準(zhǔn)嗎?請(qǐng)繼續(xù)看下一節(jié)的內(nèi)容。

標(biāo)簽:

相關(guān)文章

隨機(jī)推薦