Custom Internet Explorer Stylesheet

My webpage (specifically a game) is behaving differently on Internet Explorer compared to other browsers, despite my efforts to fix it through online searches.

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

I then attempted to resolve the issue by adding

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

However, the problem persisted. Could this be a coding error?

Answer №2

For more in-depth information, click here.

Targeting ALL VERSIONS of Internet Explorer

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

Excluding Internet Explorer from the styling

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

Exclusive to Internet Explorer 7

<!--[if IE 7]>

<link rel="stylesheet" type="text/css" href="ie7.css">
<![endif]-->

Exclusive to Internet Explorer 6

<!--[if IE 6]>

<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->

Exclusive to Internet Explorer 5

<!--[if IE 5]>

<link rel="stylesheet" type="text/css" href="ie5.css" />
<![endif]-->

Exclusive to Internet Explorer 5.5

<!--[if IE 5.5000]>

<link rel="stylesheet" type="text/css" href="ie55.css" />
<![endif]-->

Exclusive to Internet Explorer 6 and lower versions

<!--[if lt IE 7]>

<link rel="stylesheet" type="text/css" href="ie6-and-down.css" />
<![endif]-->

<!--[if lte IE 6]>

<link rel="stylesheet" type="text/css" href="ie6-and-down.css" />
<![endif]-->

Exclusive to Internet Explorer 7 and lower versions

<!--[if lt IE 8]>

<link rel="stylesheet" type="text/css" href="ie7-and-down.css" />
<![endif]-->
<!--[if lte IE 7]>

<link rel="stylesheet" type="text/css" href="ie7-and-down.css" />
<![endif]-->

Exclusive to Internet Explorer 8 and lower versions

<!--[if lt IE 9]>

<link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->
<!--[if lte IE 8]>

<link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->

Exclusive to Internet Explorer 6 and higher versions

<!--[if gt IE 5.5]>

<link rel="stylesheet" type="text/css" href="ie6-and-up.css" />
<![endif]-->
<!--[if gte IE 6]>

<link rel="stylesheet" type="text/css" href="ie6-and-up.css" />
<![endif]-->

Exclusive to Internet Explorer 7 and higher versions

<!--[if gt IE 6]>

<link rel="stylesheet" type="text/css" href="ie7-and-up.css" />
<![endif]-->
<!--[if gte IE 7]>

<link rel="stylesheet" type="text/css" href="ie7-and-up.css" />
<![endif]-->

Exclusive to Internet Explorer 8 and higher versions

<!--[if gt IE 7]>

<link rel="stylesheet" type="text/css" href="ie8-and-up.css" />
<![endif]-->
<!--[if gte IE 8]>

<link rel="stylesheet" type="text/css" href="ie8-and-up.css" />
<![endif]-->

Answer №3

Depending on the version of Internet Explorer, conditional comments may no longer be supported. For a similar question, check out this answer:

Why doesn't Internet Explorer 11 respect conditional comments even when emulating Internet Explorer 8 document mode?

I personally use Modernizr for feature detection:

Modernizr.load({
            test: Modernizr.canvas,
            nope: ['Content/Site-ie-8.min.css', 'Content/font-awesome-ie7.min.css']

        });

For more information about Modernizr, visit

Answer №4

Experiment with using a lt symbol like this

[if lt IE 10 ]

Internet Explorer version 10 and newer operates similarly to other web browsers.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Vue.js V-for not rendering any content

I am currently working on populating an array with objects retrieved from an API. The objects are being fetched successfully, but I am facing issues when trying to display them using v-for in the array. Below are my data variables: data() { return { ...

What is the best method for eliminating the border of an Angular mat-form-field when it is in a disabled state?

I've been attempting to eliminate borders from a mat-form-field when the field is disabled, but despite trying various solutions found online, I haven't been successful in removing the borders from the div. Below is the code snippet: <div ...

Issue with floating the navbar to the right in Bootstrap 4

I am trying to reposition the navbar (without logo) to the right side using code. To achieve this, I included the class "float-right" like so <div class="collapse navbar-collapse float-right" id="navbarSupportedContent">. However, this modification ...

What is the reason for the return of undefined with getElementsByClassName() in puppeteer?

Currently, I am utilizing puppeteer to fetch certain elements from a webpage, specifically class items (divs). Although I understand that getElementsByClassName returns a list that needs to be looped through, the function always returns undefined for me, e ...

Breaking apart images with HTML5 canvas

I am currently working on creating a sliding puzzle piece game. By utilizing the canvas element, I successfully divided the image into multiple pieces. To shuffle these pieces, I stored their coordinates in an array, randomized the coordinates, and then up ...

How can I style an image in CSS to have a set height, maximum width, and keep its aspect ratio fixed?

I am trying to place a set of images with varying heights and widths inside a div tag. My goal is to have the images maintain a fixed height, unless the width surpasses a certain limit, in which case I want the height to adjust while preserving the aspect ...

choose a CSS class within a div element's class name

Hey there, I'm dealing with two HTML divs that both have the same price class of "uvp uvp-price". <div class="product-detail-price-container"> <meta itemprop="price" content="119.8"> ...

Ways to showcase a website within an HTML document using a URL?

Is it possible to show 2 webpages on a single aspx webpage? For instance, When a user opens the link for www.mywebsite.com, I would like to display both www.google.com and www.bing.com on my homepage. Behind the scenes, I will call two separate URLs an ...

Leverage variables in JavaScript to establish a unique style

function AdjustScale(){ scaleX = window.innerWidth / 1024; scaleY = window.innerHeight / 768; element = document.getElementById("IFM"); element.style.transform = "scale(" + scaleX + ", " + scaleY + ")"; } I'm facing an issue with thi ...

Images on a webpage can cause the height of a div element to remain

I've encountered a problem with displaying 5 images horizontally on the screen. For some reason, I'm unable to set the height of the Div "block-before-description". In FireBug, the height appears as 0 while the 20px margin is visible. Despite try ...

Stopping a parent's event from firing when clicking on child elements without interfering with the child element events

Having read several posts such as this one, I am exploring a method to click on the parent div for it to hide, without hiding when clicking on either the search box or the 'click for event 2' text. I have tried using onclick stop propagation to ...

"Every time the $_POST array is accessed, it consistently contains 48 to

In my PHP file, I am querying a database to retrieve a list of items and then generating an HTML table to display those items. Each table cell contains input elements within a form <form> <table> ... <td> & ...

Retrieve the placeholder from the available resources using HTML elements

I have a simple string in my resource file "Good Day,Sir <br /> Have a nice day.". This string needs to be a placeholder on a TextArea. However, the HTML tags are not rendering properly. I've tried using Html.Raw but it doesn't seem to work ...

CSS styling on top points gets lost when scrolling

My screen displays an image with bubbles scattered randomly, each positioned using CSS styles for top and left. Strangely, when I scroll, all the bubbles lose their top style and reposition themselves to the bottom of the image. If anyone has insight into ...

CSS: A square-circle loading spinner design

Looking for assistance in creating a spinner using only CSS that resembles the image provided, with only one section of the spinner colored at a time. In this code snippet, there is a similar spinner but I need to rotate the entire spinner by 22.5° and m ...

What steps can I take to correct the footer positioning to appear below the sidebar?

I'm currently struggling with the placement of my sidebar on top of my footer, which is not where it belongs. I would like to move it to the bottom. Take a look at this image for a visual representation of what I'm aiming for. footer { paddi ...

How can AJAX be utilized with both file and text inputs?

I have a basic form enclosed in a modal window, dynamically generated using jQuery: <form name="altEditor-form" id="altEditor-form" enctype="multipart/form-data" role="form"> <div class="form-group"> <div class="col-sm-5 col-md- ...

CSS: Set the left position to 250px with the added feature of hiding any overflow

I am currently working on a sidebar that can be shown or hidden using JavaScript with CSS animations. To achieve this effect, I need to position the content div (#main) using left: 250px;. #main { left: 250px; position: relative; overflow: hidden; } ...

What is causing my button to act in this way?

Initially, the website redirects to an undefined URL and then to test.com. I am looking for a way to implement a redirection sequence from to and finally to <head> <script type="text/javascript"> <!-- function popup(url ...

Troubleshooting issue with Bootstrap's responsive scrollspy functionality

I am experiencing an issue with the responsiveness of my page. When I reduce the width of the page to half, the scrollspy disappears unexpectedly. I am unsure about the root cause of this problem. If you run the code I have shared here, you can observe th ...