-2
A
回答
2
添加一些自定義樣式:
.container{
position: relative;
}
.row{ /* for visual purpose */
border: 1px solid black;
padding: 20px 0;
margin: 20px 0;
}
.container>div:first-of-type{
position: absolute;
top: -10px;
left: 20px;
height: 50px;
width: 50px;
z-index:10;
}
.container>div:nth-of-type(4){
position: absolute;
top: 10px;
right: 20px;
bottom : 10px;
width: 50px;
z-index:10;
}
@media (max-width: 768px){ /* reset the custom styles on mobile */
.container>div:first-of-type, .container>div:nth-of-type(4){
position: static;
width: 100%;
}
}
+0
謝謝......我會試試看。 – Nere
0
你不需要引導這裏。
在桌面佈局應用CSS
.row {
position: relative;
}
.first-div {
position: absolute;
left: 30px;
top: -10px;
width: 150px;
height: 250px;
}
.fourth-div {
position: absolute;
right: 10px;
top: 10px;
width: 150px;
height: 600px;
}
和移動視圖應用
.first-div {
position: static;
width: 100%;
height: 300px;
}
.fourth-div {
position: static;
width: 100%;
height: 300px;
}
與HTML:
<div class="row">
<div class="first-div"></div>
<div class="second-div"></div>
<div class="third-div"></div>
<div class="fourth-div"></div>
</div>
相關問題
- 1. 另一個div內的響應div流
- 2. 響應div展開另一個div
- 3. 在另一個div內有兩個div的響應式佈局
- 4. 影響div:懸停與另一個div
- 5. 問題使堆疊的div響應另一個div與圖像
- 6. 響應行的div
- 7. 爲每組div分配一個跨度到另一個div
- 8. 爲什麼一個div的樣式會影響另一個div?
- 9. Div響應像一個img
- 10. 從另一個div中的內容將分類應用於div
- 11. 懸停或單擊一個div來影響另一個div
- 12. 在多重響應類div中選擇一個div
- 13. CSS - 另一個DIV類
- 14. jQuery - 顯示來自另一個類/ div的隱藏div div
- 15. div下另一個div
- 16. div盒內另一個div
- 17. Div另一個div問題
- 18. Div重疊另一個div
- 19. DIV淡入另一個DIV
- 20. 兩個固定Div的響應Div
- 21. 影響同一父DIV的一個DIV懸停的幾個DIV
- 22. 另一個DIV
- 23. 另一個DIV
- 24. 另一個DIV
- 25. 另一個DIV
- 26. 另一個div的div填充影響其他元素
- 27. 懸停元素影響另一個div
- 28. 更改div位置 - div另一個div
- 29. 移動一個div到另一個DIV
- 30. 與另一個DIV更換一個DIV
那麼你有什麼嘗試?你目前的HTML是什麼? – Justinas