簡體   English   中英

我如何設置@media only screen less than 320px for indetificator?

[英]How can i set @media only screen less then 320px for indetificator?

我有這段代碼。 我是初學者:/

https://ibb.co/ccrFFG 我想通過@media only screen and (max-width: 320px) {}添加一些責任,但它不適用於 ID。 你將如何更改代碼? :)

謝謝

從您的代碼中,我不確定您要實現的目標,但我建議您使用下面的代碼作為指導。

  @media screen and (max-width: 320px) {
    #yourID {
        width: 260px !important;
    }
 }

CSS媒體查詢僅在使用視口元標記時才有效,請確保在您的網站上使用它。

<meta name="viewport" content="width=device-width, initial-scale=1.0">

您可以在這里准備更多有關它的信息: https : //developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag

元標記已啟用。 當我使用.class時,效果很好,但是我需要使用#ID。

我不知道為什么這個#mark是綠色的,而點是標准的。

  @media screen and (max-width: 920px) {
#section0 .box{
    color: #6ad1e3; !important;
}

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM