【发布时间】:2015-03-22 07:40:11
【问题描述】:
我想为移动设备进行设计(纵向和横向视图)。 当视图为纵向时,我想将宽度设为 100%,当视图为横向时设为 50%。
我知道使用媒体查询非常容易。但我无法为所有设备解决此问题。分辨率这么多,横向和纵向视图有什么特定的css吗?
.main_cont {overflow:hidden; position:fixed}
.box1 {
background:pink}
.box2 {
background:lightblue}
@media screen and (max-width:640px) {
.box1, .box2 {
float:left; width:50%; }
}
<div class="main_cont">
<div class="box1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div class="box2">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>
【问题讨论】:
-
有什么问题吗?现在什么不工作?
-
它工作正常,但我想做到,在所有移动纵向视图 div 应该是 100% 和横向视图 div 50%
标签: css responsive-design