Banner / Text placement - need help...

Discussion in 'Blogging' started by dscurlock, May 9, 2010.

  1. #1
    Can someone tell me how to place text on the right side of a banner...
    I see banners in blogs all the time with text aligned nice and neat, and
    every time I place a banner/text, it never turns out good.

    So how do i place a banner, with text properly aligned to the right.

    Thanks
     
    dscurlock, May 9, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Create a div, with the banner image as the background. Then put some text inside and position it on the right side.
    You can either float the text right or use absolute positioning, like in this example:
    
    HTML
    <div id='banner'>
      <p>Text Goes Here</p>
    </div>
    
    CSS
    .banner {
      background-image: url('banner.jpg');
      heigth: /* banner height */
      position: relative;
      width:  /* banner width */
    }
    
    .banner p {
      position: absolute;
      right: 0;
      top: 0;
    }
    
    Code (markup):
     
    Cash Nebula, May 10, 2010 IP