批改狀態(tài):合格
老師批語:作業(yè)非常的簡潔, 點擊運行直接看結果, 就是缺了一個作業(yè)總結,
檢查一下你的:運行按鈕, 打開的不對
【css基礎作業(yè)】
1、實例演示:<iframe>標簽的使用
<!DOCTYPE html> <html> <head> <title>iframe標簽的使用</title> <meta charset="utf-8"> </head> <body> <ul style="float:left"> <li><a href="https://www.baidu.com/" target="qx">百度</a></li> <li><a href="https://weibo.com/" target="qx">微博</a></li> <li><a href="https://www.taobao.com/" target="qx">淘寶</a></li> <li><a href="https://www.jd.com" target="qx">京東</a></li> <li><a href="http://ipnx.cn" target="qx">PHP中文網(wǎng)(拒絕內嵌訪問)</a></li> </ul> <iframe src="" name="qx" width="1000px" height="600px" scrolling="no" frameborder="0" style="float:center;"></iframe> </body> </html>
問題:1、內嵌地址后發(fā)現(xiàn),部分網(wǎng)站拒絕訪問。2、重復點擊同一選項,會在新頁面打開。(target指向不能識別
)
2、實例演示: css樣式設置的優(yōu)先級
樣式越接近標簽所在優(yōu)先級越高:標簽樣式>內部樣式>外部樣式
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"> <!-- css樣式文件放置本文件統(tǒng)一目錄,內容為:div {color:red;} --> <style type="text/css"> p {color: green;} </style> </head> <body> <p style="color:blue;">css樣式設置的優(yōu)先級,應為藍色</p> <p>css樣式設置的優(yōu)先級,應為綠色</p> <div>css樣式設置的優(yōu)先級,應為紅色</div> </body> </html>
3、實例演示: css的id, class與標簽選擇器的使用規(guī)則
css選擇器優(yōu)先級:id>class>標簽
<!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <style type="text/css"> #id{ color: red; } .class{ color: blue; } p{ color: yellow; } </style> </head> <body> <p id="id" class="class">選擇id,樣式應該是紅色</p> <p class="class">選擇class,樣式應該是藍色</p> <p >選擇標簽p,樣式應該是黃色</p> </body> </html>
4、實例演示盒模型的五大要素: width, height, padding, border, margin(margin可暫忽略)
<!DOCTYPE html> <html> <head> <title>盒子模型</title> <meta charset="utf-8"> <style type="text/css"> span { width: 800px; height: 1000px; border: 2px solid red; padding:10px 20px 30px 40px; margin: 40px 30px 20px 10px; } </style> </head> <body> <p>盒子模型</p> <span > 盒子模型五要素 </span> </body> </html>
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號