/    Sign up×
Community /Pin to ProfileBookmark

centering a background image?

i have a background image that im using as wallpaper. it is 800×600 and if someones browser is larger it tiles and i dont want that. is there any code out there that can help me out in case someones resolution is larger than the original background..

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@meowJan 29.2003 — Centered an not tiling? Sure baby! :p

<style type="text/css">

body {background: #ccc url(pic.jpg) no-repeat center }

</style>

You can do more than that. Please see:

http://www.w3.org/TR/REC-CSS2/colors.html#q2
×

Success!

Help @warpedmonkey 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.27,
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,
)...