目錄
求教div结合css布局问题_html/css_WEB-ITnose
CSS 布局 div HTML
<html><head> <title>无标题</title> <style type="text/css"> .hbox{ } .vbox{ } </style><body> <div width="100%" height="100%" class="hbox"> <div width="50%" height="100%" class="vbox"> <img src="/static/imghw/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > <img src="/static/imghw/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > </div> <div width="50%" height="100%" class="hbox"> <img src="/static/imghw/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > <img src="/static/imghw/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > </div> </div></body></html>
登入後複製
效果是下面这种样子,首先水平布局分两栏,然后左边是垂直布局,右边是水平布局,如何写css?
回复讨论(解决方案)
补充下效果图:
<!DOCTYPE html><html> <head> <style> .content{ width:300px; height:200px; border:solid 1px red; } .contentLeft{ float:left; width:33%; height:100%; border-right:solid 1px #ccc; } .leftTop{ width:100%; height:50%; border-bottom:solid 1px black; } .leftbottom{ width:100%; height:50%;} </style> </head> <body> <div class="content"> <div class="contentLeft"> <div class="leftTop"></div> <div class="leftbottom"></div> </div> <div class="contentLeft"></div> <div class="contentLeft"></div> </div> </body></html>
登入後複製
可不可以只设置两个样式就完成这种效果,一个是水平的样式,一个是垂直的样式,基于我代码中的那样?
自己修改一下
<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script src="../Res/Script/jquery-1.9.1.js"></script> <style type="text/css"> * { margin:0px; padding:0px; } .hbox { height: 50%; width: 100%; float:left; } .vbox { width: 50%; height: 100%; float:left; } </style></head><body> <div width="100%" height="100%" class="hbox" style=" background:#c8f3f3"> <div width="50%" height="100%" class="vbox"> <div style="background: #808080" class="hbox" >A</div> <div style="background: #2aac3c" class="hbox">B</div> </div> <div width="50%" height="100%" class="vbox"> <div style="background: #ffd800" class="vbox">C</div> <div style="background: #ff0000" class="vbox">D</div> </div> </div></body></html>
登入後複製
搞定了,谢谢qq290032431和w_mojian180!
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前
By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
擊敗分裂小說需要多長時間?
3 週前
By DDD
R.E.P.O.保存文件位置:在哪里以及如何保護它?
3 週前
By DDD

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

我如何使用html5&lt; time&gt; 元素以語義表示日期和時間?
