主頁
HTML
HTML Div
Tryit: 使用網格
執行 ❯
建立您
自己的
網站
×
改變方向
儲存程式碼
改變主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .grid-container { display: grid; grid-template-columns: 33% 33% 33%; } </style> </head> <body> <h1>Grid Example</h1> <p>Align three DIV elements side by side.</p> <div class="grid-container"> <div style="background-color:#FFF4A3;"> <h2>London</h2> <p>London is the capital city of England.</p> <p>London has over 13 million inhabitants.</p> </div> <div style="background-color:#FFC0C7;"> <h2>Oslo</h2> <p>Oslo is the capital city of Norway.</p> <p>Oslo has over 600.000 inhabitants.</p> </div> <div style="background-color:#D9EEE1;"> <h2>Rome</h2> <p>Rome is the capital city of Italy.</p> <p>Rome has almost 3 million inhabitants.</p> </div> </div> </body> </html>