我对 CSS 和属性组合还很陌生,我遇到了一个问题,即出现了我不想要的间隙。在玩弄了这些属性并观看了一些 youtube 视频后,我仍然遇到问题。从欢迎磁贴底部到示例标题的间距应为 10 像素。
我正在尝试制作类似于 Windows Metro 或任何他们所称的瓷砖的瓷砖。我已经创建了锚点 ID,并且 ID 的 CSS 创建了图块。
此图显示了问题:
.header {
background:url(../images/header2.png) no-repeat;
width:384px;
height:69px;
}
#content {
position:relative;
width:384px;
height:646px;
margin-top:30px;
overflow:hidden;
border:none;
background-color:#CCC;
}
.welcomeTile {
background:url(../images/welcomeTile.jpg) no-repeat;
float:left;
width:180px;
height:280px;
margin-left:7px;
}
.aboutTile{
background:url(../images/aboutTile.jpg) no-repeat;
float:left;
width:180px;
height:105px;
margin-left:10px;
}
.galleryTile{
background:url(../images/galleryTile.jpg) no-repeat;
float:left;
width:180px;
height:105px;
margin-left:10px;
margin-top:10px;
}
.examplesTile{
background:url(../images/examplesTile.jpg) no-repeat;
float:left;
width:180px;
height:105px;
margin-left:7px;
clear:left;
}
.contactTile{
background:url(../images/contactTile.jpg) no-repeat;
float:left;
width:180px;
height:105px;
margin-top:10px;
margin-left:7px;
clear:left;
}