javascript - 我這個頁面的main的盒模型為什么把header的模型空間也包括了。
問題描述
<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <title>Build a Personal Portfolio Webpage</title> <link rel='stylesheet' href='http://m.4tl426be.cn/wenda/rule/bootstrap-Normalize.css'> <link rel='stylesheet' > <link rel='stylesheet' href='http://m.4tl426be.cn/wenda/style.css'></head><body> <header class='navbar navbar-inverse navbar-fixed-top'><nav> <p class='container'><a href='http://m.4tl426be.cn/wenda/2738.html#'>Free Code Camp</a><ul class='nav navbar-nav navbar-text navbar-right'> <li><a href='http://m.4tl426be.cn/wenda/2738.html#'>about</a></li> <li><a href='http://m.4tl426be.cn/wenda/2738.html#portfolio'>portfolio</a></li> <li><a href='http://m.4tl426be.cn/wenda/2738.html#contact'>contact</a></li></ul> </p></nav> </header> <main><p class='container jumbotron'> <header><p class='intro-text'> <p>Front-End Developer and UX/UI designer, with practical experience in project management, branding strategy, and creative direction; devoted to functional programming and information architecture.</p> <hr> <span>Web Developer - User Experience Designer - Graphic Artist </span></p><img src='http://qlip.in/images/avatar.jpg' alt='666'> </header> <p> </p> <p> </p></p> </main> <footer> </footer></body></html>
問題解答
回答1:并不是包含。
你的header設(shè)置了navbar-fixed-top,在bootstrap中,這個會使用position:fixed,導(dǎo)致header脫離常規(guī)流。
根據(jù)堆疊上下文規(guī)則,已定位的盒在流內(nèi)非定位的盒之上,所以你看起來是被他包含了。
通常這種情況,你可以使用margin-top或者是padding-top之類的,來防止被遮擋。
相關(guān)文章:
1. Python爬蟲如何爬取span和span中間的內(nèi)容并分別存入字典里?2. mysql - 分庫分表、分區(qū)、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處3. mysql 查詢身份證號字段值有效的數(shù)據(jù)4. 視頻文件不能播放,怎么辦?5. flask - python web中如何共享登錄狀態(tài)?6. 請教使用PDO連接MSSQL數(shù)據(jù)庫插入是亂碼問題?7. python - 數(shù)據(jù)與循環(huán)次數(shù)對應(yīng)不上8. 黑客 - Python模塊安全權(quán)限9. mysql - 把一個表中的數(shù)據(jù)count更新到另一個表里?10. node.js - nodejs開發(fā)中常用的連接mysql的庫
