stylesheet fo IE8 |
stylesheet fo IE8 |
qim |
Jun 2 2013, 09:02 AM
Post
#1
|
Member Group: Members Posts: 67 Joined: 9-April 13 Member No.: 18,982 |
Hi
I need a sylesheet for IE8. My problem is that I need adjustments both to the original css, but also to the html. So, I thought to join the two new amended files together and the new one works if I enter it directly as an url. However, it does not work when I tried to insert CODE <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="/indonesiaIE8.html" /> <![endif]--> it did not work. So I changed the file type to .css but it still does not work. is it because I cannot call a file css if it is basicallu html with the total of a css file inbedde between <style> tags? In fact, what I have at the moment is CODE <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- to resolve clock problem --> <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="/indonesiaIE8.css" /> <![endif]--> and maybe I cannot have two conditionals like this separate? qim This post has been edited by qim: Jun 2 2013, 09:16 AM |
Christian J |
Jun 2 2013, 10:20 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I need adjustments both to the original css, but also to the html. You can put HTML code inside a conditional comment: CODE <!--[if lt IE 9]> <p>This is for IE8 or older</p> <![endif]--> But if you want to embed the HTML from an external file, you should use server-side includes, like PHP or SSI. However this doesn't work: QUOTE CODE <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="/indonesiaIE8.html" /> <![endif]--> ...since you can't embed an HTML file like that. QUOTE So I changed the file type to .css but it still does not work. is it because I cannot call a file css if it is basicallu html Yes, you can't put any HTML inside a CSS file. QUOTE In fact, what I have at the moment is CODE <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- to resolve clock problem --> <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="/indonesiaIE8.css" /> <![endif]--> and maybe I cannot have two conditionals like this separate? That part seems correct, at least if you put it in the page's HEAD section. |
qim |
Jun 2 2013, 10:35 AM
Post
#3
|
Member Group: Members Posts: 67 Joined: 9-April 13 Member No.: 18,982 |
Hi Christian Thank you, but I'm afraid I'm totally confused! Let me add a bit more information. I have a html page (with the relevant css) that works fine execept for widgte in IE8. The code for the widget is based on <object>. I managed to get help and got alternative code for the widget based on <iframe> which works for everything, but distorts slightly some of th3e styling. In any case, as part of the learning curve I would like to see how an externak stylesheet works and wheter I could use to solve this problem. I would keep what i have and create TWO new files: a css with the amendements for <iframe>; and another html with the <iframne> widget Now, assuming that I canĀ“t use a html file with embedded css, nor the opposite I am at a loss on how to proceed. from your post I wonder if in the main html I can put BOTH <object> and <iframe> with a condition just before the <iframe> diverting to a different css. Sorry, if my terminology is not very clear! qim |
Christian J |
Jun 2 2013, 10:41 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
from your post I wonder if in the main html I can put BOTH <object> and <iframe> with a condition just before the <iframe> Sure. Just use CODE <!--[if lt IE 9]> <iframe src="ie8.html">(You may want to put a link to the framed page here, in case the user has disabled iframes.)</iframe> <![endif]--> Not sure if you can put an IFRAME inside an OBJECT element, though. An alternative is to show the OBJECT to all except IE8 (this requires a special version of Conditional comments). QUOTE diverting to a different css. Not sure I understood that. |
qim |
Jun 2 2013, 11:11 AM
Post
#5
|
Member Group: Members Posts: 67 Joined: 9-April 13 Member No.: 18,982 |
PLease, forgive my ignorance but could I put the
CODE <!--[if lt IE 9]> <iframe src="ie8.html">(You may want to put a link to the framed page here, in case the user has disabled iframes.)</iframe> <![endif]--> inside the <body> of the html just before the <object>? or would it work (I can't see how) if it is place in the <head>? The current page is at www.pintotours.net/Asia/Indonesia/indonesia.html I joined the amended css and html into one file which works with IE8. That's the file I wanted to use as na external file http://pintotours.net/Asia/Indonesia/indonesiaIE8.html This post has been edited by qim: Jun 2 2013, 11:20 AM |
Christian J |
Jun 2 2013, 11:29 AM
Post
#6
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
PLease, forgive my ignorance but could I put the CODE <!--[if lt IE 9]> <iframe src="ie8.html">(You may want to put a link to the framed page here, in case the user has disabled iframes.)</iframe> <![endif]--> inside the <body> of the html just before the <object>? Sure. (At least assuming that the OBJECT element doesn't confuse IE8 in some way, I'm not experienced with that.) QUOTE or would it work (I can't see how) if it is place in the <head>? No, IFRAMEs must be in BODY. |
qim |
Jun 2 2013, 11:44 AM
Post
#7
|
Member Group: Members Posts: 67 Joined: 9-April 13 Member No.: 18,982 |
Sorry to go on but if I were to insert the html file dedicated to the IE8 below as ie8.html where would I make reference to the css. Unfortunately, the 3ay things are at the moment, inorder to use <iframes> I must also have a different css code.
CODE <!--[if lt IE 9]> <iframe src="ie8.html">(You may want to put a link to the framed page here, in case the user has disabled iframes.)</iframe> <![endif]--> Could I out something like this in thew <body>? I don't know what the code for "else" is CODE <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="indonesiaIE8.css" /> <iframe src="http://www.?t=n&embed=1&text=15&textdate=15&format=24&digitalclock=36&analogclock=60&letter_spacing=-2&bordersize=0&bgcolor=ffffdb&colorloc=000000&colordigital=2C8EBF&colordate=000000&styleloc=normal&styledigital=normal&styledate=normal&right=0"> </iframe> <![endif]--> <else> <object type="text/html" data="http://www.?t=n&embed=1&text=15&textdate=15&format=24&digitalclock=36&analogclock=60&letter_spacing=-2&bordersize=0&bgcolor=ffffdb&colorloc=000000&colordigital=2C8EBF&colordate=000000&styleloc=normal&styledigital=normal&styledate=normal&right=0"> </object> This post has been edited by qim: Jun 2 2013, 12:36 PM |
qim |
Jun 2 2013, 12:26 PM
Post
#8
|
Member Group: Members Posts: 67 Joined: 9-April 13 Member No.: 18,982 |
Hi
Thank you very much I've managed to get it working. Many thanks! RESOLVED |
Christian J |
Jun 2 2013, 03:47 PM
Post
#9
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I'll answer this in case someone else has the same problem...
Sorry to go on but if I were to insert the html file dedicated to the IE8 below as ie8.html where would I make reference to the css. The CSS for the IFRAME element would go into the parent page's HEAD section. The CSS for the framed page would go into the framed page's HEAD section. QUOTE Could I out something like this in thew <body>? I don't know what the code for "else" is CODE <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="indonesiaIE8.css" /> <iframe src="..."> </iframe> <![endif]--> <else> <object type="text/html" data="..."> </object> AFAIK there is no ELSE syntax for Conditonal HTML Comments (there is for the javascript/Jscript variety, though, see http://en.wikipedia.org/wiki/Conditional_comments ). Instead you can combine two blocks like this: CODE <!--[if lt IE 9]> For IE8 and older <![endif]--> <!--[if gt IE 8]><!--> For IE 9 and newer, and all non-IE browsers. <!--<![endif]--> Note how the second block is visible to non-IE browsers as well --even though they don't understand Conditional Comments-- due to the combination with traditional HTML comments. |
Lo-Fi Version | Time is now: 23rd April 2024 - 05:37 PM |