gpt4 book ai didi

html - 使标题成为内容的大小

转载 作者:行者123 更新时间:2023-11-28 16:23:52 25 4
gpt4 key购买 nike

可能是不可能的和愚蠢的问题,但由于我仍处于学习的第一周,这个 CodePen 中可能有这个问题的答案:

https://codepen.io/indiehjaerta/pen/bYPqwX

    .pricingalternative
{
background-color: #FFFFFF;
border: .1em solid #000000;
margin-top: .5em;
margin-bottom: .5em;
}

.pricingalternative ~ .pricingalternative
{
margin-left: 1em;
}

.pricingtable
{
border: .1em solid #000000;
border-collapse: collapse;
overflow: hidden;
}

.pricingtable td
{
border: .1em solid #000000;
padding: .5em 1em;
}

.flex
{
display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: strech;
}
.section-header
{
background-color: #FFFFFF;
display: flex;
justify-content: center;
margin-bottom: 1em;
padding: .5em;
border: 1em solid #000000;
}
 <main class="main-padding main-pricing">
<section class="section-header shadow">
<h2>LIPSUM</h2>
</section>

<div class="pricing flex">
<div class="pricingmargin pricingalternative shadow">
<table class="pricingtable">
<thead>
<tr>
<th>Ipsum</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>

<div class="pricingalternative shadow">
<table class="pricingtable">
<thead>
<tr>
<th>Ipsum</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>


<div class="pricingalternative shadow">
<table class="pricingtable">
<thead>
<tr>
<th>Ipsum</th>
</tr>
</thead>
<tbody>
<tr>
<td> Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
</tbody>
</table>
</div>
</div>

我想知道是否有某种方法可以使定价标题的大小与即将到来的 div 的大小相同,在扩展中我需要制作它以便在有

编辑:我已经接受了一个答案,但如果有一种方法我什至怀疑是否可以解决这个问题:http://prntscr.com/hkkbm1当有 2 使标题为列宽时。我也很乐意接受。

最佳答案

试试这个:

CSS:

.pricingalternative
{
background-color: #FFFFFF;
border: .1em solid #000000;
margin-top: .5em;
margin-bottom: .5em;
}

.pricingalternative ~ .pricingalternative
{
margin-left: 1em;
}

.pricingtable
{
border: .1em solid #000000;
border-collapse: collapse;
overflow: hidden;
}

.pricingtable td
{
border: .1em solid #000000;
padding: .5em 1em;
}

.flex_parent,
.flex_child
{
display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: strech;
}
.section-header
{
background-color: #FFFFFF;
display: flex;
justify-content: center;
margin-bottom: 1em;
padding: .5em;
border: 1em solid #000000;
}

HTML:

<div class="flex_parent">

<main class="main-padding main-pricing">
<section class="section-header shadow">
<h2>LIPSUM</h2>
</section>

<div class="flex_child">
<div class="pricingmargin pricingalternative shadow">
<table class="pricingtable">
<thead>
<tr>
<th>Standard</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>

<div class="pricingalternative shadow">
<table class="pricingtable">
<thead>
<tr>
<th>Premium</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>


<div class="pricingalternative shadow">
<table class="pricingtable">
<thead>
<tr>
<th>Exclusive</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
<tr>
<td>Lorem Ipsum is simply dummy text</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

关于html - 使标题成为内容的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47702272/

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