如何使用 HTML5 在 header 中添加文本
How to add text in header with HTML5
我正在尝试在不影响 header 大小的情况下移动上方 header 内的列表项,谁能告诉我怎么做?
下面是我 index.html 的代码
<header>
<div id="service-buttons">
<nav>
<ul>
<li><a href="index.html">Unblacklisting</a></li>
<li><a href="about.html">iCloud Removal</a></li>
<li><a href="services.html">Clean IMEI</a></li>
<li><a href="index.html">Buy & Sell</a></li>
<li><a href="about.html">Reported Lost</a></li>
<li><a href="services.html">Sim Cards</a></li>
</ul>
</nav>
</div>
</header>
这是我的代码 styles.css
header #service-buttons {
margin-top:10px;
}
尝试设置填充而不是边距:
header #service-buttons {
padding-top:10px;
}
你可以试试:
header {
position: relative;
...
}
header #service-buttons {
position: absolute;
bottom: 2px; // change according to your need
right: 4px; // change according to your need
}
这段代码将对您有所帮助:
在 id service-buttons
上申请
#service-button { padding:8px; margin-top:20px; }
我正在尝试在不影响 header 大小的情况下移动上方 header 内的列表项,谁能告诉我怎么做?
下面是我 index.html 的代码
<header>
<div id="service-buttons">
<nav>
<ul>
<li><a href="index.html">Unblacklisting</a></li>
<li><a href="about.html">iCloud Removal</a></li>
<li><a href="services.html">Clean IMEI</a></li>
<li><a href="index.html">Buy & Sell</a></li>
<li><a href="about.html">Reported Lost</a></li>
<li><a href="services.html">Sim Cards</a></li>
</ul>
</nav>
</div>
</header>
这是我的代码 styles.css
header #service-buttons {
margin-top:10px;
}
尝试设置填充而不是边距:
header #service-buttons {
padding-top:10px;
}
你可以试试:
header {
position: relative;
...
}
header #service-buttons {
position: absolute;
bottom: 2px; // change according to your need
right: 4px; // change according to your need
}
这段代码将对您有所帮助: 在 id service-buttons
上申请#service-button { padding:8px; margin-top:20px; }