• I made my own header using the dimensions of the original banner of the theme I was using, but when I go to my site, it is extended past the actual page width.

    I tried cutting the header, but then it ends up being either too small, or shifts to the left and leaves some white space on the right.

    Have a look at what I mean at https://www.bhangraw.com

Viewing 10 replies - 1 through 10 (of 10 total)
  • use your theme’s style.css to amend this behavior in the head section

    Thread Starter tdot23

    (@tdot23)

    OK, What exactly am I looking out to amend? I have no clue when it come’s to this.

    Thanks

    this bit here

    #header {
    
    	background:url('images/header_bg.jpg') no-repeat top left #efefef;
    
    	width:1005px;
    
    	height:250px;

    make sure url is correct and sizes are what you want

    Thread Starter tdot23

    (@tdot23)

    Yeah, I just started fiddling with that piece of code, and now I have the right side cut about right, but it is still hanging over on the left side.

    Thread Starter tdot23

    (@tdot23)

    bump

    You havn’t closed the header container, or you’ve placed it incorrectly…

    All of your content is sat inside the header container..

    Fix that, then see where you are.

    Thread Starter tdot23

    (@tdot23)

    This is what I;m looking at:

    #allContainer {
    background:url(‘images/body_bg.gif’) repeat-y center #fff;
    width:1005px;
    height:100%;
    margin-left:auto;
    margin-right:auto;
    text-align:left;
    }
    #header {
    background:url(‘images/header_bg.jpg’) no-repeat top left #efefef;
    width:903px;
    height:250px;
    }
    #header #headerContainer {
    display:block;
    height:220px;
    margin-left:102px;
    }
    #header #menuContainer {
    visibility:hidden;
    display:block;
    height:30px;
    margin-left:102px;
    }
    #header #headerContainer #headerLogo {
    display:none;
    }
    #header #headerContainer #titleContent {
    padding:20px 0px 0px 14px;
    }
    #header #headerContainer #titleContent h1, #header #headerContainer #titleContent h1 a {
    display:none;
    color:#fff;
    font-size:50px;
    text-transform:none;
    margin-bottom:-5px;
    }
    #header #headerContainer #titleContent #subHeader {
    color:#fff;

    I changed the width to 903px to fit on the right. It was originally 1005, but like I said it is still hanging over on the left.

    As i said, the problem is with uncorrectly opened/closed elements, that’s not related to the stylesheet.

    See the bottom most errors here.

    Thread Starter tdot23

    (@tdot23)

    Alright, you’ve lost me. Where do I fix the errors then?

    It’s not something that can really be explained in a brief reply…

    Here’s a valid element…
    <div class="example>Some text in the element.</div>

    Here’s an unclosed element..
    <div class="example>Some text in the element.

    Here’s an unopen element..
    Some text in the element.</div>

    Once you have several elements nested inside of each other, it’s hard to keep track and see where exactly you need to add in closing or opening tags. This is why it’s (to me at least) essential that code be formatted correctly, so these kind of problems are easier to narrow down..

    The two files that control your content (for the most part) in terms of layout and structure (not including the CSS) are the header.php and footer.php in your theme, if you combine those 2 files into a temporary file and look over the code, you should be able to see what’s missing..

    Off to bed shortly, so i’ll have to leave it at that for now..

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Making my own header fit in template’ is closed to new replies.