i tried 2 create one web page....it is good in mozilla....bad 2 view in I.E7...plz give me suggestions

thnkyou in advance

Dani AI

Generated

Good start, — this is a classic IE-versus-standards issue. is right that an IE-specific stylesheet lets you keep clean main CSS and override only the problem rules. is also right that floats are a reliable fallback, but you can often preserve inline alignment without reworking the whole layout.

First checks: make sure your page uses a standards DOCTYPE (for example <!DOCTYPE html>) so IE does not drop into quirks mode. Validate your HTML/CSS and test with IE developer tools (or the IE Developer Toolbar) to inspect computed sizes and floats.

If you want inline-block behavior but need to support older IE, try this pattern (standard rule first, then a small fallback for old IE):

.myBox {
  display: inline-block;
  vertical-align: top;
}

/* fallback for IE6/7: trigger hasLayout so element behaves like inline-block */
.myBox {
  zoom: 1;
  *display: inline;
}

If that feels fragile, use a separate IE stylesheet (as suggested) and set display:inline; zoom:1; on the offending selectors there, or switch to floating elements with cleared containers where appropriate. For background on display behavior and browser support see the MDN docs: display.

Recommended Answers

All 2 Replies

in my opinion, IE browsers are the worse browsers around. They have cause problems for web developers and should be taken off the face of the planet.
That being said, you can create a a separate css file for IE and include this in the <head> tag of your page:

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

what it does is if the user is using IE to view your website, it'll use the ie.css stylesheet instead of your main stylesheet.

Hi!
I have replied to your same same issue earlier that IE doen't support displaydisplay:inline-block, insteed of that use float property that will solve your issue.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.