如何对齐CSS表单

时间:2013-10-06 01:11:27

标签: jquery html css

我似乎无法将此表单对齐在页面的绝对中心,顶部和底部边距为25px。我已经改变并添加了像margin-left这样的东西:10%;但它只是改变了图片的间距,而不是将整个文档整体移动。

这是JSFiddle:http://jsfiddle.net/eeEFh/3/embedded/result/

这是我改变css的地方:

.box{
  width: 175px;
  height: 175px;
  background: url('http://placekitten.com/250/200');
  float: left;
  overflow: hidden;
  margin-right: 15px;
  margin-bottom: 15px;
  border: 1px solid #000;
  box-shadow: 0px 0px 15px 0px #666,
              0px 5px 15px 0px #000;
}

2 个答案:

答案 0 :(得分:1)

我认为您要考虑.container,而不是.box

试试这个:

.container {
font-family: Arial;
position: relative;
margin: auto;
width: 780px;
}

答案 1 :(得分:0)

我在你的CSS上看到了这个错误。你也应该解决这些问题, .cover .btn {background: none repeat scroll 0 0 #0099CC;border-radius: 0.25em 0.25em 0.25em 0.25em;float: left;margin: 0.5em;padding: 0.5em 1em;}

.box .cover .intro {float: left;font-size: 10pt;height: 4.8em;line-height: 1.2em;overflow: hidden;position: relative;width: 160px; }