The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> stylesheet fo IE8
qim
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 2 2013, 10:20 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(qim @ Jun 2 2013, 04:02 PM) *

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.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
qim
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 2 2013, 10:41 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(qim @ Jun 2 2013, 05:35 PM) *

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. unsure.gif 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. unsure.gif
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
qim
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 2 2013, 11:29 AM
Post #6


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(qim @ Jun 2 2013, 06:11 PM) *

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.

User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
qim
post 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&amp;embed=1&amp;text=15&amp;textdate=15&amp;format=24&amp;digitalclock=36&amp;analogclock=60&amp;letter_spacing=-2&amp;bordersize=0&amp;bgcolor=ffffdb&amp;colorloc=000000&amp;colordigital=2C8EBF&amp;colordate=000000&amp;styleloc=normal&amp;styledigital=normal&amp;styledate=normal&amp;right=0">
</iframe>

<![endif]-->

<else>

<object type="text/html" data="http://www.?t=n&amp;embed=1&amp;text=15&amp;textdate=15&amp;format=24&amp;digitalclock=36&amp;analogclock=60&amp;letter_spacing=-2&amp;bordersize=0&amp;bgcolor=ffffdb&amp;colorloc=000000&amp;colordigital=2C8EBF&amp;colordate=000000&amp;styleloc=normal&amp;styledigital=normal&amp;styledate=normal&amp;right=0">
</object>


This post has been edited by qim: Jun 2 2013, 12:36 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
qim
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post 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...

QUOTE(qim @ Jun 2 2013, 06:44 PM) *

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.


User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 05:37 PM