我在jscript源上对齐按钮和小图片时遇到了一些麻烦...这里是右边照片滑块的链接,粉红色按钮需要与预览图像对齐:http://www.inside-guides.co.uk/brentwood/local-tradesmen/roofers-and-roofing-services/ace-roofing-co-ltd.html < / p>
以下是代码:
<div id="photos-preview">
<input class="photos-btn" type="button" onclick="slidePrev();" value="<<" />
<% for i = 0 to ubound(images)
%><img src="/includes/tn.asp?src=<%=server.URLEncode(images(i))%>&w=30" style="margin:3px;cursor:pointer" onclick="$('.MainImage').fadeOut(500).hide(0,function(){$('#MainImage<%=images(i)%>').fadeIn(500)});" /><%
next %>
<input class="photos-btn" type="button" onclick="slideNext();" value=">>" />
</div>
CSS:
#photo-slider {float:right;width:275px;margin:5px;border:1px
solid #B2B2D4;}
#main-photos {text-align:center;height:200px;padding:8px 0;}
#photos-preview {text-align:center;}
.photos-btn {background-color:#b21589;cursor:pointer;color:#fff;font-size:9px;font-weight:bold;padding:4px;}
任何想法都非常感激。
答案 0 :(得分:2)
试试这个css:
#photos-preview img, #photos-preview input {
vertical-align: middle;
}
这是预览:
答案 1 :(得分:1)
尝试为vertical-align: top;
.photos-btn
答案 2 :(得分:1)
将.photos-btn css类更改为:
.photos-btn {
background-color: #B21589;
cursor: pointer;
color: white;
font-size: 9px;
font-weight: bold;
padding: 4px;
margin-top: 2px;
vertical-align: top;
}
答案 3 :(得分:0)
为下一个和上一个按钮
制作2个css并将以下内容添加到您的css
photo-btn-prev {
float :left;
}
photo-btn-next { float : right;}