Welcome to Dream.In.Code
Getting Help is Easy!

Join 119,059 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,461 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Common Internet Explorer CSS bug fixes

 
Reply to this topicStart new topic

> Common Internet Explorer CSS bug fixes, See the solutions to some of the most common HTML/CSS bugs in Internet

Tripper44
Group Icon



post 24 Jun, 2007 - 04:12 AM
Post #1


Here are solutions to what I have found to be the most common bug fixes for Internet Explorer when designing websites in CSS (Cascading Stylesheets)

The <!--[if IE]> Tag

Problem: Various sizes, margins and padding attributes can display differently in Internet Explorer, this coded snippet can help you sort out these problems.

Add this code with your required settings underneith your pages <style> or external style link:

CODE
<!--[if IE]>
<style>
.item {
margin: 5px;
padding: 10px;
}
</style>
<![EndIf]-->


These setting will now only be loaded when your page is viewed in Internet Explorer. I often use this setting to tweak areas of my layout that do not quite display the same as in other browsers.



Minimum height bug

Problem: When trying to create a DIV tag and the height will not go below about 12px

Simply add the following attribute to the DIV tag

CODE
{line-height: 0px;}


If this dosent work add a <p></p> inside the div and set the line-height for that to 0px;

Your final code should resemble one of the following:

CODE
<div style="line-height: 0px; height: 5px;"></div>


CODE
<div style="height: 5px;"><p style="line-height: 0px;"></p></div>




Margins appear larger in Internet Explorer

Problem: Setting the margin attribute for any CSS element in Internet Explorer it will often appear either double the size or with added width, which can seriously disrupt detailed layouts.

Simply use the {display: inline;} attribute on the tag containing your margin setting.

Your final code should resemble the following:

CODE
<div style="display: inline; margin-left: 5px;"></div>




Centering on the page

Problem: Trying to center elements on the page and using tags like the <div align="center" > or <div style="float: center;" > Do not work!

For Firefox use the following, you will need to setup a layer to house your content and apply the margin settings below to this tag, (I have called mine "container")

CODE
.container {
width: 500px;
margin-left: auto;
margin-right: auto;
}


For Internet Explorer you will need to define a body property to the entire document for text centering (why oh why Bill?)

CODE
html, body {
width: 500px;
text-align: center;
}




CSS Light box Adobe Flash fix

Problem: The CSS Light box script will not appear on top of a Flash movie, this disrupts the actual function of the script.

Add the following setting(s) to the Flash HTML code:

CODE
<param name="wmode" value="transparent"/>


Also add this to the <embed> tag

CODE
wmode="transparent"


Be sure to add both of these settings for this to work properly, your final flash code should look similar to this:

<param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" />
<param name="movie" value=" movie.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />

<embed src=" movie.swf" quality="high" bgcolor="#000000" wmode="transparent" width="232" height="218" name=" movie" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> [/code]
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 10/13/08 03:57PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month