我想编写一个简单的比较表,但是我无法得到我想要的结果。将两个响应式div并排排列
的图像胜过千言万语,所以我勾勒了我想获得:
目前,该网站的页面是由“其他内容的div中的一列(以上代表“区域)。两个div下方的灰色区域只是表示我用来包含它们的div,但我不需要它。
所以,基本上,我只想补充含有两个div看起来像图像中的另一格,但每一个建议是值得欢迎的:)
此外,申报单必须响应,当然, )
编辑1
作为建议,这里是到目前为止的工作代码:我试了很多东西,反正当我周围添加div的一些空间,他们开始搞的一团糟。它的大部分代码是不必要的,我知道:(
* {
color: #fff;
font-family: "Avenir", sans-serif;
font-size: 18px;
border 0;
margin: 0;
padding: 0;
}
.container {
display: flex;
align-content: center;
margin-bottom: 20px;
width: 100%;
background-position: center;
background-size: cover;
}
.content {
width: 100%;
}
.container {
background-color: hsl(200, 100%, 95%);
margin: auto;
padding: 0%;
}
.comparecontainer {
margin: 0%;
float: left;
height: auto;
width: 50%;
}
.compare {
padding: 5%;
height: 100%;
width: 100%;
}
.lite {
background-color: hsl(40, 100%, 50%);
}
.full {
background-color: hsl(150, 80%, 50%);
}
.button {
background-color: rgba(255, 255, 255, 0.2);
color: #fff;
font-family: ;
font-size: 18px;
font-weight: 500;
line-height: 200%;
text-decoration: none;
text-transform: uppercase;
display: inline-block;
padding: 1% 3%;
border: 2px solid #fff;
border-radius: 0;
outline: none;
}
.button:hover,
.button:active {
background-color: #fff;
}
.button:hover .lite {
color: hsl(40, 100%, 50%);
}
.button .full:hover {
color: hsl(150, 80%, 50%);
}
h2 {
font-size: 36px;
margin: auto;
}
h3 {
font-size: 21px;
margin: 2.5% 0;
}
h4 {
font-size: 21px;
margin: 10% 0;
}
ul {
list-style: none;
margin: 5% 0;
}
li {
margin: 2.5% 0;
}
<div class="container">
<div class="content">
<div class="comparecontainer">
<div class="compare lite">
<h2>First DIV</h2>
<h3>Subtitle</h3>
<ul>
<li><b>item</b> one</li>
<li><b>item</b> two</li>
<li><b>item</b> three</li>
<li><b>item</b> four</li>
<li>-</li>
<li>-</li>
<li>-</li>
<li>feature</li>
</ul>
<h4>text</h4>
<a href="#" class="button lite">button</a>
</div>
</div>
<div class="comparecontainer">
<div class="compare full">
<h2>Second DIV</h2>
<h3>Subtitle</h3>
<ul>
<li><b>item</b> one</li>
<li><b>item</b> two</li>
<li><b>item</b> three</li>
<li><b>item</b> four</li>
<li><b>item</b> five</li>
<li><b>item</b> six</li>
<li><b>item</b> seven</li>
<li><b>feature</b></li>
</ul>
<h4>text</h4>
<a href="#" class="button full">button</a>
</div>
</div>
</div>
</div>
您可以发布您的代码,你试过吗? –
你应该发布一些代码来显示你到目前为止尝试过的东西。列的高度是否相同? – MyiEye
@SanjeevK确定:) –