Fix Margins in IE6 with jQuery
87
post-template-default,single,single-post,postid-87,single-format-standard,bridge-core-3.0.1,qodef-qi--touch,qi-addons-for-elementor-1.5.3,qode-page-transition-enabled,ajax_updown,page_not_loaded,,vertical_menu_enabled,no_animation_on_touch,side_area_uncovered_from_content,qode-theme-ver-28.7,qode-theme-bridge,disabled_footer_top,qode_header_in_grid,wpb-js-composer js-comp-ver-6.8.0,vc_responsive,elementor-default,elementor-kit-6

Fix Margins in IE6 with jQuery

Fix Margins in IE6 with jQuery

IE6’s well known margin problems can be solved many ways, such as using CSS that only IE6 will read.

I like to use CSS and jQuery as follows:

CSS:

#wrapper
 {
  margin: 0 auto;
  width: 800px;
  ...
 }
 .wrapperie6
 {
  width: 810px !important; /* compensate for IE6 */
 }

and the jQuery code:

$(document).ready(function() {
  if($.browser.version == '6.0'){
  // alert('you are using ie6');
  $('#wrapper').addClass('wrapperie6');
  }

It’s rude and crude, but it does the job.



Mastodon