首页
HTML
HTML Div
试用:多个 div 元素
运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>Multiple DIV Elements</h1> <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> <p>CSS styles are added to make it easier to separate the divs, and to make them more pretty:)</p> </body> </html>