How does Internet Explorer 8 support the CSS outline attribute?

the website says it supports, however the following style is not displayed.


    <style type="text/css">
        a[href="#"]{outline:#f00 dotted 2px !important}
    </style>

however, the following will display


    <style type="text/css">
        a[href="#"]{border:#f00 dotted 2px !important}
    </style>

Here is my document


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>...</title>
   <link type="text/css" rel="stylesheet" href="../content/style.css" />

</head>
<body>...</body>
</html>
+3
source share
2 answers

Check if IE8 is running in compatibility mode. If the header has something like the following: the outline will not work:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >

IE8 will also use the default quirks mode if your doctype tag is incorrect, so also check this. Also, if you are using IIS, it is possible that the server is setting IE7 compatibility mode.

+8
source

Perhaps because the link does not appear in the browser as #, but asyourpage.html#

- :

<style type="text/css">
    a[href$="#"]{outline:#f00 dotted 2px !important}
</style>
+2

Source: https://habr.com/ru/post/1719620/


All Articles