NickOE Posted April 26, 2013 Posted April 26, 2013 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.
bruceR Posted April 27, 2013 Posted April 27, 2013 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.
bruceR Posted April 27, 2013 Posted April 27, 2013 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>"
NickOE Posted November 4, 2013 Author Posted November 4, 2013 The web browser does not care if you have <html>, <head>, or <body> All web browsers will take any text that is given to it and views it as HTML
webko Posted November 4, 2013 Posted November 4, 2013 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....
Recommended Posts
This topic is 4304 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 accountSign in
Already have an account? Sign in here.
Sign In Now