简体   繁体   English

400像素的CSS媒体查询无法正常工作

[英]CSS media-query at 400px isn't working

Can someone tell me how to fix this media query issue.. https://jsfiddle.net/1z8sw4n5/19/ 有人可以告诉我如何解决此媒体查询问题。.https ://jsfiddle.net/1z8sw4n5/19/

  .clear { clear: none; display: none; }  

I want at 400px to hide content column without breaking the yellow right float so blue and yellow touch seamlessly and hide red @400px or less 我希望在400px的情况下隐藏内容列而不破坏黄色的右浮动,以便蓝色和黄色无缝接触并在@ 400px或更小的范围内隐藏红色

One of the problems is that the width of #left and #right are both 200px. 问题之一是#left和#right的宽度均为200px。 When the browser is less than 400px the divs are forced to stack. 当浏览器小于400px时,div被强制堆叠。 If you set the width on both of them to 50% and use float: left then they can sit next to each other. 如果将它们的宽度都设置为50%并使用float: left则它们可以彼此相邻放置。 You will also need to create a media query for #right and move the original #right css to above the media queries. 您还需要为#right创建一个媒体查询,并将原始的#right css移动到媒体查询上方。

Here's a fix... 解决方法

Codepen: https://codepen.io/anon/pen/ZyQVeg?editors=1100 Codepen: https ://codepen.io/anon/pen/ZyQVeg editors = 1100

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM