将忽略媒体查询中的flex属性,因为目标元素不是flex容器。
.FeaturesDetailed-keyFeatureTile-237 {
margin: 0 auto;
margin-bottom: -66px;
}
@media (max-width: 768px) {
.FeaturesDetailed-keyFeatureTile-237 {
flex-direction: column;
flex-flow: wrap;
width: 400px;
margin: 0 auto;
margin-top: 2.5rem;
}
在哪里
display: flex
尝试以下内容(为了演示的目的,我删除了很多不相关的代码):
.FeaturesDetailed-keyFeaturesWrapper-236 {
display: flex;
margin-bottom: 100px;
flex-direction: column;
flex-wrap: wrap;
}
.FeaturesDetailed-keyFeatureTile-237 {
display: flex; /* new */
margin: 0 auto;
/* margin-bottom: -66px; */
}
.FeaturesDetailed-keyFeatureIconWrap-243 {
/* left: 35px; */
color: orange;
flex: 0 0 200px; /* new */
border: 1px dashed black; /* demo */
/* position: relative; */
}
.FeaturesDetailed-keyFeatureHeader-242 {
/* width: 200px; */
color: #000;
/* margin: -9px 0px 20px -165px; */
text-align: right;
}
.FeaturesDetailed-keyFeatureCopyWrap-238 {
/* top: -145px;
left: 120px;
width: 600px; */
flex: 0 0 600px; /* new */
/* position: relative; */
border: 1px dashed red; /* demo */
}
[class^="icon-"] {
font-family: "icons" !important;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
speak: none;
}
.FeaturesDetailed-keyFeatureCopyWrap-238 {
top: -145px;
left: 120px;
width: 600px;
/* position: relative; */
}
@media (max-width: 768px) {
.FeaturesDetailed-keyFeatureTile-237 {
flex-wrap: wrap;
justify-content: center;
width: 400px;
margin: 0 auto;
margin-top: 2.5rem;
}
}
<div class="FeaturesDetailed-keyFeaturesWrapper-236">
<div class="FeaturesDetailed-keyFeatureTile-237">
<div class="FeaturesDetailed-keyFeatureIconWrap-243">
<p class="FeaturesDetailed-keyFeatureHeader-242">Header content here</p><span class="wrap-icon Icon-root-115 FeaturesDetailed-Icon-239"><style>.icon-clone:before { content: "\e90d"}</style><span aria-hidden="true" class="icon-clone" style="font-size: 52px; line-height: 52px;"></span></span>
</div>
<div class="FeaturesDetailed-keyFeatureCopyWrap-238">
<p class="FeaturesDetailed-heading-240">Lots of content here.</p>
<p class="FeaturesDetailed-subtext-241">Subsection of content here</p>
</div>
</div>
</div>
相关:
Grid properties not working on elements inside grid container