• I created a child theme for the twenty-ten theme and customized the header with a png background image. The header looks perfect in Firefox, Chrome, I believe in IE 7 and 8… not 5 and 6 though.

    The background image is in my css code for the header and the logo is in the header.php file.

    I will attach the code for the header.php and the css for the header. I dont know what to do because if I adjust for safari, it messes it up in all the other browsers.

    Any suggestions are appreciated!

    the site is http://www.shopatmuse.com

    Thanks! here is the code….

    [CSS code moderated – the link to your site is fine to access the stylesheet]

    ———————–Header.php ————————–

    [code moderated - please follow the forum guidelines for posting code]

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is very interesting, usually it works in everything but firefox when it comes to images. The reason this (normally is) for future reference is that Safari and Chrome have nearly the same “defaults” in programming. So typically the problem is that fire fox is correct but safari AND chrome don’t match it.

    As with I.E 5 and 6, I’d just leave them alone. As a programmer (and designer) I.E is the bane of my existence as it is to nearly every other programmer/designer out there. As long as it works in I.E 8 and 9 you are fine.

    Lesson over – 🙂 can you repost your code for your CSS the correct way (so the forum will show it) so that I may try and help you fix your problem? What exactly is the problem anyway, by it not displaying correctly that could mean a lot of things starting with a broken image to it not showing up at all or even the positioning is incorrect!

    Give me some more detailed information and I will do my best to help you!
    Thanks
    Megan

    Thread Starter JennWC

    (@jennwc)

    Megan,

    Thank you for your email.

    The problem in Safari is the png background-image I used for my header is hidden behind the banner image (which is supose to be underneath the header and logo). The alignment is all messed up and it is almost as if the banner image is ignoring the placement of the header and just laying on top of it. In Firefox and Chrome it is in the correct position. I will add the css code here. I also added some html to the header.php file. If you want that code to, I will post it.
    Jenn

    ————-header css code ————–

    #branding img {
    clear: both;
    border-top: none;
    display: block;
    border-bottom: none;

    }

    #header {
    background-image:url(‘images/bg-content-top.png’);
    background-repeat: no-repeat;
    background-position: center;
    font:12px/19px Arial, Helvetica, sans-serif;
    color:#7fb000;
    height:150px;

    }

    .directions {
    color:#7fb000;
    font-weight:bold;
    text-decoration:underline;
    padding-top: 20px;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 5px;
    float:both;
    }
    .logo a{
    margin:0;
    width:238px;
    display: block;
    text-align:center;
    position:absolute;
    left:350px;
    z-index:30;

    }

    #site-title a {

    display: block;
    text-align:center;
    position:absolute;
    color:white;
    font-size:1px;
    left:373px;
    right: 373px;
    padding-bottom:20px;
    padding-top:15px;
    }
    #site-description {
    display:none;

    }

    ——–header.php code———-

    <?php

    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;

    wp_title( ‘|’, true, ‘right’ );

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ‘ | ‘ . sprintf( __( ‘Page %s’, ‘twentyten’ ), max( $paged, $page ) );

    ?></title>

    <link rel=”profile” href=”http://gmpg.org/xfn/11&#8243; />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘stylesheet_url’ ); ?>” />
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>” />
    <?php
    /* We add some JavaScript to pages with the comment form
    * to support sites with threaded comments (when in use).
    */
    if ( is_singular() && get_option( ‘thread_comments’ ) )
    wp_enqueue_script( ‘comment-reply’ );

    /* Always have wp_head() just before the closing </head>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to add elements to <head> such
    * as styles, scripts, and meta tags.
    */
    wp_head();
    ?>
    </head>

    <body <?php body_class(); ?>>

    <div id=”wrapper”>
    <div id=”site-title”><img src=”http://www.shopatmuse.com/wp-content/themes/shopatmuse/images/logo.png&#8221; alt=”A Phoenix Boutique Muse Apparel”/></div>

    <div id=”header” class=”hfeed”>

    <div id=”masthead”>

    <div id=”branding” role=”banner”>
    </br></br>
    <div style=”float:left; color:#7fb000; margin-left:40px; margin-top:25px;”><strong style=”color:#7fb000;”>HOURS: MON-FRI: 11:00AM-7:00PM | SAT 11AM-5PM </div><div style=”float:left; color:#7fb000; margin-left:40px; margin-right:40px;”></div><div style=”float:right; color:#7fb000; margin-right:40px; margin-top:25px;”><strong style=”color:#7fb000;”>(602) 749.8880 | 742 E. GLENDALE, PHX <a style=”color:#7fb000;
    font-weight:bold;
    text-decoration:underline;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 5px; ” href=”http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=742+E.+GLENDALE,+PHX&sll=37.0625,-95.677068&sspn=52.152749,109.248047&ie=UTF8&t=h&z=17&#8243; target=”_blank”> DIRECTIONS </div>
    </br>

    <?php $heading_tag = ( is_home() || is_front_page() ) ? ‘h1’ : ‘div’; ?>
    <<?php echo $heading_tag; ?> id=”site-title”>
    <span>
    ” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?>
    </span>

    </<?php echo $heading_tag; ?>>

    <div id=”site-description”><?php bloginfo( ‘description’ ); ?></div>

    <?php
    // Check if this is a post or page, if it has a thumbnail, and if it’s a big one
    if ( is_singular() && current_theme_supports( ‘post-thumbnails’ ) &&
    has_post_thumbnail( $post->ID ) &&
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘post-thumbnail’ ) ) &&
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    // Houston, we have a new header image!
    echo get_the_post_thumbnail( $post->ID );
    elseif ( get_header_image() ) : ?>
    <img src=”<?php header_image(); ?>” width=”<?php echo HEADER_IMAGE_WIDTH; ?>” height=”<?php echo HEADER_IMAGE_HEIGHT; ?>” alt=”” />
    <?php endif; ?>
    </div><!– #branding –>

    <div id=”access” role=”navigation”>
    <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    <div class=”skip-link screen-reader-text”>“><?php _e( ‘Skip to content’, ‘twentyten’ ); ?></div>
    <?php /* Our navigation menu. If one isn’t filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    <?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
    </div><!– #access –>
    <div id=”signup”>
    <div style=” background-color:#e9f0e9; height:25px; width:565px; text-align:right; float:right; border-bottom-left-radius:50px; padding-bottom:5px; padding-top:5px; padding-right:20px; “>
    <img style=”float:left; padding-left:20px; ” src=”http://www.shopatmuse.com/wp-content/themes/shopatmuse/images/musenews.png&#8221; alt=”join” />
    <form action=”http://www.shopatmuse.com/newsletter&#8221; method=”post”>
    <input type=”hidden” name=”na” value=”s”/>
    Your email: <input type=”text” name=”ne”/>
    <input type=”submit” value=”Subscribe now!”/>
    </form>
    </div>
    </div>
    </div><!– #masthead –>
    </div><!– #header –>

    <div id=”main”>

    Alright this is *very* interesting. Hmm, try to put important after your background image, so the code will look like this:

    background-image: url("images/bg-content-top.png") !important;

    and see if that works. By putting !important it tells the browser to over write any other commands for the background it might be getting. This method isn’t always the best but it is great for trouble shooting!

    Megan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Header position not working in Safari, but does in Chrome, Firefox, IE 7 and 8’ is closed to new replies.