html - 分隔网页页脚中的超链接
问题描述
我正在制作一个网站,并添加了一个页脚,其中包含指向我的 GitHub 个人资料和网站存储库的链接。我已经让页脚看起来我想要它的方式,除了链接彼此相邻,大麦它们之间有任何空间。我试图在链接之间添加一个只有空格的段落,但它使页脚只有三个单独的行。如何在链接之间添加一些空格并将它们保持在同一行。
这是我的页脚的 CSS 和 HTML:
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: DarkGray;
text-align: center;
line-height: 50px;
}
<div class="footer">
<a href="[github profile url]">GitHub Profile</a>
<a href="[website repo link]">Website Repo</a>
</div>
解决方案
padding
好吧,您可以使用该属性实现链接之间的间距。例如:放置具有相同名称的链接类:
<div class="footer">
<a href="[github profile url]" class="footer__link">GitHub Profile</a>
<a href="[website repo link]" class="footer__link">Website Repo</a>
</div>
然后在 CSS 中:
.footer__link {
padding-right: (your value --> it could be in px,em,rem etc.);
}
推荐阅读
- sql - 实体框架的 SQL 连接超时错误
- swift - 从远程 URL 保存音频文件并在 APlayer 中本地加载它们
- python - 将 Curl 命令转换为 python
- python - OpenCV findcontour矩形创建错误
- facebook-javascript-sdk - 最近的 facebook api 更改后如何发布到用户时间轴?
- keras - 在 PyTorch 中准备序列到序列网络的解码器
- json - Angular 2 及更高版本 | 从json中提取属性
- c - 将 char* 分配给 char
- c - 将值安全分配给C中的位域
- angular - 在离子应用程序中为信标添加一些安全性