如何垂直划分页面50/50? [英] How to divide a page 50/50 vertically?
问题描述
我知道这是相当容易的,但由于某些原因,我不能让我的页面垂直划分50/50。我的HTML中有我的CSS外部。下面是我的CSS代码。任何帮助将非常感谢!
谢谢!
Lanie
h1
{
宽度:50%;
填充:10px;
保证金:0;
text-align :中心;
}
h2
{
浮动:左;
宽度:50%;
填充:10px;
保证金:0;
text-align:center ;
}
h3
{
float:right;
宽度:50%;
填充:10''
px;
保证金:0;
text-align:center;
}
#a1_side
{
float:left;
宽度:50%;
填充:20px;
保证金:0;
text-align:center;
}
#a2_side
{
float:right;
宽度:50%;
填充:20px;
margin:0;
text-align:center;
}
查看和改编:
< !doctype < span class =code-attribute> html >
< html >
< span class =code-keyword>< head >
< meta charset = utf-8 >
< title > 垂直拆分50/50 < / title >
< style >
div {
float:left;
宽度:50%;
}
< / style >
< / head >
< div style = background -color:#9F6 > left < / div >
< div style = background-color:#F60 > right < / div >
< body >
< / body >
< / html >
Hi,
I know this is something fairly easy, but for some reason I can't get my page to divide evenly 50/50 vertically. I have my CSS external from my HTML. Below is my CSS code. Any help would greatly appreciated!
Thank you!
Lanie
h1
{
width: 50%;
padding: 10px;
margin: 0;
text-align: center;
}
h2
{
float: left;
width: 50%;
padding: 10px;
margin: 0;
text-align: center;
}
h3
{
float: right;
width: 50%;
padding: 10''
px;
margin: 0;
text-align: center;
}
#a1_side
{
float: left;
width: 50%;
padding: 20px;
margin: 0;
text-align: center;
}
#a2_side
{
float: right;
width: 50%;
padding: 20px;
margin: 0;
text-align: center;
}
See and adapt:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Split 50/50 Vertically</title> <style> div { float: left; width: 50%; } </style> </head> <div style="background-color:#9F6">left</div> <div style="background-color:#F60">right</div> <body> </body> </html>
这篇关于如何垂直划分页面50/50?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!