gpt4 book ai didi

html - 容器中列内的文本未完全占据该列

转载 作者:行者123 更新时间:2023-11-28 14:12:56 24 4
gpt4 key购买 nike

我有一个容器类、行类和列类。我有一排,里面有两列。两者都设置为 50% 宽度。但是,左侧栏的文本并未完全占据该栏。这是我的代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<style>

* {
box-sizing: border-box;
padding-left: 50px;
padding-right: 50px;
}

.container {
position: relative;
border-radius: 10px;
box-shadow: 5px 5px 3px grey;
background-color: #FFFFFF;
padding: 0px 0 0px 0;
height:100%;
}

.navbar {
background-color: #000000;
width: 100%;
height: 70px;
padding: 4px 10px 0px 0px;
border-radius:10px 10px 0px 0px;
}

.navbar a {
color:white;
font-family: Lato, sans-serif;
text-align: center;
padding: 10px 10px;
text-decoration: none;
float:right;
margin-left:-35px;
font-size: 14px;
font-weight:bold;
}
.fas {
font-size:26px;
}
.row:after {
content: "";
display: table;
clear: both;
}

.col {
float: left;
width: 50%;
height:100%;
margin: auto;
margin-top:70px;
margin-bottom:6px;
padding-left:5px;
}

.txt {
font-family:Montserrat, sans-serif;
font-weight:bold;
text-align: left;
font-size:20px;
}
</style>
</head>
<body>
<div class="container">

<div class="navbar">
<a href="#"><i class="fas fa-user-plus"></i><br>Sign Up</a>
<a href="#"><i class="fas fa-sign-in-alt"></i><br>Login</a>
</div>

<div class="row">
<div class="col">
<div class="txt">
<p style="align:justify"><br><br>
Education is the process of facilitating learning<br>
Acquisition of knowledge<br>
Make Informed decision about your future<br>
Let's discover opportunities
</p>
</div>
</div>
<div class="col">
<img class="img-responsive" src="book.png" width="500" height="400">
</div>
</div>
</div>
</body>
</html>

这是 html 页面的样子。

左侧列只有一部分列有文本。我需要在两侧扩展文本并填充左列。

最佳答案

    * {
box-sizing: border-box;
padding-left: 50px;
padding-right: 50px;
}

.container {
position: relative;
border-radius: 10px;
box-shadow: 5px 5px 3px grey;
background-color: #FFFFFF;
padding: 0px 0 0px 0;
height:100%;
}

.navbar {
background-color: #000000;
width: 100%;
height: 70px;
padding: 4px 10px 0px 0px;
border-radius:10px 10px 0px 0px;
}

.navbar a {
color:white;
font-family: Lato, sans-serif;
text-align: center;
padding: 10px 10px;
text-decoration: none;
float:right;
margin-left:-35px;
font-size: 14px;
font-weight:bold;
}
.fas {
font-size:26px;
}
.row:after {
content: "";
display: table;
clear: both;
}

.col {
float: left;
width: 50%;
height:100%;
margin: auto;
margin-top:70px;
margin-bottom:6px;
padding-left:5px;
padding:0;
}

.txt {
font-family:Montserrat, sans-serif;
font-weight:bold;
text-align: left;
font-size:20px; padding:0;
}
.txt p{
padding:0;
}
  <div class="container">

<div class="navbar">
<a href="#"><i class="fas fa-user-plus"></i><br>Sign Up</a>
<a href="#"><i class="fas fa-sign-in-alt"></i><br>Login</a>
</div>

<div class="row">
<div class="col">
<div class="txt">
<p style="align:justify"><br><br>
Education is the process of facilitating learning<br>
Acquisition of knowledge<br>
Make Informed decision about your future<br>
Let's discover opportunities
</p>
</div>
</div>
<div class="col">
<img class="img-responsive" src="book.png" width="500" height="400">
</div>
</div>
</div>

这是你要找的吗?

关于html - 容器中列内的文本未完全占据该列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56272004/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com