ZK645945 2023-04-21 14:14 采纳率: 100%
浏览 29
已结题

前端显示对其在不同浏览器中显示不相同

前端显示对其在不同浏览器中显示不相同
其中class="mark"的表现在chorme和firefox中的表现不一项,
(firefox表示正常,而chorme中位置偏上)

img

目前设置CSS应对不同浏览器为下,可否请教该修改哪里

<div class="store-hour-selector">
    <div class="store-hour-selector-label">
        <h3 id="style"></h3>
        <selec>
        <option value="">ー</option>
        </select>
    </div>
    <div class="store-hour-selector-label">
        <span class="mark"></span>
    </div>
    <div class="store-hour-selector-label">
        <h3 id="style"></h3>
        <select>
        <option value="">ー</option>
        </select>
    </div>
    <div class="store-hour-selector-label">
        <h3 id="style"></h3>
        <select>
        <option value="">ー</option>
        </select>
    </div>
</div>

div.store-hour-selector-label .mark:before {
    content: '~';
    font-size: 24px;
    line-height: 0;
    position: absolute;
    bottom: 33px;
}

@-moz-document url-prefix() {
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

@supports (-ms-ime-align:auto) {
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

@supports (-ms-accelerator : true) {
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

@media screen\0, screen\9 {
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

@media (min-width: 1024px){
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

@media (min-width: 768px){
    div.store-hour-selector-label .mark:before {
        bottom: 23px;
    }
}

非常感谢

  • 写回答

1条回答 默认 最新

  • 守时间的孤岛 2023-04-21 14:30
    关注

    该回答引用chatgpt:
    您好,根据您提供的代码和描述,可能是因为不同浏览器的默认样式不同导致的。您可以尝试在样式中添加以下内容,以覆盖不同浏览器的默认样式:

    
    div.store-hour-selector-label .mark {
        display: inline-block;
        position: relative;
    }
    
    div.store-hour-selector-label .mark:before {
        content: '~';
        font-size: 24px;
        line-height: 0;
        position: absolute;
        bottom: 0;
    }
    
    

    这里将 bottom 属性的值设置为 0,以便在不同浏览器中显示一致。如果仍然有问题,请尝试添加其他浏览器前缀或更改相关属性的值。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 4月21日
  • 已采纳回答 4月21日
  • 修改了问题 4月21日
  • 修改了问题 4月21日
  • 展开全部

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题