css 左右兩邊對齊
阿新 • • 發佈:2020-08-24
<!DOCTYPE html> <html lang=""> <head> <meta charset="utf-8"> </head> <style> .column-box { overflow: hidden; } .column-left { background: red; } .column-right { background: pink; } .column-left, .column-right{ margin-bottom: -9999px; padding-bottom: 9999px; width: 500px; float: left; } .container { margin: auto; max-width: 1020px; overflow: hidden; } </style> <body> <div class="container"> <div id="colLeft"class="column-left"> <h4>正方觀點</h4> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> <p>觀點1</p> </div> <div id="colRight" class="column-right"> <h4>反方觀點</h4> <p>觀點1</p> </div> </div> </body> <script> </script> </html>