html - 奇怪的边框位置

标签 html css

我发现了一些奇怪的 CSS 错误。

我有一个 <div>容器,里面有一些文本和一个 Font-Awesome 图标。 <div>容器的样式使其具有小边框。奇怪的是,边框似乎“认为” <div>只有实际高度的一半。

这仅发生在 Chrome 移动版 (Android) 中,但不会出现在 Chrome 桌面版中(未在 safari 和 co 中测试...)

enter image description here

HTML

<div class="sidebar">
    Lade Daten... <li class="fa fa-spin fa-spinner"></li>
</div>

CSS

@media only screen and (max-width: 860px)
{
    .sidebar {
        position: relative;
        width: auto;
        margin: 0 20px;
    }
}

.sidebar {
    position: absolute;
    background: rgb(255, 255, 255);
    border-radius: 5px;
    margin-left: 20px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.9);
    width: 335px;
    box-shadow: 2px 2px 5px;
}

body {
    margin: 0;
    background: rgb(60,60,60);
    font-size: 16px;
    font-family: 'Share Tech Mono', Arial;
}

最佳答案

尝试将 height: (px you want it) 放入您的 @media query

关于html - 奇怪的边框位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43544723/

相关文章:

html - 如何在单个表格行中将一个对象左对齐,一个对象在中心(整行)对齐?

html - 添加链接到按钮 HTML

jquery - 图像在 IE 中出现拉伸(stretch)

html - 调整 iframe 的大小

javascript - 使用 fullpage.js 显示当前节号

html - 无法将 polymer 元件垂直居中在全出血体内

css - 将背景图像放在菱形容器中会导致容器变形

Jquery 查找不适用于 AJAX 返回数据

html - 如何将滚动条放置在表格一侧?

html - 为什么 DIV 在使用显示 :table-cell? 时会根据另一个 DIV 的样式定位其内容