部分浏览器上a标签包裹的dom元素显示不正常_html/css_WEB-ITnose
在苹果和部分安卓机上出现,pc端和chrome浏览器响应式设计里怎么样也不会出现的
访问后a标签包裹的dom元素显示不正常
a标签内的hr元素颜色显示不正常
hr水平线的颜色被 bootstrap的css的
a { color: #428bca; text-decoration: none;} a:hover,a:focus { color: #2a6496; text-decoration: underline;}
或者被user agent stylesheet
a:-webkit-any-link { color: -webkit-link; }a:-webkit-any-link:active{ color: -webkit-activelink}
重写覆盖
出现的原因是因为hr的css采用了
border-top: 1px solid #xxxxx;之类的写法,设置了hr的border-color为xxx此时的dom结构为这样时<a> <div></div> <hr></a>
一些浏览器就会错误的把 hr的border-color由a的color覆盖渲染
解决办法是把hr设置css { border: 0; height: 1px; color: $spilt_line; width: 100%;}
当我遇到这个问题时我还尝试其它好几种解决方案或者组合并用或者排除,但都没有效果(不能解决),
比如我这样
a{position:relative; z-index:-5;} hr{ position:relative; z-index:10;}
或者这样
hr{border-top: 1px solid #xxx !important;}
或者
a{ color:transparent; &:link { @extend a} &:visited {@extend a} &:hover {@extend a} &:active {@extend a}}a:-webkit-any-link{ color: transparent;}a:-webkit-any-link:visited{ color: transparent;}a:-webkit-any-link:active{ color: transparent;}or a {color:rgba(0,0,0,0)}
以及怀疑过并设置
-webkit-tap-highlight-color:rgba(0,0,0,0);//webkit内核的手机浏览器点击高亮颜色
甚至删除掉所有关于 a color相关的类,但是没有用,会被user agent 自己加上
关于a 不同浏览器有自己的默认样式
webkit浏览器默认样式a:-webkit-any-link { color: -webkit-link; text-decoration: underline; cursor: auto;}a:-webkit-any-link:active { color: -webkit-activelink}mozilla*|*:-moz-any-link { cursor: pointer;}*|*:-moz-any-link:-moz-focusring { /* Don't specify the outline-color, we should always use initial value. */ outline: 1px dotted;}/*opera的默认样式*/a { color: #00C; text-decoration: underline;}iea:visited { color: #800080;}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.
