Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Including Stylesheet for IE and Mozilla

    I'm trying to include a different stylesheet for IE this is the code I am using and I can't get it to work. See anything wrong?
    Code:
      <head>
        <style type="text/css">
        v\:* {
          behavior:url(#default#VML);
        }
        </style>
        <title>Google Maps</title>
        
        <script src="http://maps.google.com/maps?file=api&amp;=1&amp;key=ABQIAAAAKXvRBd66nY0-PyM9iS6B2hRRxf_3yw7NSNUPgwpBXBN_-FkizBQ9RT5XLq8NC40jvcgfVDmS-78PkQ" type="text/javascript"></script>
     	<link href="http://west4me.com/mapping/styles.css" rel="stylesheet" type="text/css">
    	<!--[if IE]>
    	<link rel="stylesheet" type="text/css" href="http://west4me.com/mapping/iestyles.css" />
    	<![endif]-->	
         
    </head>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This part might be messing things up.
    Code:
        <style type="text/css">
        v\:* {
          behavior:url(#default#VML);
        }
        </style>
    Could you not just move the part in between the styles into the IE styles since IE is the only browser that supports behaviors? Other than that it looks fine. You may want to do something like lte IE6 rather than just IE. Can you post a link to your site? I also get a 404 error not found when I try navigating to your CSS files in your code.
    Last edited by _Aerospace_Eng_; 11-23-2005 at 12:57 AM.

  • #3
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You were right about the file name. I fixed it moved the behavior and changed it to IE6.
    No luck.

    here is my site:
    http://www.west4me.com/mapping/lc2.htm

    Any other suggestions.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    In your #header for your IE styles you have an extra ; and why are you repeating the same styles? I could understand if the styles were different but I compared your stylesheets and most of them are the same. Have you followed the advice I've given you in the other thread? It looks fine in IE. Try validating your page http://validator.w3.org
    Last edited by _Aerospace_Eng_; 11-23-2005 at 02:20 AM.

  • #5
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The styles are pretty much word for word. I was just trying to get it to work before I made any changes. I haven't tried what you said in the other thread. I'm pretty much new to css and have been just hacking my way through it. I
    fixed the #header one, accidently left the ; in there when I deleted the url to test if it was importing the correct stylsheet.

  • #6
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I had validated it before. I made the assumptions that those errors were from elements that would not affect the layout. Am I wrong? I am also a little confused it says:
    Code:
    Error  Line 8 column 88: end tag for "link" omitted, but OMITTAG NO was specified.
    
    ...ss" rel="stylesheet" type="text/css">
    This is what I have:
    <link href="http://west4me.com/mapping/styles.css" rel="stylesheet" type="text/css">
    Could someone explain this to me?

  • #7
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <link rel="stylesheet" type="text/css" href="http://west4me.com/mapping/styles.css" />

    That should work, I didn't check your doctype though.

  • #8
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks that helped with the validation issues of the html.
    Still haven't figured out how to import the IE stylesheet.

  • #9
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Figured it out.
    I had to use this:
    Code:
    <!--
    var n=navigator.appName
    var ns=(n=="Netscape")
    var ie=(n=="Microsoft Internet Explorer")
    if (ie){
    document.write('<link rel="stylesheet" type="text/css" href="iestyle.css">')
    }
    if (ns){
    document.write('<link rel="stylesheet" type="text/css" href="styles.css">')
    }
    //-->
    Thanks for the help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •