CSS3媒体查询 - 容器的宽度,而不是屏幕? [英] CSS3 Media Query - Width of container rather than screen?

查看:150
本文介绍了CSS3媒体查询 - 容器的宽度,而不是屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还没有看到这个问题在这里,但我想知道是否有人知道是否可能有一个媒体查询基于容器或父元素,它是基于它的宽度。这种情况下的用户案例是,当您有一个菜单从左侧弹出,并减小主窗口容器的大小。这是一个示例网站,您可以看到菜单弹出,但页面上的内容不能根据其新宽度更改

I have not yet seen this question asked on here but I was wondering if anyone knows if it is possible to have a media query based on a container or parent element that was based on it width. The user case for this is when you have a menu that pops in from the left and decreases the size of the main windows container. Here is an example website where you can see the menu pops open but the content on the page cannot change based on its new width

http://tympanus.net/Tutorials/FullscreenBookBlock/

推荐答案

我一直在研究这个。到目前为止,我对Andy Hume的方法印象深刻, http://blog.andyhume.net/responsive-containers/ https://github.com/ahume/selector-queries/

I've been looking into this too. So far I've been impressed with Andy Hume's approach http://blog.andyhume.net/responsive-containers/ https://github.com/ahume/selector-queries/

这篇关于CSS3媒体查询 - 容器的宽度,而不是屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆