实例首页
自学教程
IT工具箱
源代码
下载代码
上下布局
点击运行 >
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>css display content 实例 - 自学教程(runoops.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>
运行结果: