加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 使跨度表现得像一个按钮

发布时间:2020-12-14 23:06:25 所属栏目:资源 来源:网络整理
导读:我有以下HTML 和css .btns { position: relative;}.num { position: absolute; bottom: 0; width: 100%; text-align: center;}#green,#red { display: inline-block; width: 49%; position: relative;}.green_btn,.red_btn { margin-bottom: 4px;} 我无法弄

我有以下HTML

和css

.btns {
    position: relative;
}

.num {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
}

#green,#red {
    display: inline-block;
    width: 49%;
    position: relative;
}

.green_btn,.red_btn {
    margin-bottom: 4px;
}

我无法弄清楚为什么绿色范围下的(1)在红色按钮下的行为不像(0).如果我删除底部:0;它修复了绿色,但却让人发红.

这里有一个jsfiddle来说明问题http://jsfiddle.net/HajHV/

我在这里错过了什么?

最佳答案
这是因为形式的边缘.

margin: 0 0 20px;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读