相关疑难解决方法(0)

并排对齐<div>元素

我知道这是一个相当简单的问题,但我无法弄清楚我的生活.我有两个链接,我已经应用了背景图像.这是它目前的样子(为阴影道歉,只是按钮的粗略草图):

在此输入图像描述

但是,我希望这两个按钮并排.我无法弄清楚对齐需要做些什么.

这是HTML

<div id="dB"}>
    <a href="http://notareallink.com" title="Download" id="buyButton">Download</a> 
</div>
<div id="gB">
    <a href="#" title="Gallery" onclick="$j('#galleryDiv').toggle('slow');return false;" id="galleryButton">Gallery</a>     
</div>
Run Code Online (Sandbox Code Playgroud)

这是CSS

#buyButton {
    background: url("assets/buy.png") 0 0 no-repeat;
    display:block;
    height:80px;
    width:232px;
     text-indent:-9999px;
}
#buyButton:hover{
width: 232px;
height: 80px;
background-position: -232px 0;
}
#buyButton:active {
width: 232px;
height: 80px;
background-position: -464px 0;
}

#galleryButton {
    background: url("images/galleryButton.png") 0 0 no-repeat;
    display:block;
    height:80px;
    width:230px;
     text-indent:-9999px;
}
#galleryButton:hover{
width: 230px;
height: 80px;
background-position: -230px 0;
}
#galleryButton:active {
width: 230px;
height: 80px;
background-position: -460px …
Run Code Online (Sandbox Code Playgroud)

html css alignment

108
推荐指数
3
解决办法
24万
查看次数

标签 统计

alignment ×1

css ×1

html ×1