源代码:
下载代码
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> <style> .a { display: contents; border: 1px solid red; background-color: lightgrey; padding: 10px; width: 200px; } .b { border: 1px solid blue; background-color: lightblue; padding: 10px; } </style> </head> <body> <h1>display 属性</h1> <h2>display: contents:</h2> <div class="a"> 君者,舟也;庶人者,水也。 <p class="b">这里测试效果!</p> 水则载舟,水则覆舟。</div> </body> </html>
运行结果: