javascript - 在 svg 内设置该 div 时,div 边框不起作用

标签 javascript html svg

这是我的代码,

<div class="content-container-fluid">      
    <div class="row">                
        <div class="cols-sample-area" style="width: 100%;"> 
            <div id="scrollcontent" style="width:92% !important; transform: translate(0, 50%);">                  
                <div id="scrollcontenttemplate_group_" style="position: absolute;">
                    <div id="scrollcontentthumbleft" style="position: absolute; top: 42px; cursor: pointer; z-index: 1; left: 276.34375px;">
                        <div style="width:8px;height:36px;background-color: #41d335;border: 1px solid black;"></div>
                    </div>
                </div>
                <svg id="scrollcontent_svg" style="overflow:visible;position:relative" height="120" width="1188">
                    <g id="scrollcontenthigherLevel" style="cursor: pointer;">
                        <line x1="1" y1="0" x2="1" y2="21" stroke="black" stroke-width="1" stroke-dasharray="1 1 10"></line>
                    </g>
                </svg>
            </div>  
        </div>
    </div>
</div>

Out put image

线条划线数组应用于该 div 吗?如何解决这个问题?

为什么边框显示成这样..如何解决?

Sample link

最佳答案

SVG 的破折号数组实际上并不影响 <div> 。这似乎是 Chrome 中的一个奇怪的渲染/合成异常。

您可以通过更改 dasharray 值来确认它不是 dasharray。 此外,如果您缩放页面(Ctrl-+),“冲刺”就会消失。

我不知道原因是什么,但你可能想report the bug to Chrome .

关于javascript - 在 svg 内设置该 div 时,div 边框不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31022894/

相关文章:

javascript - Discord 机器人的特定角色命令

html - div float 时删除垂直空白空间

javascript - 使用 JavaScript 代码在 Google map 中添加更多具有不同位置的标记

javascript - D3.js:圆半径比例未显示圆

javascript - 无法在加载的 svg 上调用 getElementsByTagName

javascript - 如何将 JavaScript onClick 处理程序添加到嵌入式 html 对象?

javascript - 在 if 语句中检查多个数组元素

javascript - 比较 jquery timepicker 值

javascript - 如何阻止带有哈希值的URL跳转到 anchor ?

html - 如何使用 CSS3 修复代码使封面完全居中