html电脑分屏代码
电脑分屏功能可以让用户同时在屏幕上显示多个窗口,提高工作效率。而HTML作为网页开发语言,也可以实现电脑分屏的功能。
<html> <head> <title>电脑分屏页面</title> <style> .container { display: flex; height: 100vh; } .left, .right { height: 100%; flex: 1; } </style> </head> <body> <div class="container"> <div class="left"> <h1>左侧窗口</h1> </div> <div class="right"> <h1>右侧窗口</h1> </div> </div> </body> </html>
上面的代码使用了flex布局,设置了一个容器和两个子容器。通过设置子容器的flex属性,两个子容器可以按照比例占据容器的空间,达到分屏的效果。
可以根据需要调整左右窗口的大小,并在子容器中添加其他元素、样式和内容。