Image in top right corner?

Discussion in 'HTML & Website Design' started by macro-solutions, Jul 30, 2007.

  1. #1
    macro-solutions, Jul 30, 2007 IP
  2. Katy

    Katy Moderator Staff

    Messages:
    3,490
    Likes Received:
    513
    Best Answers:
    7
    Trophy Points:
    355
    #2
    If it's a body background image, use this:

    body {
    background: url(image.jpg) right top no-repeat;
    margin: 0;
    padding: 0;}

    If you want to include it into a div, use this:

    #whatever {
    background: url(image.jpg) right top no-repeat;
    float: right;
    margin: 0;}

    :)
     
    Katy, Jul 30, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Katy's one works but if you want to add text, links or other content, use an absolutely positioned layer.

    #ad {
      position: absolute:
      top: 0px;
      right: 0px;
    }
    Code (markup):
    <div id="ad">...</div>
    Code (markup):
     
    krt, Jul 30, 2007 IP
  4. macro-solutions

    macro-solutions Peon

    Messages:
    183
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Cheers guys i'll give it a try :)
     
    macro-solutions, Jul 30, 2007 IP