• Hi,
    Trying to align this header image on my page.
    If I put in align=”center” or align=”left” its lining up with the right side of posts on the page.
    And if i put in align=”right” then it lines up with the left side of the posts and only half of the image shows up on the left side of the page.
    I’ve posted the header.php below.
    Any help at all would be really, really appreciated.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head>
      <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    	<title><?php wp_title(':', true, 'right'); ?> <?php bloginfo('name'); ?></title>
    
    <!--[if gte IE 7]><!-->
      <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" charset="utf-8" />
    <!-- <![endif]-->
    
    <!--[if IE 7]>
      <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style_ie.css" type="text/css" media="screen" charset="utf-8" />
    <![endif]-->
    
    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_directory'); ?>/styles_ie6.css" />
    <![endif]-->
    
      <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
      <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
      <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery-1.3.2.min.js" charset="utf-8">
    
      </script>
      <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
      <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
      <?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    
    <div id="siteWrapper">
    
    <img src="https://www.bmxfu.com/images/zine2/coversmall.jpg" border="0" align="center" />
    
      <div id="mainNav">
        <ul>
          <?php wp_list_pages('title_li=&depth=1'); ?>
        </ul>
      </div>
    
        <?php
          if($post->post_parent)
          $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
          else
          $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
          if ($children) { ?>
          <div id="subNav">
          <ul>
          <?php echo $children; ?>
          </ul>
          </div>
          <?php } ?>
    
      <div id="siteDescription">
        <?php  bloginfo('description'); ?>
      </div>
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter sbarker

    (@sbarker)

    I’ve also tried…

    <p align="center">
    <img src="https://www.bmxfu.com/images/zine2/coversmall.jpg" border="0" align="center" />
    </p>

    …but it didn’t change anything.

    as well as putting <div> tags around the image.

    Thanks for the help.

    Post your url so that can see

    Try using a

    <div align="center">
    <img src="https://www.bmxfu.com/images/zine2/coversmall.jpg" border="0" />
    </div>

    try to add a class="aligncenter" to your image tag:

    <img src="https://www.bmxfu.com/images/zine2/coversmall.jpg" border="0" class="aligncenter" />

    most themes have this css class to align images in the posts.

    Thread Starter sbarker

    (@sbarker)

    https://www.bmxfu.com

    I currently have the code you just posted in the file but it’s still the same as before.

    Thread Starter sbarker

    (@sbarker)

    I’ve tried both of those codes and it still is not lined up the way it was before.
    Hmm…

    one of the problems is that the div #siteWrapper is only 500px wide –

    #siteWrapper{
      margin: 0 auto;
      padding-top: 15px;
      width: 500px;
      text-align: center;
      position: relative;
    
    }

    that makes it quite difficult to center a wider image within it.

    Thread Starter sbarker

    (@sbarker)

    Oh, OK, that might be it.
    I tried to find that bit of code but not too sure where you got that from haha.
    Would it fix it if i changed it to say 1000px do you think?

    Thread Starter sbarker

    (@sbarker)

    Ok,
    I found that in the style.css file. Changed it to 900 but now everything is pushed to the left?
    Any other idea?
    Is an iframe something that could work?
    Any help would be incredible.

    Thread Starter sbarker

    (@sbarker)

    I guess I was hoping to be able to post photos and videos larger than 500px but still have everything lined up in the center of the page.
    Is this even possible?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘header image alignment’ is closed to new replies.