第一種方法:
<!DOCTYPE> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .one { position: absolute; height: 200px; width: 300px; background-color: blue; } .two { height: 200px; margin-left: 300px; background-color: red; } </style> </head> <body> <div class="one"></div> <div class="two">第一種方法</div> </body> </html>
第二種方法:
<!DOCTYPE> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .one { float:left; height: 200px; width: 300px; background-color: blue; } .two { overflow: auto; height: 200px; background-color: red; } </style> </head> <body> <div class="one"></div> <div class="two">第二種方法</div> </body> </html>
以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持!
【網(wǎng)站聲明】本站除付費(fèi)源碼經(jīng)過測(cè)試外,其他素材未做測(cè)試,不保證完整性,網(wǎng)站上部分源碼僅限學(xué)習(xí)交流,請(qǐng)勿用于商業(yè)用途。如損害你的權(quán)益請(qǐng)聯(lián)系客服QQ:2655101040 給予處理,謝謝支持。