[英]How do I remove this blank space to the left of this header?
我最近開始自己學習 css 和 html,我想在頁面頂部制作一個帶有一些菜單等的標題/橫幅,但我意識到標題左側有這個“間隙” 。
這是我用於此標題的 css。
.header {
background: #555;
color: #f1f1f1;
position: fixed;
top: 0;
width: 100%;
margin: 0 auto;
}
這是 html
<div class="header">
<!-- code -->
</div>
您可以使用此代碼重試。 你必須設置left: 0;
.header { background: #555; color: #f1f1f1; position: fixed; top: 0; width: 100%; margin: 0 auto; left: 0; }
<div class="header"> <h3 class="header-name">Hype RP</h3> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.