Help with positioning a banner.

1 replies
  • WEB DESIGN
  • |
Hi , the issue is that I write the following code:



<div id="masthead">
<center>
<img src="http://sitename.com/picturename.png">
</ center>



And then the picture itself ( enclosed with blue frames) appears under the "Box Menu"- CLICK

And I want to be at the top of the site is still in the middle.

Also can someone tell me how can generally put a banner / picture in which corner is the site.

I mean for example I want to put a banner / picture in the top left corner or right corner or somewhere else.

This is very important for me to know please help me which is more forward with things.
#affiliate #banner #positioning #sites #wordpress
  • Profile picture of the author Nathan K
    Its kind of difficult to explain without seeing the HTML but there are couple of ways you can do this.
    You can edit the html file and put the <div> on top of everything and align it using css (without using the <center> tags).

    HTML CODE
    -----------
    <div id="masthead"><img src="http://sitename.com/picturename.png"></div>
    <!-- menu div goes here -->


    CSS
    -----------
    #masthead{
    margin: 0 auto;
    width: /* banner width */
    height: /* banner height */
    }
    Note: add the height and width of the banner


    Or you can just use css positioning. If you are using this method dont forget to set margin-top of the first element in the html to the height of the masthead div, otherwise it will be on top of some element.

    #masthead{
    position:absolute;
    top: 0;

    /* if you want to align it to the right
    right: 0;
    */
    /* if you want to align it to the left
    left: 0;
    */

    }
    {{ DiscussionBoard.errors[8985922].message }}

Trending Topics