【发布时间】:2013-12-21 23:59:12
【问题描述】:
我需要在图片旁边放一个文字.. 这是为显示图像而生成的 CSS 代码:
CSS:
#showbox {
list-style: none;
padding: 0;
width: 973;
height: 46px;
background: white repeat;
z-index: 12;
position: relative;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
}
#showbox span {
display: none;
position: absolute;
}
#showbox a {
width: 100%;
display: inline;
text-indent: -900%;
position: absolute;
outline: none;
}
#showbox a:hover {
background-position: left bottom;
}
#showbox a:hover span{
display: inline;
}
#showbox .one {
width: 46px;
height: 46px;
top: 0px;
left: 0px;
background: url(images/cerchio1.png) no-repeat;
}
#showbox .two {
width: 46px;
height: 46px;
top: 0;
left: 240px;
background: url(images/cerchio2.png) no-repeat;
}
#showbox .three {
width: 46px;
height: 46px;
top: 0px;
left: 480px;
margin-right: 12px;
background: url(images/cerchio3.png) no-repeat;
}
#showbox .four {
width: 46px;
height: 46px;
top: 0px;
left: 720px;
margin-right: 12px;
background: url(images/cerchio4.png) no-repeat;
}
HTML:
<div id="showbox">
<a class="one"></a>
<a class="two"></a>
<a class="three"></a>
<a class="four"></a>
</div>
如果我想要图片右侧的文字,我该怎么办? 我必须为文本创建另一个框? 这个图像代码是好的还是可以删除部分代码?谢谢
【问题讨论】:
-
你为什么把你的图片放在后台而不是使用
img标签? -
您需要在每个链接中、每张图片之后(在右侧)还是在图片组/区域的右侧添加文字?
-
是的,我需要 [IMAGE] 文本... [IMAGE] 文本... 在图像右侧和顶部有一点边距,以便在图像中间对齐..