相关疑难解决方法(0)

如何使div不大于其内容?

我的布局类似于:

<div>
    <table>
    </table>
</div>
Run Code Online (Sandbox Code Playgroud)

我希望div只扩展到我的范围table.

html css width

1960
推荐指数
33
解决办法
135万
查看次数

当显示较小时,Div会从外部div中弹出

我得到以下代码:https: //jsfiddle.net/2uhttdgk/3/

html {
  height: 100%;
}
html, body {
    min-height: 100% !important;
    /* prevent horizontal scrolling */
    max-width: 100% !important;
    overflow-x: hidden !important;
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
}


#menuButton {
    float:left;
    background-image: url("../images/hamburger_menu.png");
    width: 50px;
    height: 40px;
    margin-right: 5px;
}

#powerButtonBox {
    float: right;
}

#outerBox {
    min-height: 100%; 
    height: auto !important;
    height: 100%;
}

#title {
    background: #E95353;
    padding: 10px;
    color: white;
    font-size: x-large;
}


#outerBox {
    width: 100%;
    height: 100%;
}


.nav a …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

1
推荐指数
1
解决办法
68
查看次数

标签 统计

css ×2

html ×2

javascript ×1

jquery ×1

width ×1