If target file is .php none of the formatting for the tag will be applied. Only if the tag is for a .html or .htm will the formatting apply. The link works either way and the .php file is loaded.
<a href="/contact/index.html"> Email2</a>
tag formatted properly from css file
<a href="/contact/index.php"> Email2</a>
no format applied
tags applied:
a {
color: #cccccc;
}
a:hover {
color: hotpink;
}
Hope I am doing this right: Here is the fiddle page of all the html and css you will see that the formatting is done on the .html but not on the .php Thank you
中的目标,则css样式无法正常工作答案 0 :(得分:0)
在你的小提琴中,你的CSS结束如下:
.footer a:hover {
color: hotpink;
text-decoration: underline;
}
.footer a:visited {
color: #fff;
}
但是这样,只要您点击该链接一次,a:visited
样式就会始终覆盖a:hover
样式,因为规则的顺序 。 (第二个总是覆盖第一个,如果已经访问过一次)
为避免这种情况,只需转动订单:
.footer a:visited {
color: #fff;
}
.footer a:hover {
color: hotpink;
text-decoration: underline;
}
这是在小提琴中完成的:https://jsfiddle.net/ntfx5xws/1/