【发布时间】:2020-05-25 07:42:26
【问题描述】:
我试图将名称置于我网站上徽标名称和 ID 的头部、顶部和底部的中心。 我曾尝试使用 margin top,它有点工作,但它并不是我想要的。
此外,我正在尝试将徽标名称设为 href 以链接到主页/首页。
代码sn-p:
body {
background: #ebe7e7;
}
@font-face {
font-family: liant;
src: url(liant_regular-webfont.woff);
}
#lineup {
background-color: rgb(73, 35, 35);
width: 100%;
height: 5px;
position:fixed;
left: 0px; right: 0px; top: 0px;
}
#head {
background-color: #cccccc;
color: rgb(141, 68, 40);
width: 100%;
height: 60px;
position: fixed;
left: 0px; right: 0px; top: 5px;
}
#logotxt {
text-align: center;
font-family: liant;
font-size: 40px;
font-weight: 800;
}
#linedown {
background-color: rgb(73, 35, 35);
width: 100%;
height: 5px;
position:fixed;
left: 0px; right: 0px; top: 65px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Viveka Yoga</title>
<link rel="stylesheet" href="yoga.css">
</head>
<body>
<div id ="lineup"></div>
<div id="head">
<p id="logotxt">Viveka Yoga</p>
</div>
<div id="linedown"></div>
<script src="yoga.js"></script>
</body>
</html>
【问题讨论】:
-
将以下css添加到
<p>标签:margin: 0; height: 100%; line-height: 60px;