我使用的是引導程序3,有div
元素和class
outer
,並且想要在移動設備和計算機上應用不同的CSS。Bootstrap 3在移動設備和計算機上應用不同的CSS
例如,這是我的CSS代碼:
/* for computer */
div.outer {
height: calc(100vh - 80px);
padding: 0;
margin: 0;
min-height: 500px
}
/* for mobile */
div.outer {
position: fixed;
top: 50px;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
padding: 0;
}
如何實現呢?感謝您的任何建議。
你不想使用媒體查詢? – mmativ
感謝您爲我工作的所有答案。抱歉,我無法接受所有答案,但只能選擇第一個答案。 – Bangyou