Css 将屏幕分为两个不同宽度的部分
我试图将页面分成两部分,但大小不同。 使用下面的代码,我得到了两个部件,但大小相同 html部分是:Css 将屏幕分为两个不同宽度的部分,css,html,Css,Html,我试图将页面分成两部分,但大小不同。 使用下面的代码,我得到了两个部件,但大小相同 html部分是: <div class="split left"> <div class="centered"> <h2>Jane Flex</h2> <p>Some text.</p> </div> </div> <div class="split right"> &l
<div class="split left">
<div class="centered">
<h2>Jane Flex</h2>
<p>Some text.</p>
</div>
</div>
<div class="split right">
<div class="centered">
<h2>John Doe</h2>
<p>Some text here too.</p>
</div>
</div>
有可能吗?
提前感谢
从类中删除宽度:50%
。拆分类。并向.left
和.right
类添加宽度属性(任意)
/* Control the left side */
.left {
left: 0;
background-color: orange;
width: 30%;
}
/* Control the right side */
.right {
right: 0;
background-color: red;
width: 70%;
}
谢谢我是否可以删除其中一个部分中的垂直滚动条而不删除另一个部分中的垂直滚动条?谢谢again@PeterPam对将overflow-y:hidden
添加到.left
或.right
类
/* Control the left side */
.left {
left: 0;
background-color: orange;
width: 30%;
}
/* Control the right side */
.right {
right: 0;
background-color: red;
width: 70%;
}