<hr> not displaying at all on IOS Safari and regular android browser.

不打扰是莪最后的温柔 提交于 2020-02-02 16:24:48

问题


So i have a:

<div class="divHr">
<hr size="0.01">
</div>

.divHr hr{
display: block;
width: 100%;
border-top: 0.25px dotted #CCCCCC;
}

If i view it on Chrome / IE / Firefox - additionally it works great on google chrome on mobile devices. If i view the site on Safari (IOS) or the standard Android Browser, the HR doesn't display at all. I have tried not displaying the border using border: 0px; and changing the size="0.01" to 1, but it still doesn't display - so it isn't a problem with borders. `

I'd really appriciate some help on this one, thanks guys!


回答1:


I have not experienced this before myself, but when working with IOS and such I always add appearance: none; into my CSS.

I hope this works for you.

More information about the appearance property https://css-tricks.com/almanac/properties/a/appearance/

Best regards,




回答2:


Okay, so i found a solution. Instead of using <hr> just make a div and style it like this:

.hrDiv{
border-top: 1px dotted #CCCCCC; 
width: 100%;
height: 0.01px;
border-top-style: dotted;
border-left: none;
border-right: none;
border-bottom: none;
color: #CCCCCC;
display: block;
border-color: #CCCCCC;

}



来源:https://stackoverflow.com/questions/38284957/hr-not-displaying-at-all-on-ios-safari-and-regular-android-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!