2

I have designed a webpage for my project which looks fine in firefox and chrome when i look into internet explorer the image position and table position everything wasn't aligned properly. Even i tried to import reset.css file(eric's recent version).This gives improper alignment tables of all the pages.

Is it good to load the css based on user agent?

   if ie:
      <link ....</link>
   else:
      <link>...</link>

How it is supposed to do?

Also, How to adjust the layout which should be adoptable across all resolution screen?

My page is looks fine when i do in 12-15 inch resolution screens.Some wider screens it doesn't look good.

How it is supposed to be handled it?

Thanks in advance.

4
  • The table issues can usually be fixed with display. What versions of ie are you going to support? Commented Aug 6, 2012 at 4:45
  • @pKs site is not opening ,you should remove the comma at the end Commented Aug 6, 2012 at 5:10
  • 1
    @prash sass-lang.com check it. Its like LESS library. Commented Aug 6, 2012 at 5:15
  • 1
    @saravanan: See my answer given below. Thanks Commented Aug 6, 2012 at 5:49

3 Answers 3

4
<!--[if IE 8]>
        <link rel="stylesheet" href="css/ie8.css"/>

<![endif]-->    

stylesheet for ie

you can adjust the layout using media queries,what ever the resolution you can choose

something like

@media all and (min-width:500px) { … }
@media (min-width:500px) { … }

media queries

Sign up to request clarification or add additional context in comments.

Comments

2

Your can use conditional comment for IE browsers. Write like this:

<!--[if IE 8]>
  <link rel="stylesheet" href="ie8.css"/>
Special instructions for IE 8 here
<![endif]-->

Read this for more http://www.quirksmode.org/css/condcom.html

Comments

0

By using CSS Conditional Comments you may target your browsers.

By Adding following lines in your <HTML> page you may define browser specific style-sheets or java-script files.

For IE Browsers

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

For Non-IE Browsers

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

By using Media Queries you may create a responsive website's layout by targeting desired screen resolutions.

@media screen and (max-width: 699px) and (min-width: 320px) {
   div { background: blue; width: 100px; height: 100px; }
}


@media screen and (max-width: 1024px) and (min-width: 700px) {
   div { background: green; width: 300px; height: 100px;  }
}


@media screen and (max-width: 1280px) and (min-width: 1025px) {
   div { background: red; width: 600px; height: 100px;  }
}​

EXAMPLE FIDDLE

You may learn in details that How to use Media Queries

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.