Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Thread Type: Sticky Thread
Total posts in this thread: 10
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5773 times and has 9 replies Next Thread
Female MzTooMuch
Stranger
Member's Avatar

USA
Joined: Mar 19, 2006
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
confused Need help with conditional comments for IE!!!

I am an extreme beginner. I am having such trouble with getting my website to render correctly in IE. I have read a little about css conditional comments for IE, but I have no idea how to code that... can anyone help me with this?

[Mar 20, 2006 8:14:22 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    MsMuch2Much [Link] Report threatening or abusive post: please login first  Go to top 
Male billyboy
Advanced Member
Member's Avatar


Joined: Sep 3, 2005
Post Count: 2206
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

Just wrap the comment tags around whatever code you want to be specific to IE. Write your code as you normally would, then if an element needs certain values different for IE write it again with the conditional comment tags. Conditional comments come after your other code.

For example, mydiv has a top margin of 5 px, but in IE you want the top margin to be 10px, it would look like this:
<style>
(any other CSS)
mydiv {
margin-top: 5px;
(more CSS)
}
</style>
<!--[if IE]>
<style>
mydiv {
margin-top: 10px;
}
</style>
<![endif]-->

Or if you were using a seperate style sheet create a second one for IE writing your CSS as usual. Only include what needs redefining, you don't need to rewrite your entire CSS. Then add a link to it in the head of of your document like this:

<link rel="stylesheet" type="text/css" href="mysite/styles.css">
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="mysite/styles_ie.css">
<![endif]-->

If it is only one element on a page that needs redefining you can combine the two rather than adding a seperate style sheet:
<link rel="stylesheet" type="text/css" href="mysite/styles.css">
<!--[if IE]>
<style>
mydiv {
margin-top: 10px;
}
</style>
<![endif]-->

Conditional comments can also be used to target specific versions of IE. For example instead of writing <!--[if IE]> writing <!--[if IE5]> would only target IE version 5.
----------------------------------------
Quiquid latine dictum sit altum viditur
----------------------------------------
[Edit 1 times, last edit by billyboy at Mar 20, 2006 12:24:22 PM]
[Mar 20, 2006 11:48:24 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

Good reply
[Mar 20, 2006 11:57:22 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Female MzTooMuch
Stranger
Member's Avatar

USA
Joined: Mar 19, 2006
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

blushing

Thank you so much for your help. I will make the changes and update you later.
[Mar 20, 2006 2:26:02 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    MsMuch2Much [Link] Report threatening or abusive post: please login first  Go to top 
Male shelfimage
Advanced Member
Member's Avatar

USA
Joined: Mar 24, 2005
Post Count: 3000
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

Yep good info. Keep in mind that the conditional statement has to be written with spaces in between each declaration.

If IE 5

and

If lte IE 6

vs If IE6

wink
----------------------------------------
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
Save the developers<!>
Maine Webworks
[Mar 21, 2006 11:11:43 PM] Show Printable Version of Post    View Member Profile    Send Private Message    mainewebworks    mainewebworks [Link] Report threatening or abusive post: please login first  Go to top 
Female MzTooMuch
Stranger
Member's Avatar

USA
Joined: Mar 19, 2006
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
smile Re: Need help with conditional comments for IE!!!

Thanks so much Billy and John for your input. I did make the changes that you suggested and everything worked out just find.

I did want to ask if there was also a way to make conditional comments for Opera. confused The home page of the website is not rendering correctly in this browser.

Here is the site:

http://www.freewebs.com/kiara4life2/index.html confused How do I get this link to appear as a link in this post??????

If you want to see the css for it, you can find it in my other post:

Help Extreme Beginner!......

confused Also the only other problem with the site is that IE keeps applying the attributes that were set for p:first letter, even though the attributes were redefined in for p.copyrighthome:first-letter, can either one of you help me with this?


Thanks so much!
----------------------------------------
[Edit 8 times, last edit by MzTooMuch at Mar 22, 2006 9:18:43 AM]
[Mar 22, 2006 8:08:37 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    MsMuch2Much [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

At least IE7 seems to do well without Conditional Comments... bummer we have to keep them for IE6 for quite some time still...
[Mar 22, 2006 10:04:42 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Female MzTooMuch
Stranger
Member's Avatar

USA
Joined: Mar 19, 2006
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
sad Re: Need help with conditional comments for IE!!!

Hey Kyle,


I know that is a bummer. Hey can you tell me if I can set conditional statements for Opera?

And how can I make my links appears as hyperlinks in my posts????
[Mar 22, 2006 11:49:19 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    MsMuch2Much [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

Conditional Comments are IE only and are not standard HTML, Opera generally does things standards way so they are not needed.

However if you look at IE in Opera my banner text is offscreen above which no other browser does. Have not had time to fix it yet.

Your links will be activated when you post a certai number of posts, it is to help stop hit and run spammers we were getting alot of.
[Mar 22, 2006 12:10:39 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male admin
Advanced Member
Member's Avatar


Joined: Jun 14, 2003
Post Count: 2940
Status: Offline
Reply to this Post  Reply with Quote 
Re: Need help with conditional comments for IE!!!

With so much talk about IE conditional comments, I decided to create a video tutorial on it.

IE conditional comments video tutorial

Let me know what you all think.

Thanks,

Stefan
----------------------------------------
Stefan Mischook

Video Tutorial Store | Web Templates
[Mar 22, 2006 5:19:33 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread