WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
[resolved] layout goes crazy with ie (5 posts)

  1. l736k
    Member
    Posted 1 year ago #

    hi, can someone try to visit my website and tell me why the website shows in a way completely different if visited with ie 6 7 or 8? are there any specific different rules for those browsers i can't find in the css? the website is at this link

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    are there any specific different rules for those browsers i can't find in the css?

    Twentytwelve has IE specific stylesheet ie.css in the css folder.

    ..why the website shows in a way completely different if visited with ie 6 7 or 8?

    Do websites need to look exactly the same in everybrowser ?
    http://dowebsitesneedtolookexactlythesameineverybrowser.com

    For Twentytwelve, it's designed for modern browsers, IE9 up. IE8 will suffer a little but still ok, IE6 and IE7 is a no no.

  3. l736k
    Member
    Posted 1 year ago #

    hi paul...of course i know website doesn't look EXACTLY the same in every browser, but normally they look similar from browser to browser...if you take a look at mine you'll see that it look COMPLETELY DIFFERENT.

    i'll take a look at that folder...would you please suggest me a way to override those css in the child theme?

  4. paulwpxp
    Font hero
    Posted 1 year ago #

    For unknown reason, Twentytwelve use get_template_directory_uri() for the path to ie.css, meaning it doesn't want child theme to override it, so you have to unhook it first and then hook your own.

    here is what I've been used.

    /**
     * remove twentytwelve-ie css must use priority greater than 10
     * then add our special version in childtheme's css folder
     */
    function mytheme_dequeue_styles() {
    	wp_dequeue_style( 'twentytwelve-ie' );
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_styles', 11 );
    
    function mytheme_equeue_styles() {
    	global $wp_styles;
    	wp_enqueue_style( 'mytheme-ie', get_stylesheet_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '1.0' );
    	$wp_styles->add_data( 'mytheme-ie', 'conditional', 'lt IE 9' );
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_equeue_styles', 11 );

    So now, in your child theme's folder, you will have a css folder with a file ie.css in it, then make changes to this file for changes in IEs.

  5. l736k
    Member
    Posted 1 year ago #

    ok...thanks...i start to fight with ie css now...

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic