gpt4 book ai didi

html - 复杂 div 结构中的 float div

转载 作者:太空宇宙 更新时间:2023-11-04 08:42:52 27 4
gpt4 key购买 nike

我真的很接近让它看起来像我想要的样子:)

我该怎么做:

  1. 使 .tk17-speakings-ausgabe-daten-col1 和 .tk17-speakings-ausgabe-daten-col2 在同一水平面上开始;
  2. 停止 .tk17-speakings-ausgabe-daten-col2 环绕 .tk17-speakings-ausgabe-datum?

在此先感谢您的帮助!

#tk17-speakings-termine-ausgabe ul{
max-width:500px;
}
#tk17-speakings-termine-ausgabe li{
display:inline-block;
list-style-type:none;
width:50%;
padding-left:25%;
padding-right:25%;
}
.tk17-speakings-ausgabe-datum{
width:200px;
height:200px;
text-align:center;
border:2px solid #c4d600;
float:left;
margin-right:40px;
}
.tk17-speakings-ausgabe-datum h3{
font:300 60px / 60px Lato;
margin-bottom:0;
margin-top:50px;
}
.tk17-speakings-ausgabe-datum h4{
font:300 20px / 22px Lato;
margin-top:0;
}
.tk17-speakings-ausgabe-title{
margin-top:-20px;
}
.tk17-speakings-ausgabe-daten-container{
margin-top:30px;
}
.tk17-speakings-ausgabe-daten-col1{
float:left;
width:20%;
}
.tk17-speakings-ausgabe-daten-col2{
width:75%;
margin-left:5%;
}
<ul>
<li>
<div class="tk17-speakings-ausgabe-datum">
<h3>11</h3>
<h4>Juni<br>2017</h4>
</div>
<div class="tk17-speakings-ausgabe-title">
<p><span class="tk17-spitzmarke">THEMA</span><br><span class="tk17-headlinetext-300-3033">Lorem ipsum dolor sit amet</span></p>
</div>
<div class="tk17-speakings-ausgabe-daten-container">
<div class="tk17-speakings-ausgabe-daten-col1">
<p><span class="tk17-spitzmarke">VERANSTALTUNG</span><br><span class="tk17-fliess-400-1522">Veranstaltung GHI...</span></p>
<p><span class="tk17-spitzmarke">ORT</span><br><span class="tk17-fliess-400-1522">Frankfurt, Xxxxxxxxxx<br><br><em>[offen]</em></span></p>
</div>
<div class="tk17-speakings-ausgabe-daten-col2 tk17-fliess-400-1522">
<p><span class="tk17-spitzmarke">DETAILS</span><br></p><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</div>
</div>
</li>
</ul>

最佳答案

由于 p 元素中的边距,行中的内容未水平对齐。为了防止 .tk17-speakings-ausgabe-daten-col2 回绕,请使用 overflow: hidden

#tk17-speakings-termine-ausgabe li {
display: inline-block;
list-style-type: none;
width: 50%;
padding-left: 25%;
padding-right: 25%;
}

.tk17-speakings-ausgabe-datum {
width: 200px;
height: 200px;
text-align: center;
border: 2px solid #c4d600;
float: left;
margin-right: 40px;
}

.tk17-speakings-ausgabe-datum h3 {
font: 300 60px / 60px Lato;
margin-bottom: 0;
margin-top: 50px;
}

.tk17-speakings-ausgabe-datum h4 {
font: 300 20px / 22px Lato;
margin-top: 0;
}

.tk17-speakings-ausgabe-title {
margin-top: -20px;
}

.tk17-speakings-ausgabe-daten-container {
margin-top: 30px;
}

.tk17-speakings-ausgabe-daten-col1 {
float: left;
width: 20%;
}

.tk17-speakings-ausgabe-daten-col2 {
margin-left: 5%;
overflow: hidden;
}

p {
margin-top: 0;
}
<ul>
<li>
<div class="tk17-speakings-ausgabe-datum">
<h3>11</h3>
<h4>Juni<br>2017</h4>
</div>
<div class="tk17-speakings-ausgabe-title">
<p><span class="tk17-spitzmarke">THEMA</span><br><span class="tk17-headlinetext-300-3033">Lorem ipsum dolor sit amet</span></p>
</div>
<div class="tk17-speakings-ausgabe-daten-container">
<div class="tk17-speakings-ausgabe-daten-col1">
<p><span class="tk17-spitzmarke">VERANSTALTUNG</span><br><span class="tk17-fliess-400-1522">Veranstaltung GHI...</span></p>
<p><span class="tk17-spitzmarke">ORT</span><br><span class="tk17-fliess-400-1522">Frankfurt, Xxxxxxxxxx<br><br><em>[offen]</em></span></p>
</div>
<div class="tk17-speakings-ausgabe-daten-col2 tk17-fliess-400-1522">
<p><span class="tk17-spitzmarke">DETAILS</span><br></p><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</div>
</div>
</li>
</ul>

关于html - 复杂 div 结构中的 float div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43989271/

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