gpt4 book ai didi

html - 如何设置与父 div 无关的子 div 样式

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

我想在我的帖子中插入表格 HTML。

<div class="page-section">
<div class="container">
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
{!! $post->body !!}
</div>
<div class="col-md-1"></div>
</div>
</div>
</div>

.page-section 的 CSS:

.page-section {
display: block;
position: relative;
overflow: hidden;
}

表格代码:

li {
list-style: none;
}
/* ------------ pricing table -------------- */

#pricing-table-section .pricing-table {
border: none;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
-webkit-transition: all 400ms linear;
transition: all 400ms linear;
padding: 32px 21px;
border-radius: 8px;
background: #f5f5f5;
}

#pricing-table-section .pricing-table h4 {
color: #74a534;
font-family: "Roboto", sans-serif;
margin-bottom: 25px;
}

#pricing-table-section .pricing-table .price {
padding: 22px 0;
border-top: 1px solid #e1f1ff;
/* border-bottom: 1px solid #d9d9d9; */
}

#pricing-table-section .pricing-table .price h2 {
margin-left: 20px;
position: relative;
font-family: 'Open Sans', sans-serif;
color: #000000;
}

#pricing-table-section .pricing-table .price h2 span {
font-family: "Roboto", sans-serif;
}

#pricing-table-section .pricing-table .price h2 .dollar {
font-size: 18px;
display: inline-block;
position: absolute;
/* left: -20px; */
top: 10px;
}

#pricing-table-section .pricing-table .price h2 .month {
font-size: 10px;
display: inline-block;
position: absolute;
left: 9px;
bottom: -4px;
color: #929292;
}

@media screen and (max-width: 992px) {
#pricing-table-section .pricing-table .price h2 {
margin-left: 10px;
}
}

#pricing-table-section .pricing-table .price p {
color: #929292;
}

#pricing-table-section .pricing-table ul.packages {
padding: 20px 0;
}

#pricing-table-section .pricing-table ul.packages li {
font-size: 16px;
font-weight: 400;
font-family: "Open Sans", sans-serif;
line-height: 40px;
}

#pricing-table-section .pricing-table ul.packages li i {
display: inline-block;
width: 24px;
color: #62be10;
}

#pricing-table-section .pricing-table .button {
background: #07aaa5;
color: #ffffff;
border-color: transparent;
}


/* #pricing-table-section .pricing-table .button:before {
background: #74a534;
} */

#pricing-table-section .pricing-table.black {
background: #07aaa5;
color: #ffffff;
border-color: transparent;
}

#pricing-table-section .pricing-table.black ul.packages li i,
#pricing-table-section .pricing-table.kinhdoanh ul.packages li i,
#pricing-table-section .pricing-table.coban ul.packages li i {
color: #ffffff;
}

#pricing-table-section .pricing-table.black h4,
#pricing-table-section .pricing-table.black h2,
#pricing-table-section .pricing-table.black p,
#pricing-table-section .pricing-table.black h2>.month {
color: #ffffff;
}

#pricing-table-section .pricing-table.black .button {
background: #ffffff;
color: #202125;
}

#pricing-table-section .pricing-table.black .button:before {
background: #74a534;
}

#pricing-table-section .pricing-table.black .button:hover,
#pricing-table-section .pricing-table.black .button:focus,
#pricing-table-section .pricing-table.black .button:active {
color: #ffffff;
}

@media screen and (max-width: 767px) {
#pricing-table-section .pricing-table.black {
margin: 50px 0;
}
}

#pricing-table-section .pricing-table.black:hover .button:before,
#pricing-table-section .pricing-table.coban:hover .button:before,
#pricing-table-section .pricing-table.kinhdoanh:hover .button:before {
background: #202125;
}

#pricing-table-section .pricing-table:hover .button:hover {
color: #ffffff;
}


/* ------------ pricing table end -------------- */
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div id="pricing-table-section" class="mid-level-padding">
<div class="container">
<div class="row">
<div class="col-xs-12 text-center ">
<div class="section-top-heading">
<h2 class="head-content">Bảng giá</h2>
<p>Tùy theo nhu cầu của bạn và chọn gói tốt nhất cho mình.</p>
</div>
</div>

</div>
<div class="row">
<div style="margin-bottom:10px;" class="col-lg-4 col-md-4 col-sm-6 col-xs-12 wow fadeInLeft animated" style="visibility: visible;">
<div class="pricing-table coban">
<div class="type">
<h4>Gói cơ bản</h4>
</div>
<div class="price">
<div class="row">
<div class="col-xs-12">
<h2>2.200.000 <span class="dollar">VNĐ</span></h2>
<span style="margin-left: 20px;">Thiết kế web theo mẫu sẵn có</span>
</div>
</div>
</div>
<div class="underline1 normal no-margin"></div>
<div class="underline2 normal no-margin"></div>
<ul class="packages">
<li><i class="fa fa-check" aria-hidden="true"></i>Chọn mẫu giao diện</li>
<li><i class="fa fa-check" aria-hidden="true"></i><strong>Miễn phí</strong> 1 hosting + tên miền</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Hỗ trợ 24/7</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Bảo hành vĩnh viễn</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Chức năng đặt hàng, thanh toán</li>
</ul>
<button class="btn button btn-block"><a href="/goi-co-ban"> Xem Mẫu Web </a></button>
</div>
</div>
<div style="margin-bottom:10px;" class="col-lg-4 col-md-4 col-sm-6 col-xs-12 wow fadeInUp animated" data-wow-duration="3s" style="visibility: visible; animation-duration: 3s;">
<div class="pricing-table black">
<div class="type">
<h4>Gói theo yêu cầu</h4>
</div>
<div class="price">
<div class="row">
<div class="col-xs-12">
<h2>3.500.000+ <span class="dollar">VNĐ</span></h2>
<span style="margin-left: 20px;">Web giới thiệu công ty, sản phẩm.</span>
</div>
</div>
</div>
<div class="underline1 normal no-margin"></div>
<div class="underline2 normal no-margin"></div>
<ul class="packages">
<li><i class="fa fa-check" aria-hidden="true"></i><strong>Thiết kế web theo yêu cầu</strong></li>
<li><i class="fa fa-check" aria-hidden="true"></i><strong>Miễn phí</strong> 1 hosting + tên miền</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Hỗ trợ 24/7</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Bảo hành vĩnh viễn</li>
<li><i class="fa fa-times" aria-hidden="true"></i>Không hỗ trợ đặt hàng, thanh toán</li>
</ul>
<button onclick="location.href='http://127.0.0.1:8000/#contact-us'" class="btn button btn-block">Đăng ký</button>
</div>
</div>
<div style="margin-bottom:10px;" class="col-lg-4 col-md-4 col-sm-6 col-xs-12 col-md-offset-0 col-lg-offset-0 col-xs-offset-0 col-sm-offset-3 wow fadeInRight animated" style="visibility: visible;">
<div class="pricing-table kinhdoanh">
<div class="type">
<h4>Gói kinh doanh</h4>
</div>
<div class="price">
<div class="row">
<div class="col-xs-12">
<h2>4.200.000+ <span class="dollar">VNĐ</span></h2>
<span style="margin-left: 20px;">Website bán hàng.</span>
</div>
</div>
</div>
<div class="underline1 normal no-margin"></div>
<div class="underline2 normal no-margin"></div>
<ul class="packages">
<li><i class="fa fa-check" aria-hidden="true"></i><strong>Thiết kế web theo yêu cầu</strong></li>
<li><i class="fa fa-check" aria-hidden="true"></i><strong>Miễn phí</strong> 1 hosting + tên miền</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Hỗ trợ 24/7</li>
<li><i class="fa fa-check" aria-hidden="true"></i>Bảo hành vĩnh viễn</li>
<li><i class="fa fa-check" aria-hidden="true"></i><strong>Chức năng đặt hàng, thanh toán</strong></li>
</ul>
<button class="btn button btn-block">Đăng ký</button>
</div>
</div>
</div>

</div>
</div>
<!--pricing table end -->

$post->body 包含此表格 HTML。

我希望表格 HTML 应该位于页面的中心。

但它在 .page-section .container 中有位置。

我可以在表格 HTML 中添加类和样式。有什么方法可以改变这个表的位置而不依赖于父 div?

当前我的表格 HTML 看起来像:

解释:

在文本上,您可以看到尺寸是相等的。

我希望 HTML 表格的尺寸也应该相等。

但是 div 中的 HTML 表格包含文本。

最佳答案

删除表 #pricing-table-section 中的 div.container。它将被修复。

关于html - 如何设置与父 div 无关的子 div 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46317127/

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