css html 页脚问题是否可以解决?

Is the css html footer question possible to resolve?

我在将页脚文本垂直(高度)居中时遇到了一些主要问题,我确实希望页脚更靠近段落文本。这可能吗?enter image description here

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="stylefooter.css">
</head>
<body>

<div id="container">
<div id="main">
<p>ffsdergserkghretkguhsritg</p></br>
</div>
</div>

<footer id="footer">
<p>Ohhhh yeah!</p>
</footer>

</body>
</html>

您可以在css中使用属性 "line-height"并将页脚的高度作为值

footer 
{
    height : 40px;
}

footer > p 
{
    line-height: 40px;
}

更多信息: https://developer.mozilla.org/en-US/docs/Web/CSS/line-height