HTML Help Workshop: css gradient vanishes

廉价感情. 提交于 2021-02-10 19:56:56

问题


I attached a page.css (contents below) and .gif files to [Files] section of my help project and added this line into some of the html files:

<body class="grade">
<link rel="stylesheet" href="page.css" type="text/css" />   

Everything works fine, the chm file shows a nice gradient.

A strange thing happens when I switch to a non-gradient page inside the help and then switch back to a gradient site: The gradient is gone but other css attributes are still there.

Does anybody has an idea?

Here my page.css:

body{font-family:Arial, sans-serif;}

#grad {
  background: red; /* For browsers that do not support gradients */
  background: -webkit-linear-gradient(left, red , yellow); /* For Safari 5.1 to 6.0 */
  background: -o-linear-gradient(right, red, yellow); /* For Opera 11.1 to 12.0 */
  background: -moz-linear-gradient(right, red, yellow); /* For Firefox 3.6 to 15 */
  background: linear-gradient(to right, red , yellow); /* Standard syntax */
}

a {text-decoration:none; border:none; outline:none;}
a:hover{color:#FF3F00; text-decoration:none; border:none; outline:none;}
a:visited {text-decoration:none; border:none; color:#FF3F00; outline:none;}
a:visited:hover{color:#0000FF; text-decoration:none; border:none; outline:none;}

h1{font-size:15pt; margin-top:20px;}

h2{font-size:13pt;margin-left:20px; margin-bottom:0px; padding:0px;}

h3{font-size:11pt; margin-left:40px; margin-bottom:0px; margin-top:0px; padding:0px;}


p.text{font-size:11pt; color:#000; margin-left:40px; margin-bottom:0px; margin-top:0px; padding:0px;}
/*p.textimg{font-size:10pt; color:#000; margin-left:100px; margin-top:0px;}*/

div#page{width:95%; margin:auto;}

.grade {background-image:url(images/blue3.gif); background-repeat: repeat-y;}

ul {list-style:disc;}
li {font-size:11pt;}
br {clear:left}

回答1:


Add the following statement to the section of all your HTML files. This works if the HTML topic files are encapsulated in a .chm help file.

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

e.g.:

<!DOCTYPE html>

<html>
<head>
  <title>Gradient used</title>
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11">
  <link rel="stylesheet" href="page.css" type="text/css">
</head>

<body id="grad">

  <p>This is a test.</p>

  <p>And a second line.</p>

</body>
</html>



来源:https://stackoverflow.com/questions/45691569/html-help-workshop-css-gradient-vanishes

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