Love丶FFC's Blog

前端:CSS3中的媒体查询策略@media如何使用?

2019-07-19 12:10:03
阅读:8461   •   评论:131
标签:, ,

CSS3中新增加了一个新技术,名为媒体查询策略,在以前的WEB开发中,想要实现移动端的自适应常常需要对移动端的设备进行适配,但是移动端的设备非常多,对一个主流设备就要重新编写一个适配网页,其适配成本非常的高。

CSS3中的媒体查询策略-@media技术可以很好的实现多端自适应,只需要对CSS进行编写即可对任意的设备进行适配。

①当需要适配的设备宽度小于1200px时,代码写法如下:

  1. @media (max-width:1200px)
  2. {
  3. CSS代码
  4. }

②当需要适配的设备宽度大于400px,小于1300px时,代码写法如下:

  1. @media (min-width:400px and max-width:1300px)
  2. {
  3. CSS代码
  4. }

@media的用法非常简单,但是作用却非常明显,只需要在一个CSS文件中编写多个@media,即可对多个设备进行适配。

评论板

共有 131 条评论

  1. fruinly

    Interstitial lung disease buy cialis daily online Your doctor will discuss these risks with you if surgery is recommended

  2. engarma

    5 ug mL for both assays cialis without prescription I think most effective medicine for high blood pressure you are how to lower the bottom number on my blood pressure still

  3. authentic cheap jordans

    I just wanted to thank you for the fast service. nor they look great. I received them a day earlier than expected. exactly like the I will definitely continue to buy from this site. you ultimately choose I will recommend this site to my friends. Thanks!
    authentic cheap jordans https://www.realjordansretro.com/

  4. authentic cheap jordans

    I just wanted to thank you for the fast service. actually they look great. I received them a day earlier than expected. decline I will definitely continue to buy from this site. blue jays I will recommend this site to my friends. Thanks!
    authentic cheap jordans https://www.realcheapretrojordanshoes.com/

  5. louis vuittons outlet

    Read reviews and was a little hesitant since I had already inputted my order. or perhaps a but thank god, I had no issues. since the received item in a timely matter, they are in new condition. you decide so happy I made the purchase. Will be definitely be purchasing again.
    louis vuittons outlet https://www.louisvuittonsoutletonline.com/

  6. authentic cheap jordans

    Read reviews and was a little hesitant since I had already inputted my order. quite possibly but thank god, I had no issues. just like received item in a timely matter, they are in new condition. either way so happy I made the purchase. Will be definitely be purchasing again.
    authentic cheap jordans https://www.realjordansshoes.com/

  7. Preliaf

    cheap cialis online pharmacy Simple observation of affected seeds without comprehensive anatomical investigation has often led to false conclusions being drawn

  8. Preliaf

    org how to cbd drug interactions the ID 1 gene, which can reduce breast cancer metastasis, it s worth studying potential interactions generic name for cialis Sulfanilamides generally are insoluble in water

  9. instagram etkileşim satın al

    instagram etkileşim satın al instagram etkileşim satın al

    Loved the photos, i really like the among this image, perfecto.

  10. instagram etkileşim satın al

    instagram etkileşim satın al instagram etkileşim satın al

    Superb images, the colour and depth of the images are breath-taking, they attract you in as though you belong of the make-up.

  11. instagram etkileşim satın al

    instagram etkileşim satın al instagram etkileşim satın al

    Hey there, You’ve done an excellent job. I will definitely digg it
    and personally recommend to my friends. I’m confident they’ll be benefited from this site.

  12. Jguwrp

    buy tricor without a prescription tricor over the counter buy tricor 160mg generic

  13. Zzblbz

    tadalafil 20mg pills viagra 100mg uk sildenafil 100mg tablets

  14. Feadls

    ketotifen online order buy ziprasidone medication how to buy imipramine

  15. Kqulib

    purchase minoxidil without prescription buy generic mintop generic ed drugs

  16. Anajwv

    precose 50mg price buy generic griseofulvin 250mg griseofulvin without prescription

--------查看该分类下最新文章--------
^
新版博客正在完善中!域名:http://www.loveffc:8080,点击跳转,完全移植后将去除端口号。

Copyright © 2018 - 2021 FFC的小站 - 滇 ICP 备 18010780 号 - 1

- Powered by WordPress & AliYun · Theme by FFC -

- Environment by Windows & XAMPP · Designed by WebStorm & VSCode -

已运行:

访问量:510596