我刚开始学习 HTML/CSS,在做一个小顶点项目时,提出了一个可能看起来很愚蠢的问题,但无论如何,我要问它:)
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<title>Capstone Project</title>
<link rel="stylesheet" href="CAPSTONE_PROJECT.css">
<link href="https://fonts.googleapis.com/css?family=Baloo+Thambi+2&display=swap" rel="stylesheet">
</head>
<body>
<h2>Welcome to the Landing Page!</h2>
<h3>We`re startup that is cool!</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<form class="signup" action="welcome.html" method="get">
<h2>Sign up for our lunch!</h2>
<label for="fname">First Name:</label><br>
<input id="fname" type="text" name="fname" value=""><br>
<label for="lname">Last Name:</label><br>
<input id="lname" type="text" name="lname" value=""><br>
<label for="email">Email:</label><br>
<input id="email" type="text" name="email" value=""><br>
<input id="submit" type="submit" name="submit" value="Sign Me Up!">
</form>
</body>
</html>
所以,这是我的代码。问题是,当我没有在 CSS 文件中放置 p{} 的填充参数时,我的正文边框不会完全填充页面(在底部留出间隙),如图 1 所示。
但是,当添加填充参数时,页面完全位于浏览器页面中,如第 2 页所示。
所以我的问题是给段落添加填充如何影响整个正文?
收到一只叮咚
相关分类