dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: background alignment

  1. #1
    Join Date
    Dec 2002
    Posts
    55

    background alignment

    i've looked around diff. css sites, but i can't quite figure out how to do this. What i want is to have a background image horizontaly aligned right but vertically, i want it centered. Also, fixed, no-repeat, and etc, but that doesnt matter.
    I wish CSS was easier
    I was thinking it should be something like background-vertical-alignment:center. That would be easy but i guess it doenst work that way.
    Thanks

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    <head>
    <style type="text/css">
    body {background: url("collage.jpg") center right fixed no-repeat}
    </style>
    </head>
    <body>
    </body>

  3. #3
    Join Date
    Nov 2002
    Posts
    984

    Re: background alignment

    Originally posted by minulescu
    I wish CSS was easier
    I was thinking it should be something like background-vertical-alignment:center. That would be easy but i guess it doenst work that way.
    Thanks [/B]
    Yes it does, except that it's even easier then that. You don't need 2 different names for the alignment, you just specify 2 values after each other.

    In Gil example above he has taken advantage on another CSS property that make it even still easier, setting all aspects at once simply uning background: and listing the options.

    For a listing and description of all avalable options you can read this
    http://www.w3.org/TR/REC-CSS2/colors.html#q2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles