Help Positioning a background image

Discussion in 'HTML' started by westsidesally, Dec 11, 2006.

  1. Here's the code I'm using:

    <style type="text/css">
    body
    {
    background-image:
    url('line.gif');
    background-repeat:
    no-repeat;
    background-position:
    left
    }
    </style>

    I just have this placed inside the head, but I'm just not sure how to
    get the image itself to move over about 200px from the left???
     
    westsidesally, Dec 11, 2006
    #1
    1. Advertisements

  2. westsidesally

    dorayme Guest

    background-position: 200px 0px;
     
    dorayme, Dec 11, 2006
    #2
    1. Advertisements

  3. That's great, thanks a lot. So, is the first number always meant to
    define from the left and the second from the top?

    Also, is it better to simply link a css document rather than just
    putting it all in the head?
     
    westsidesally, Dec 11, 2006
    #3


  4. Oh yeah, and does the format look different when you're creating a css
    page to link as opposed to formating it in the head of the page?
     
    westsidesally, Dec 11, 2006
    #4
  5. westsidesally

    dorayme Guest

    If this works to do what you want, it will always work this way.
    It does not depend on the day of the week: on odd days, the first
    Yes, if you have more than one or two css instructions, it is a
    neater way to go, the css gets cached...
     
    dorayme, Dec 11, 2006
    #5
  6. westsidesally

    dorayme Guest

    It does not have the <style...></style> bits, otherwise the same.
    The big point of hiving all off to a linked sheet is that this
    sheet then controls all the the html pages, change in one
    instructions affects all the html pages, you lose this power if
    you include the styles either inline or in the head.

    on the other hand, you gain if there are very few exceptions to
    the general styles in one or two pages - a small entry in the
    head of some styles just for those pages saves the head from
    having to be all church like and invent classes and ids to cover
    these cases in so few instances.
     
    dorayme, Dec 11, 2006
    #6
  7. Thank you! That's very good to know.
     
    westsidesally, Dec 11, 2006
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.