/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJan 10.2003 — [font=monospace]<head>

<style type="text/css">

body {background: url("collage.jpg") center right fixed no-repeat}

</style>

</head>

<body>

</body>[/font]
Copy linkTweet thisAlerts:
@StefanJan 10.2003 — [i]Originally posted by minulescu [/i]

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][/QUOTE]


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
×

Success!

Help @minulescu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...