/    Sign up×
Community /Pin to ProfileBookmark

please look at this link
[url]http://www.sudhakargolakaram.co.in/files/backgroundimage.html[/url]

my question is about the image at the footer. i have a wrapper div with a width of 900px, at the top of the page will be the content inside the wrapper div and at the bottom of the page i want a background image which should appear 100% of the width and height which is the height of the image.

within this footer div which i need the background image i also want content to be inside the 900px wrapper div so i set the footer div to width: 100% and height 684px which is the height of the background image however this background image is not appearing at 100% width but stopping at 976px which is the width of the image

how do i make the background image appear 100% of the width and have the footer content sitting within this background image

please advice

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@ctozAug 24.2010 — I haven't checked your css. However, you can't stretch a background-image: you can only tile it... not much help in your case.

Within your footer div, nest a div that's going to contain the image:

div#forBG {

width:100%; height:100%; position:relative; z-index:-1; overflow hidden;

}

/* ie, full width and height of the footer div, and below any content in it */

Now style your 'background' image:

img#myfooterBG {

width:100%; height:auto;

}

/* full width of containing div, height adjusted to maintain aspect ratio; the 'overflow:hidden' on the containing div should take care of any 'extra' part of the image */

cheers
×

Success!

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