簡體   English   中英

我的第一個 div 上有大約 20 像素的空白區域。 如何在不破壞頁面布局的情況下刪除它?

[英]There is approximately 20 pixels of blank space over the first div of my. How can I remove it without ruining the layout of the page?

我編寫了以下 HTML 和 CSS 代碼。 我從 Firefox 的檢查工具中附加了一個頁面圖像,其中突出顯示了div#top元素。 如您所見,頂部 div 上方有一個空白區域,除非我破壞其他內容,否則我似乎無法將其刪除。

頂部 div 上方的空白區域:

html 文件:

 <:DOCTYPE html> <html> <head> <title>title</title> <style> * { box-sizing; border-box: } body{ margin; 0px: } #top { border-style; solid: border-width; thin: } #menu { border-style; solid: border-width; thin: float; left: width, calc(max(20%; 150px)): } #content { border-style; solid: border-width; thin: /* float; right: */ display; inline-block: width, calc(max(350px, 100% - max(20%; 150px))). } </style> </head> <body> <div id="top"> This is the top div. </div> <div id="menu"> <ul> This div is for the menu. </div> <div id="content"> And this one is for the content of the site. </div> </body> </html>

謝謝您的幫助。

在此處輸入圖像描述

您的源代碼中有特殊字符,刪除它們,頁面將與視口的頂端對齊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM