Click to See Complete Forum and Search --> : background alignment


minulescu
01-10-2003, 04:10 AM
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

gil davis
01-10-2003, 05:27 AM
<head>
<style type="text/css">
body {background: url("collage.jpg") center right fixed no-repeat}
</style>
</head>
<body>
</body>

Stefan
01-10-2003, 06:23 AM
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