亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

搜索
博主信息
博文 34
粉絲 0
評(píng)論 0
訪問量 28630
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
html元素屬性及常用布局標(biāo)簽的介紹,附案例!
OC的PHP大牛之路
原創(chuàng)
1004人瀏覽過

元素的四種屬性

1. 通用屬性(幾乎所有的元素都有)

id用來表示頁面中的唯一元素
class用來表示同類元素
style用來自定義某個(gè)元素的樣式

2. 預(yù)置屬性(通用屬性的一個(gè)子集)

  1. <a href=""></a>
  2. <img src="" alt="">

a標(biāo)簽和img標(biāo)簽中的href/src/alt都屬于預(yù)置屬性

3. 事件屬性(有一個(gè)通用前綴:on+事件名稱)

4. 自定義屬性(有一個(gè)通用前綴:data-)

常用的布局標(biāo)簽

header頭部
main主體
footer頁腳
hr水平分割線

“圖片”是外部資源,通過標(biāo)簽引入到html中,通常使用單標(biāo)簽
<img src="圖片地址" alt="文字說明">

“鏈接”
<a href="鏈接">文字說明</a>
<a href="../文件地址">文字說明</a>

“列表”
無序列表ul

  1. <ul>
  2. <li><a href="">item1</a></li>
  3. <li><a href="">item2</a></li>
  4. <li><a href="">item3</a></li>
  5. </ul>

有序列表ol

  1. <ol>
  2. <li><a href="">item1</a></li>
  3. <li><a href="">item2</a></li>
  4. <li><a href="">item3</a></li>
  5. </ol>

自定義列表dl
dt標(biāo)題
dd說明

  1. <dl>
  2. <dt>地址:</dt>
  3. <dd>xx省xx市xx區(qū)</dd>
  4. </dl>

案例

列表案例

  1. <ul>
  2. <li><a href="https://baike.baidu.com/item/%E9%99%88%E8%8A%8B%E6%B1%90/22894783?fr=aladdin">陳芋汐<img src="https://img2.baidu.com/it/u=3619764950,178442798&fm=253&fmt=auto&app=138&f=JPEG?w=854&h=500" alt="" width="200"></a></li>
  3. <li><a href="https://baike.baidu.com/item/%E5%85%A8%E7%BA%A2%E5%A9%B5/53943633">全紅嬋<img src="https://img0.baidu.com/it/u=3871256462,664378978&fm=253&fmt=auto&app=138&f=PNG?w=652&h=450" alt="" width="200"></a></li>
  4. </ul>

表格元素

用“組合元素”表示,表格中的數(shù)據(jù)必須放在“單元格”中
colspan水平合并
rowspan垂直合并

案例

課程表

  1. <table width="600" border="1">
  2. <caption>課程表</caption>
  3. <thead>
  4. <tr bgcolor="lightgreen">
  5. <th bgcolor="lightblue"></th>
  6. <th>星期一</th>
  7. <th>星期二</th>
  8. <th>星期三</th>
  9. <th>星期四</th>
  10. <th>星期五</th>
  11. </tr>
  12. </thead>
  13. <tbody>
  14. <tr >
  15. <th rowspan="4" bgcolor="cyan">上午</th>
  16. <th bgcolor="yellow">校本</th>
  17. <th bgcolor="yellow">語文</th>
  18. <th bgcolor="yellow">語文</th>
  19. <th bgcolor="yellow">語文</th>
  20. <th bgcolor="yellow">英語</th>
  21. </tr>
  22. <tr bgcolor="lightgreen">
  23. <th bgcolor="yellow">英語</th>
  24. <th bgcolor="yellow">英語</th>
  25. <th bgcolor="yellow">數(shù)學(xué)</th>
  26. <th bgcolor="yellow">品生</th>
  27. <th bgcolor="yellow">語文</th>
  28. </tr>
  29. <tr bgcolor="lightgreen">
  30. <th bgcolor="yellow">語文</th>
  31. <th bgcolor="yellow">數(shù)學(xué)綜</th>
  32. <th bgcolor="yellow">書法</th>
  33. <th bgcolor="yellow">數(shù)學(xué)</th>
  34. <th bgcolor="yellow">美術(shù)</th>
  35. </tr>
  36. <tr bgcolor="lightgreen">
  37. <th bgcolor="yellow">數(shù)學(xué)</th>
  38. <th bgcolor="yellow">形體</th>
  39. <th bgcolor="yellow">英語</th>
  40. <th bgcolor="yellow">體育</th>
  41. <th bgcolor="yellow">體育</th>
  42. </tr>
  43. <tr bgcolor="lightgreen">
  44. <th rowspan="4" bgcolor="cyan">下午</th>
  45. <th bgcolor="yellow">活動(dòng)</th>
  46. <th bgcolor="yellow">科學(xué)</th>
  47. <th bgcolor="yellow">音樂</th>
  48. <th bgcolor="yellow">觀影</th>
  49. <th bgcolor="yellow">數(shù)學(xué)</th>
  50. </tr>
  51. <tr bgcolor="lightgreen">
  52. <th bgcolor="yellow">活動(dòng)</th>
  53. <th bgcolor="yellow">音樂</th>
  54. <th bgcolor="yellow">英語</th>
  55. <th bgcolor="yellow">品生</th>
  56. <th bgcolor="yellow">語文</th>
  57. </tr>
  58. <tr bgcolor="lightgreen">
  59. <th bgcolor="yellow">計(jì)算機(jī)</th>
  60. <th bgcolor="yellow">體育</th>
  61. <th bgcolor="yellow">興趣</th>
  62. <th bgcolor="yellow">興趣</th>
  63. <th bgcolor="yellow">班會(huì)</th>
  64. </tr>
  65. <tr bgcolor="lightgreen">
  66. <th bgcolor="yellow">美術(shù)</th>
  67. <th bgcolor="yellow">數(shù)學(xué)</th>
  68. <th bgcolor="yellow">興趣</th>
  69. <th bgcolor="yellow">興趣</th>
  70. <th bgcolor="yellow"></th>
  71. </tr>
  72. </tbody>
  73. <tfoot>
  74. <tr bgcolor="pink">
  75. <td colspan="6">注意:每天僅帶需要上課的書本就行,不允許帶水果、玩具進(jìn)教室!</td>
  76. </tr>
  77. </tfoot>
批改老師:PHPzPHPz

批改狀態(tài):合格

老師批語:css用的熟了,直接用選擇器,關(guān)于表格那就能少寫不少代碼
本博文版權(quán)歸博主所有,轉(zhuǎn)載請(qǐng)注明地址!如有侵權(quán)、違法,請(qǐng)聯(lián)系admin@php.cn舉報(bào)處理!
全部評(píng)論 文明上網(wǎng)理性發(fā)言,請(qǐng)遵守新聞評(píng)論服務(wù)協(xié)議
0條評(píng)論
作者最新博文
關(guān)于我們 免責(zé)申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長(zhǎng)!
關(guān)注服務(wù)號(hào) 技術(shù)交流群
PHP中文網(wǎng)訂閱號(hào)
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號(hào)
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)

  • 登錄PHP中文網(wǎng),和優(yōu)秀的人一起學(xué)習(xí)!
    全站2000+教程免費(fèi)學(xué)