使用 CSS 创建座位计划
我想使用 css 创建座位计划。作为一个盒子,我使用了本教程的 css 文件 http://net.tutsplus.com/tutorials/html-css-techniques/create-a-document-icon-with-css3/。
首先,当我尝试在同一行中添加第二个框时,它会跳过一行, 然后我用以下内容更改了盒子的CSS:
.docIcon {
background: #15cd2f;
background: -webkit-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: -moz-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: -o-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: -ms-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
border: 1px solid #ccc;
display: block;
width: 26px;
height: 50px;
float:left;
text-align:center;
}
但问题是,我需要行居中而不是站在左边。
我该怎么做呢?
谢谢。
I would like to create a seating plan by using css. As a box, I used this tutorial's css file http://net.tutsplus.com/tutorials/html-css-techniques/create-a-document-icon-with-css3/.
Firstly, when I'm trying to add second box in a same row, it will skip a line,
then I changed box's css with the following:
.docIcon {
background: #15cd2f;
background: -webkit-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: -moz-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: -o-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: -ms-linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
background: linear-gradient(top, #caffb2 0, #15cd2f 15%, #caffb2 40%, #caffb2 70%, #15cd2f 100%);
border: 1px solid #ccc;
display: block;
width: 26px;
height: 50px;
float:left;
text-align:center;
}
but then the problem is, I need row's to be centered instead of standing on left.
How should I do that ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
然后将盒子包装在居中且具有
text-align: center
的容器中Then wrap your boxes in a container that is centered and has
text-align: center
达是对的....
在这里看到这个http://jsfiddle.net/jzjVT/3/
如果这就是你想要做的..
DA is right ....
here see this http://jsfiddle.net/jzjVT/3/
if this is what you are trying to do..