CSS定位
这些街区不是并排的,而是一个接一个的。我想要A1-A2-A3并排,或者A1-A4、A2-A5、A3-A6并排。如果你能帮助我,我将不胜感激。这是我的代码:CSS定位,css,Css,这些街区不是并排的,而是一个接一个的。我想要A1-A2-A3并排,或者A1-A4、A2-A5、A3-A6并排。如果你能帮助我,我将不胜感激。这是我的代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SGKM</title>
<style type="text/css">
body {
margin:0 auto;
}
body {
font:13px/22px Arial;
color:#444;
}
.container {
width:100px;
}
.container2 {
width:200px;
}
a {
color:#000;
}
.stage {
height:150px;
width:200px;
border:1px solid #f0f0f0;
background:#fafafa;
margin:60px auto;
}
.docIcon {
background: #eee;
background: -webkit-linear-gradient(top, #ddd 0, #eee 15%, #fff 40%, #fff 70%, #eee 100%);
background: -moz-linear-gradient(top, #ddd 0, #eee 15%, #fff 40%, #fff 70%, #eee 100%);
background: -o-linear-gradient(top, #ddd 0, #eee 15%, #fff 40%, #fff 70%, #eee 100%);
background: -ms-linear-gradient(top, #ddd 0, #eee 15%, #fff 40%, #fff 70%, #eee 100%);
background: linear-gradient(top, #ddd 0, #eee 15%, #fff 40%, #fff 70%, #eee 100%);
border: 1px solid #ccc;
display: block;
width: 40px;
height: 56px;
}
</style>
</head>
<body>
<div class="stage">
<center><h2>Sahne</h2></center>
</div>
<div class="container">
<center><a href="#" class="docIcon">A<br>1</a></center>
<center><a href="#" class="docIcon">A<br>2</a></center>
<center><a href="#" class="docIcon">A<br>3</a></center>
</div>
<div class="container2">
<center><a href="#" class="docIcon">A<br>4</a></center>
<center><a href="#" class="docIcon">A<br>5</a></center>
<center><a href="#" class="docIcon">A<br>6</a></center>
</div>
</body>
</html>
新元公里
身体{
保证金:0自动;
}
身体{
字体:13px/22px Arial;
颜色:#444;
}
.集装箱{
宽度:100px;
}
.集装箱2{
宽度:200px;
}
a{
颜色:#000;
}
.舞台{
高度:150像素;
宽度:200px;
边框:1px实心#f0;
背景:#fafafa;
保证金:60像素自动;
}
多西肯先生{
背景:#eee;
背景:webkit线性梯度(顶部、ddd 0、eee 15%、fff 40%、fff 70%、eee 100%);
背景:moz线性梯度(顶部、ddd 0、eee 15%、fff 40%、fff 70%、eee 100%);
背景:-o-线性梯度(顶部、ddd 0、eee 15%、fff 40%、fff 70%、eee 100%);
背景:ms线性梯度(顶部、ddd 0、eee 15%、fff 40%、fff 70%、eee 100%);
背景:线性梯度(顶部、ddd 0、eee 15%、fff 40%、fff 70%、eee 100%);
边框:1px实心#ccc;
显示:块;
宽度:40px;
高度:56px;
}
扎内
看看:
按键为
浮动:左在类中的code>容器
将容器更改为:
.container{}
.container2{
clear:both;
}
并添加float:left代码>到.docIcon
您还可以删除中心元素,并添加文本对齐:中心代码>样式
这将为您提供一个布局,其中包含一行A1、A2和A3,然后在下面包含一行A4到A6
这就是它目前的样子。不知道你到底想要什么-读这个。。。那又有什么关系呢@Sparky672@Jawad当前位置这一切都与OP不清楚自己在问什么有关。@Sparky672:是的,你说得对!