/    Sign up×
Community /Pin to ProfileBookmark

Main background of a page

Hi,

I am trying to have a main background of my page. What I did is I created a div which includes everything such as:

<div class=”mainarea”>

</div>

and css looks like this:

.mainarea
{
background-image:url(‘pictures/mainbackgr.jpg’);
}

it still does not show the background …can you help?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@holyhttpMay 01.2009 — There may be a background for the browser viewport wich you would befine in the body selector.

If the page content is wrapped by the <div class="mainarea">....</div>

then the background applied to:

.mainarea

{

background-image:url('pictures/mainbackgr.jpg');

}

should be revealed provide the path ('pictures/mainbackgr.jpg') is correct. Keep in mind that path is relative to the location of the CSS style.

Also make sure you do not have background color define in other div nested inside "mainarea" because that background color would cover your background image.
Copy linkTweet thisAlerts:
@agressoMay 01.2009 — I prefer this one:
[CODE]<body style="background-image: url('pictures/mainbackgr.gif')"/>[/CODE]
×

Success!

Help @ketanco 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.19,
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,
)...