如何阻止 Safari 和 google chrome 中的 html5 视频下方出现黑线
我在此页面上有一些 html5 视频我已经设法对其进行排序,以便我对其在大多数浏览器中工作并在不支持视频标签的浏览器中显示图像感到满意。
有一个奇怪的错误,我似乎无法在 chrome 和 safari 中解决,视频下方会出现一条细黑线。我一直在研究它,但一无所获。
link to the page I'm trying to get sorted
I've got some html5 video on this page and I've managed to get it sorted so that I'm happy with it working in most browsers and displaying an image in those that don't support the video tag.
There is a strange bug that I don't seem to be able to sort out in chrome and safari where a thin black line appears below the video. I've been looking into it but have come up with nothing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在问题最初链接的视频中,黑线位于 MP4 视频本身。 webm 和 ogg 版本中没有它。 Safari 和 Chrome 将播放 MP4。
您可以将视频放入一个较小的div中,并使用
overflow:hidden
来裁剪它,但您可能想要修复视频文件。In the video originally linked in the question, the black line is in the MP4 video itself. It's not in the webm and ogg versions. Safari and Chrome will play the MP4.
You could put the video inside a smaller div with
overflow:hidden
to crop it, but you probably want to fix the video file.你可以使用CSS hack
You can use CSS hack
您缺少视频周围锚点链接的结束标记以及
video
标记本身:在末尾添加
:
编辑:
还可以尝试为
video
标签指定border:0
css 样式:You are missing the closing tag for the anchor link surrounding your video, and the
video
tag itself:Add
</video></a>
at the end:Edit:
Also try giving the
video
tag aborder:0
css style:视频 {
剪辑路径:插入(1px 1px);
video {
clip-path: inset(1px 1px);
解决了!!!我将 PAR(像素长宽比)更改为“方形像素”,这样我就避免了那些黑线;)
Solved it!!! i changed my PAR (Pixel Aspect Ratio) to "Square Pixels", in that way, i avoided those black lines ;)