您可以使用媒体查询来指定特定屏幕尺寸的CSS(以及其他类似的东西),这样如果屏幕太小,您可以使用一个样式表.我不是专家,所以没有例子,但请看一下http://css-tricks.com/css-media-queries/.抱歉! 但你猜你想通了:)
编辑:工作结果如下:
#leftnav {
/* default look */
width: 300px;
position: fixed;
top:0;
height: 100%;
}
/* set the size at which the content is clipped and we cannot have fixed position */
@media all and (max-height: 500px) {
/* things inside here will only have an effect if the browser window shows
less than 500 px in the height, so here I apply the special rules */
#leftnav {
position: absolute;
height: auto;
/* etc.. */
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
19867 次 |
最近记录: |