Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4331900
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:10:46+00:00 2026-05-21T10:10:46+00:00

I need a concrete if statement that will work in an .aspx file (default.aspx)

  • 0

I need a concrete if statement that will work in an .aspx file (default.aspx) that I am building, the file itself serves as my homepage. I have not moved onto further pages. I currently catering for IE8 + 7, FireFox and Chrome.

I seem to be noticing issues in layouts even though in my markup I have this:

<!-- <link rel="stylesheet" type="text/css" href="css/homepageStyes.css" /> -->

<!--[if gt IE 6]>
    <link rel="stylesheet" type="text/css" href="css/ie.css" />
<![endif]-->

Whenever I comment out either line of code, my layout problems go away but at the moment I reckon the mark up posted above is not concrete enough in telling a browser which style sheet it is to attach?

I need something along the lines of but in XHTML mark up ofc:

if (browser == "ie" || browser != "ie6") // not supporting ie6
{
   // attach this style sheet:
   // <link rel="stylesheet" type="text/css" href="css/ie.css" /> 
}
else
{
   // attach this style sheet:
   // <link rel="stylesheet" type="text/css" href="css/homepageStyes.css" />
}

I’m a C# developer so this is my first time building a website from scratch. So the C# if statement above was a good way of explaining what I need.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:10:47+00:00Added an answer on May 21, 2026 at 10:10 am

    Use these conditional comments:

    <!--[if gt IE 6]>
    <link rel="stylesheet" type="text/css" href="css/ie.css" /> 
    <![endif]-->
    <!--[if !IE]><!-->
    <link rel="stylesheet" type="text/css" href="css/homepageStyles.css" />
    <!--><![endif]-->
    

    The <!--[if gt IE 6]> comment ensures only IEs newer than version 6 will process and link to ie.css.

    The <!--[if !IE]> tells IE to ignore what’s in that conditional comment. The <!--> that directly follows is to terminate the if !IE component while maintaining a valid document. Anything past that will be read by other browsers and parsed, so homepageStyles.css will be linked to.

    The second <!--> opens a comment so that IE can safely read the <![endif]--> that directly follows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need a function that takes a character as a parameter and returns true if
Need to an expression that returns only things with an I followed by either
need ask you about some help. I have web app running in Net 2.0.
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
I wanted to avoid the switch statement. I have over 30 document types. There
I'm generating an interface to concrete implementation copier. A later step will be to
I know that I need prepared statements because I make more than one call
I have been under the assumption for a while that viewDidUnload is always called
I have a client application that should be able to handle the following: 1)
I have the need to take the results of a query per line item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.