มาทบทวน css การแบ่งข้อมูลออกเป็น 3 คอลัมน์อย่างง่ายกัน
สามารถนำไปประยุกต์ใช้งานได้
ตัวอย่าง
โค้ดทั้งหมด
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <head> <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" /> <title></title> <style type= "text/css" > .column1_div{ position:relative; float:left; width:33%; background-color:#FC6; } .column2_div{ position:relative; float:left; width:33%; margin:0px 0.5%; background-color:#C96; } .column3_div{ position:relative; float:right; width:33%; background-color:#69F; } </style> </head> <body> <div style= "margin:auto;width:75%;background-color:#FCC;" > <div class = "column1_div" > </div> <div class = "column2_div" > </div> <div class = "column3_div" > </div> </div> </body> </html> |