亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么我的媒體查詢不適用于此特定元素?

為什么我的媒體查詢不適用于此特定元素?

慕斯709654 2023-12-25 16:13:44
我的媒體查詢并未應用于此,div .col-3盡管它確實適用于其他媒體查詢。這是選擇器/類的問題嗎?@media screen and (min-width: 600px) and (max-width: 719px) {   .col-3 {          flex: 0 50%;          max-width: 50%;  }  }<div class="row fade show">    <div class="col-3">        <div class="ProductBox_root__13DPQ">            <div class="ProductBox_photo__Xs8BM"><img                    src="https://images.pexels.com/photos/245208/pexels-photo-245208.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=3&amp;h=750&amp;w=1260"                    alt="Aenean Ru Bristique 1" class="ProductBox_image__1ECK5">                <div class="ProductBox_sale__1WcD7">sale</div>                <div class="ProductBox_buttons__uyJNx"><a href="#" class="Button_small__2W39u">Quick View</a><a href="#"                        class="Button_small__2W39u"><svg aria-hidden="true" focusable="false" data-prefix="fas"                            data-icon="shopping-basket" class="svg-inline--fa fa-shopping-basket fa-w-18 " role="img"                            xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">                            <path fill="currentColor"                            </path>                        </svg> ADD TO CART</a></div>            </div>讓我確認一下我添加了<meta name="viewport" content="width=device-width, initial-scale=1.0" />所以一定是別的東西。
查看完整描述

4 回答

?
慕標5832272

TA貢獻1966條經驗 獲得超4個贊

希望這個媒體查詢放在你的 CSS 文件的底部。如果不是,則屬性將被覆蓋。請檢查并檢查 css 選項卡中元素的屬性是否被覆蓋



查看完整回答
反對 回復 2023-12-25
?
犯罪嫌疑人X

TA貢獻2080條經驗 獲得超4個贊

我決定通過向 React 組件添加響應類來應用 RWD,如下所示:


className='col-12 col-sm-6 col-lg-3'>



這對我有用,我希望有人會發現這很有用。感謝您的所有回答!


查看完整回答
反對 回復 2023-12-25
?
哆啦的時光機

TA貢獻1779條經驗 獲得超6個贊

圖像溢出容器?

img{ width: 100% }



查看完整回答
反對 回復 2023-12-25
?
浮云間

TA貢獻1829條經驗 獲得超4個贊

您還可以通過 Id 定位 div


<div id="custom" class="col-3">



  #custom.col-3 {

      flex: 0 50%;

      max-width: 50%;

      border: 2px solid red

   }

https://jsfiddle.net/brnt49je/


查看完整回答
反對 回復 2023-12-25
  • 4 回答
  • 0 關注
  • 204 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號