gpt4 book ai didi

html - 放置 hr 标签以使其看起来更自然

转载 作者:可可西里 更新时间:2023-11-01 15:02:35 25 4
gpt4 key购买 nike

我添加的这个换行符不在我想要的位置。我想将它放在标题和下面的图像之间。

我试过 margin-bottom: 20px;但它把图像推到了我不想要的页面上。我只想保持尺寸并将其居中。

您最有可能寻找的 CSS 位于 css 页面的底部。

/* PROCESS **********/

#process {
text-align: center;
margin-bottom: 25px;
}

#process-span {
position: absolute;
bottom: 0;
right: 0;
}

#process img {
display: inline;
height: 100%;
width: 100%;
-webkit-border-radius: 10%;
-moz-border-radius: 10%;
box-shadow: 1px 3px 1px 1px;
}

#process p {
z-index: 100;
position: absolute;
font-weight: bold;
top: 235px;
color: white;
font-size: small;
padding: 10px;
margin-right: 15px;
}

#process h4 {
margin-top: 25px;
}

#process .btn-go {
margin-bottom: 500px;
background-color: #4AA0D5;
color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
text-decoration: none;
padding: 10px 10px;
border-radius: 10px;
border: 2px white solid;
}

#process .btn-go:hover,
#process .btn-go:focus {
color: #4AA0D5;
border: 2px #4AA0D5 solid !important;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-border-radius: 0%;
-moz-border-radius: 0%;
background-color: #fff;
}

#process .bottom-line {
width: 50px;
}
<section id="process">
<div class="container">
<h2>How the Process Works</h2>
<div class="lead2">
<hr class="bottom-line">
</div>
<!-- lead2 -->
<div class="row">
<div class="col-sm-4">
<img src="img/image2.png" alt="Design">
<span><p>Reach out to me and describe the type of project you want &amp; audience its for.</p></span>
</div>
<!-- col -->
<div class="col-sm-4">
<img src="img/image1.png" alt="Relax">
<p>Sit back and relax! Watch your project grow with routine progress reports &amp; quick-to-respond communication.</p>
</div>
<!-- col -->
<div class="col-sm-4">
<img src="img/image3.png" alt="Finish">
<p>The project will be turned into you at the agreed time and considered completed only when you are
<bold>100%</bold> satisfied.</p>
</div>
<!-- col -->

</div>
<!-- row -->

</div>
<!-- container -->
<h4><a href="#contact" class="btn-go">Let's Do It!</a></h4>
</section>
<!-- project-features -->

最佳答案

您可以将 margin: 1rem auto 1.5rem; 添加到 hr 中,如下面的代码片段所示。不同的顶部/底部距离来自这样一个事实,即其上方的 header 具有比其后的元素具有更多的默认填充底部。

/* PROCESS **********/

.lead2 hr {
margin: 1rem auto 1.5rem;
}

#process {
text-align: center;
margin-bottom: 25px;
}

#process-span {
position: absolute;
bottom: 0;
right: 0;
}

#process img {
display: inline;
height: 100%;
width: 100%;
-webkit-border-radius: 10%;
-moz-border-radius: 10%;
box-shadow: 1px 3px 1px 1px;
}

#process p {
z-index: 100;
position: absolute;
font-weight: bold;
top: 235px;
color: white;
font-size: small;
padding: 10px;
margin-right: 15px;
}

#process h4 {
margin-top: 25px;
}

#process .btn-go {
margin-bottom: 500px;
background-color: #4AA0D5;
color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
text-decoration: none;
padding: 10px 10px;
border-radius: 10px;
border: 2px white solid;
}

#process .btn-go:hover,
#process .btn-go:focus {
color: #4AA0D5;
border: 2px #4AA0D5 solid !important;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-border-radius: 0%;
-moz-border-radius: 0%;
background-color: #fff;
}

#process .bottom-line {
width: 50px;
}
<!DOCTYPE html>

<html lang="en">

<head>

<body>
<section id="process">
<div class="container">
<h2>How the Process Works</h2>
<div class="lead2">
<hr class="bottom-line">
</div>
<!-- lead2 -->
<div class="row">
<div class="col-sm-4">
<img src="img/image2.png" alt="Design">
<span><p>Reach out to me and describe the type of project you want &amp; audience its for.</p></span>
</div>
<!-- col -->
<div class="col-sm-4">
<img src="img/image1.png" alt="Relax">
<p>Sit back and relax! Watch your project grow with routine progress reports &amp; quick-to-respond communication.</p>
</div>
<!-- col -->
<div class="col-sm-4">
<img src="img/image3.png" alt="Finish">
<p>The project will be turned into you at the agreed time and considered completed only when you are
<bold>100%</bold> satisfied.</p>
</div>
<!-- col -->

</div>
<!-- row -->

</div>
<!-- container -->
<h4><a href="#contact" class="btn-go">Let's Do It!</a></h4>
</section>
<!-- project-features -->
</body>
</head>

</html>

关于html - 放置 hr 标签以使其看起来更自然,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43748354/

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