帮忙看看浮动DIV布局问题(怎么靠下对齐啊?)(内附示意图)_html/css_WEB-ITnose
本人不擅长CSS+DIV,今日遇到这个头痛的问题.画图以示之.
大概界面就是这种,,全部是浮动DIV...
回复讨论(解决方案)
图片的意思是想实现左边的效果...不好意思刚才没描述清楚
你使用float:left ,这个是中间布局使用,,下面的时候,直接clear
原谅本人最近智商总是出现问题,时常看不懂各楼主提出的问题到底是什么意思。。。。
Code:
<div class="aa"> <div class="tt" style="height:200px;background:red;">A</div> <div class="tt"> <div style="width:70%;float:left;background:yellow;height:400px;">B</div> <div style="width:30%;float:left;background:green;height:100px;">D</div> </div> <div class="tt" style="height:200px;background:blue;">C</div></div><div class="aa"> <div class="tt" style="height:200px;background:red;">A</div> <div class="tt2"> <div style="width:70%;float:left;background:yellow;height:400px;">B</div> <div class="D" style="width:30%;float:left;background:green;height:100px;">D</div> </div> <div class="tt" style="height:200px;background:blue;">C</div></div><style>.aa{width:48%;border:solid 2px;float:left;zoom: 1;margin-right:10px;}.aa:after { content: " "; display: block; clear: both; height: 0;}.tt{width:100%; zoom: 1;}.tt:after { content: " "; display: block; clear: both; height: 0;}.tt2{position:relative;width:100%;zoom: 1;}.tt2:after { content: " "; display: block; clear: both; height: 0;}.D{position:absolute;bottom:0;right:0;}</style>
“靠下对齐”?这个没有。
你可以使用绝对定位,让 “D” 底端对齐。
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body><style> .box { background-color: gray; width: 400px; height: 300px; } .foo { background-color: green; width: 80px; height: 160px; bottom: 0px; right: 0px; } .absolute { position: absolute; } .relative { position: relative; }</style> <div class="box absolute"> <div class="foo absolute">D </div> </div> </body></html>
原谅本人最近智商总是出现问题,时常看不懂各楼主提出的问题到底是什么意思。。。。
Code:
<div class="aa"> <div class="tt" style="height:200px;background:red;">A</div> <div class="tt"> <div style="width:70%;float:left;background:yellow;height:400px;">B</div> <div style="width:30%;float:left;background:green;height:100px;">D</div> </div> <div class="tt" style="height:200px;background:blue;">C</div></div><div class="aa"> <div class="tt" style="height:200px;background:red;">A</div> <div class="tt2"> <div style="width:70%;float:left;background:yellow;height:400px;">B</div> <div class="D" style="width:30%;float:left;background:green;height:100px;">D</div> </div> <div class="tt" style="height:200px;background:blue;">C</div></div><style>.aa{width:48%;border:solid 2px;float:left;zoom: 1;margin-right:10px;}.aa:after { content: " "; display: block; clear: both; height: 0;}.tt{width:100%; zoom: 1;}.tt:after { content: " "; display: block; clear: both; height: 0;}.tt2{position:relative;width:100%;zoom: 1;}.tt2:after { content: " "; display: block; clear: both; height: 0;}.D{position:absolute;bottom:0;right:0;}</style>
兄弟完美的解决了我的问题,而且还给出了兼容性方案,功力了得.
结贴给分了.

熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

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

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

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

Dreamweaver CS6
視覺化網頁開發工具

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

HTML、CSS和JavaScript在Web開發中的作用分別是:1.HTML定義網頁結構,2.CSS控製網頁樣式,3.JavaScript添加動態行為。它們共同構建了現代網站的框架、美觀和交互性。

HTML的未來趨勢是語義化和Web組件,CSS的未來趨勢是CSS-in-JS和CSSHoudini,JavaScript的未來趨勢是WebAssembly和Serverless。 1.HTML的語義化提高可訪問性和SEO效果,Web組件提升開發效率但需注意瀏覽器兼容性。 2.CSS-in-JS增強樣式管理靈活性但可能增大文件體積,CSSHoudini允許直接操作CSS渲染。 3.WebAssembly優化瀏覽器應用性能但學習曲線陡,Serverless簡化開發但需優化冷啟動問題。

HTML的未來充滿了無限可能。 1)新功能和標準將包括更多的語義化標籤和WebComponents的普及。 2)網頁設計趨勢將繼續向響應式和無障礙設計發展。 3)性能優化將通過響應式圖片加載和延遲加載技術提升用戶體驗。

HTML是構建網頁結構的基石。 1.HTML定義內容結構和語義,使用、、等標籤。 2.提供語義化標記,如、、等,提升SEO效果。 3.通過標籤實現用戶交互,需注意表單驗證。 4.使用、等高級元素結合JavaScript實現動態效果。 5.常見錯誤包括標籤未閉合和屬性值未加引號,需使用驗證工具。 6.優化策略包括減少HTTP請求、壓縮HTML、使用語義化標籤等。

HTML、CSS和JavaScript在網頁開發中的角色分別是:HTML負責內容結構,CSS負責樣式,JavaScript負責動態行為。 1.HTML通過標籤定義網頁結構和內容,確保語義化。 2.CSS通過選擇器和屬性控製網頁樣式,使其美觀易讀。 3.JavaScript通過腳本控製網頁行為,實現動態和交互功能。

HTML、CSS和JavaScript是構建現代網頁的核心技術:1.HTML定義網頁結構,2.CSS負責網頁外觀,3.JavaScript提供網頁動態和交互性,它們共同作用,打造出用戶體驗良好的網站。

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增強WebevebDevelopment。

本文討論了HTML標籤,和和關注其語義與表現用途及其對SEO和可訪問性的影響之間的差異。
