Jump to content

CSS Gradient in Web Viewer


NickOE

This topic is 3817 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a CSS Gradient in a Web Viewer. It works great on all web browsers except IE10. It will not display if IE10 is installed.

 

Here is the code in the web viewer:

"data:text/html," & 

"<style>body { border: 0; margin: 1; 
background: -webkit-linear-gradient(top,  #16517c 0%,#174a74 100%); 
background: -ms-linear-gradient(top,  #16517c 0%,#174a74 100%); 
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#16517c', endColorstr='#174a74',GradientType=0 ); }
</style>"

If I use the same code in an html page it displays in IE10. I just will not display in the web viewer.

 

Here is the code for an html page:

<html>
<head>
<style>body { border: 0; margin: 1; 
background: -webkit-linear-gradient(top,  #16517c 0%,#174a74 100%); 
background: -ms-linear-gradient(top,  #16517c 0%,#174a74 100%); 
background: linear-gradient(to bottom, #16517c 0%,#174a74 100%); 
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#16517c', endColorstr='#174a74',GradientType=0 ); }</style>
</head>
<body>
</body>
</html>

I would really appreciate any help.

Link to comment
Share on other sites

So why the difference between the web viewer code and the other code?

 

Of course it doesn't display anything. You didn't tell it to display anything.

 

There is no html, head, or body part in your web viewer code.

Link to comment
Share on other sites

To be more explicit, the web viewer code should be:

 

"data:text/html," &

"<html>

<head>
<style>body { border: 0; margin: 1;
background: -webkit-linear-gradient(top, #16517c 0%,#174a74 100%);
background: -ms-linear-gradient(top, #16517c 0%,#174a74 100%);
background: linear-gradient(to bottom, #16517c 0%,#174a74 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#16517c', endColorstr='#174a74',GradientType=0 ); }</style>
</head>
<body>
</body>
</html>"

Link to comment
Share on other sites

  • 6 months later...

In this case...

 

You have applied a style to a html tag called body.

 

You have not actually put a tag called body in the web viewer code. Therefore the style cannot be applied, irrespective of actually writing standards compliant code....

Link to comment
Share on other sites

This topic is 3817 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.