小编TM2*_*M23的帖子

基本CSS - 如何在顶部覆盖半透明DIV的DIV

我很难在我的浏览器(Chrome)中进行渲染.我有一个包含HTML的所有元素的包装器,我希望有一个DIV(让我们称之为div-1)来保存图像,并且在它的左上方有一个叠加div,就像我在这里勾画的那样图片...任何快速解决方案?

div bg with overlay semi transparent div

html css

65
推荐指数
5
解决办法
13万
查看次数

Chrome中的CSS表和最大宽度无法正常工作

这是我的CSS代码;

#wrap {
    width:50em;
    max-width: 94%;
    margin: 0 auto;
    background-color:#fff;  
}

#head {
    width:50em;
    height:10em;
    max-width: 100%;
    margin: 0 auto;
    text-align:center;
    position: relative;
}

#css-table { 
    display: table; 
    margin: 1em auto;
    position: relative;
    width:50em;
    max-width: 100%;            
}

#css-table .col { 
    display: table-cell; 
    width: 20em;
    padding: 0px;
    margin: 0 auto;
}

#css-table .col:nth-child(even) { 
    background: #fff;
}

#css-table .col:nth-child(odd) { 
    background: #fff;
    border-right: 4px double #b5b5b5;
}
Run Code Online (Sandbox Code Playgroud)

我的HTML代码;

<div id="cont">
    <div id="css-table">
        <div class="col">123</div>
        <div class="col">123</div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

当我缩放Firefox窗口时,表格甚至可以缩小到300px宽度视口......就像我想要的那样.但在Chrome中,只有当视口宽度超过50em时,该表才正常.如果我缩小Chrome窗口,桌子会在包裹的右侧渗出.

有没有理由为什么Chrome会这样做?

css firefox google-chrome css-tables

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

标签 统计

css ×2

css-tables ×1

firefox ×1

google-chrome ×1

html ×1