Html 将三个div相邻放置在中间
不太擅长这一点只是开始,但我只是不能中心这些div有人可以帮助:/我已经在网上寻找,但没有找到任何将与它工作。。。我只有12岁,这对我来说是全新的Html 将三个div相邻放置在中间,html,css,center,Html,Css,Center,不太擅长这一点只是开始,但我只是不能中心这些div有人可以帮助:/我已经在网上寻找,但没有找到任何将与它工作。。。我只有12岁,这对我来说是全新的 *{ margin: 0px; padding: 0px; } #Title{ height:75px; width:60%; margin-top:5%; background-color:black; display: table; margin-left: auto ; m
*{
margin: 0px;
padding: 0px;
}
#Title{
height:75px;
width:60%;
margin-top:5%;
background-color:black;
display: table;
margin-left: auto ;
margin-right: auto ;
}
#Wallpaper{
width:15%;
height:250px;
background-color:black;
display: inline-block;
margin-top:5%;
margin-left: auto ;
margin-right: auto ;
float:center;
}
#Logo{
width:15%;
height:250px;
background-color:black;
display: inline-block;
margin-top:5%;
margin-left: auto ;
margin-right: auto ;
float:center;
}
#YoutubeBanner{
width:15%;
height:250px;
background-color:black;
display: inline-block;
margin-top:5%;
margin-left: auto ;
margin-right: auto ;
float:center;
}
这里有一种方法,它反应灵敏,流动性好 演示: CSS
body,
html {
margin: 0;
padding: 0;
background: #fff;
font: 1em/1.5 sans-serif;
}
.row,
.column {
box-sizing: border-box /*so padding and borders are included in width */
}
.row {
word-spacing: -1em; /* fix the inline block extra space issue */
letter-spacing: -1em; /* fix the inline block extra space issue */
overflow: hidden;
text-align: center;
padding: 0 20px;
width: 100%;
max-width: 1200px;
margin:0 auto;
}
.column {
vertical-align: top;
word-spacing: normal; /* reset child */
letter-spacing: normal; /* reset child */
display: inline-block;
border: 1px solid red;
width: 100%; /* the size UNDER the min-width in the media query*/
padding: 10px;
text-align: left; /* reset child */
}
@media (min-width:500px) {
.column {
width: 33.333%;
max-width: 250px; /* the max-width */
}
}
HTML:
<div class="row">
<div class="column">
Column 1 text goes here. Text goes here for column 1.
</div>
<!--/.column -->
<div class="column">
Column 2 text goes here. Text goes here for column 1.
</div>
<!--/.column -->
<div class="column">
Column 3 text goes here. Text goes here for column 1.
</div>
<!--/.column -->
</div>
<!--/.row -->
第1列的文本在这里。这里是第1列的文本。
第2栏的文字在这里。这里是第1列的文本。
第3栏的文字在这里。这里是第1列的文本。
您也可以这样编写代码
html
div.wrapper{
-webkit列数:3;
/*铬、狩猎、歌剧*/
-moz列数:3;
/*火狐*/
列数:3;
宽度:80%;
边框:1px纯黑;
文本对齐:居中;
保证金:0自动;
}
你好
是的,你
是的
HTML的外观如何?和float:center
不存在,只允许left/right
值。你写了三个div,在CSS中有4个元素,总宽度为105%,大于100%:-)
<center>
<div>Div1</div>
<div>Div2</div>
<div>Div3</div>
</center>
div
{
display: inline-block;
border: 1px solid red;
}