【问题标题】:Button-groups at the bottom in differents devices不同设备底部的按钮组
【发布时间】:2015-07-07 14:01:30
【问题描述】:

我正在为移动设备做设计,我必须考虑不同的设备。我在页面底部放置了一个按钮组。这意味着按钮出现在滚动条的最后。但是,当页面因为设备太大而太小时,按钮会出现在页面的中间。在那之后,有空白。 我尝试使用以下规则:How to put the footer at the bottom of the visible page? 但按钮始终出现在屏幕底部。使用滚动条后我需要查看按钮。

HTML

<div id="botoneraInternet" class="btn-group btn-group-justified" role="group" aria-label="...">
    <div class="btn-group btn-group-lg" role="group">
        <button type="button" class="btn btn-default" id="botonHardware" disabled="" style="background-color: rgb(48, 144, 184);">
            <span><img class="icons" src="imagenes/llave.png"></span> Hardware
        </button>
    </div>

    <div class="btn-group btn-group-lg" role="group">
        <button type="button" class="btn btn-default" id="botonClose" style="background-color: rgb(223, 228, 229);">
            <span><img class="icons" src="imagenes/valija.png"></span> Cerrar WO
        </button>
    </div>
</div>

CSS

.btn-group {
  position: relative;
  vertical-align: middle;
}
.btn-group-justified {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
}

有人可以帮助我吗? 非常感谢,我将给最佳答案打星。

【问题讨论】:

    标签: html css button mobile device


    【解决方案1】:

    试试这个....你提供的代码不够,所以我即兴创作了一点。但如果这是您需要的,请告诉我。

    http://codepen.io/carinlynchin/pen/WvbLXE

    CSS:

    body{
        height:900px;
        position:relative;
    }
    
    .btn-group {
        position: absolute;
        width:100%;
        bottom:0
    }
    
    .btn-group div {
        display:inline;
    }
    

    HTML:

    <div id="botoneraInternet" class="btn-group btn-group-justified" role="group" aria-label="...">
        <div role="group">
            <button type="button" class="btn btn-default" id="botonHardware" disabled="" style="background-color: rgb(48, 144, 184);">
                <span><img class="icons" src="http://barkpost-assets.s3.amazonaws.com/wp-content/uploads/2013/11/grumpy-dog-11.jpg"></span> Hardware
            </button>
        </div>
    
        <div role="group">
            <button type="button" class="btn btn-default" id="botonClose" style="background-color: rgb(223, 228, 229);">
                <span><img class="icons" src="https://pbs.twimg.com/profile_images/3540744128/7dd80644ae052f1b04180c41bbc674ab.png"></span> Cerrar WO
            </button>
        </div>
    </div>
    

    【讨论】:

    • 我尝试过,但它不起作用。这是问题的屏幕截图:mediafire.com/view/dbm3c353sir8ww4/captura%2001.png?ssl=on
    • 你能分享整个代码吗?也许在 codepen.io 或 jsfiddle 中复制它,因为我需要查看整个树才能了解它发生的原因
    • 对不起,我删除了之前的笔……又是codepen.io/carinlynchin/pen/bdNzBK
    • 好的,所以也许你需要将 height:100% 添加到外部容器...也许其中一个就在那里结束,所以它确实在底部,除了父不扩展全高。
    • 我不能放完整的代码,因为有一个js负责这部分,另一个负责下面的,还有另一个......它是我现在正在编辑的一个旧项目。我尝试你的方法,但不起作用。 :(
    猜你喜欢
    • 1970-01-01
    • 2016-11-05
    • 2016-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-13
    • 2016-02-18
    • 1970-01-01
    相关资源
    最近更新 更多