Html 如何使用flexbox使卡具有响应性?
我有一个包含botstrap 4卡div和pararagraph的部分,我想响应 以下是HTML:Html 如何使用flexbox使卡具有响应性?,html,css,flexbox,Html,Css,Flexbox,我有一个包含botstrap 4卡div和pararagraph的部分,我想响应 以下是HTML: <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigi
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<div class="marketing-main-page-content_details">
<div class="marketing-main-page-content_details-card">
<div class="marketing-main-page-content_card card " data-related="details2" id="card2">
<p>Która jest własciawa osoba</p>
</div>
</div>
<div class="marketing-main-page-content_description-right" id="details1">
<div class="title-right">
<p>Która 1 jest własciawa osoba</p>
</div>
<p>To ten kurs jest dla Ciebie, specjalnie dla Ciebie.
Potem dalsza część tekstu, która ma przekonać do
zakupu. Przekonany? No to klikamy poniżej i
lecimy do formularza zamówienia!
</p>
<div class="marketing-main-page-content_description-right_button">
<button type="button" class="marketing-main-page-content_description-right_button-primary">Dowiedz
się wiecej</button>
</div>
</div>
</div>
以下是JSFIDLE:
我希望它能够响应,但现在正如你在JSF中看到的,它没有响应
我需要在代码中修改什么才能使其具有代表性?我建议阅读以了解Flexbox的工作原理。该规则始终适用于要对齐的项目的容器。我在您的卡片容器中添加了一个与正确容器相同的宽度
我还删除了CSS中的固定宽度规则和大量冗余代码。始终确保标记有效。这应该是一个反应灵敏的工作示例:
.marketing-main-page-content\u详细信息{
显示器:flex;
证明内容:周围的空间;
flex-flow:行nowrap;
}
.marketing-main-page-content_details-card{
最小宽度:50%;
}
.营销-主页-内容卡{
字体大小:25px;
字体系列:Roboto;
字体大小:正常;
颜色:#707070;
高度:137px;
字体系列:Roboto;
利润率:20px;
文本对齐:居中;
-网络工具包盒阴影:0 3px 13px#5c;
盒影:0 3px 13px#5c;
}
.所有权{
字体大小:35px;
字体系列:Roboto;
字号:500;
颜色:#707070;
}
.marketing-main-page-content_description-right p{
字体大小:25px;
字体系列:Roboto;
利润上限:28px;
颜色:#707070;
字体大小:正常;
}
科托拉开玩笑说瓦西瓦·奥索巴
克托拉1开玩笑说瓦西瓦·奥索巴
对十个库尔人开玩笑,斯派贾尼开玩笑。Potem dalsza częśćtekstu,która ma przekonaćdo zakupu。普泽科纳尼?不,我不想让你做扎莫维尼亚配方奶粉!
多维兹
斯维耶杰
这可能会有所帮助-使用flexbox不可能吗?
.marketing-main-page-content_details {
display: flex;
justify-content: space-around;
}
.marketing-main-page-content_card {
font-size: 25px;
font-family: Roboto;
font-weight: normal;
color: #707070;
}
.marketing-main-page-content_card {
width: 536px;
height: 137px;
font-family: Roboto;
margin-top: 20px;
font-size: 25px;
text-align: center;
vertical-align: middle;
display: table-cell;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
align-items: center;
-webkit-box-shadow: 0 3px 13px #5C5C5C;
box-shadow: 0 3px 13px #5C5C5C;
}
.marketing-main-page-content_description-right {
width: 47%;
margin-top: 78px;
}
.title-right {
font-size: 35px;
font-family: Roboto;
font-weight: 500;
color: #707070;
}
.marketing-main-page-content_description-right p {
font-size: 25px;
font-family: Roboto;
margin-top: 28px;
color: #707070;
font-weight: normal;
}
.marketing-main-page-content_description-right p {
font-size: 25px;
font-family: Roboto;
margin-top: 28px;
color: #707070;
font-weight: normal;
}
.marketing-main-page-content_description-right {
width: 47%;
margin-top: 78px;
}