Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How to make an image the size of the screen while inside a 1000px grid..

I have created a website inside of a 1000px grid however I have to images (footer texture) and a banner that I would like to be the width of the whole page, is there a way I can do this and still remain inside of the grid?

6 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Then the image needs to be located outside of the grid too.
For example:

<body>

<div class="my-grid">
<!-- content here -->
</div> <!-- close grid -->

<div class="full-image">
<!-- your link to your image file here -->
</div>

<div class="my-grid">
<!-- content here -->
</div><!-- close grid -->

</body>

Thats if your image is in your html file, if it's in your css then we need to do things a little different.

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Stephanie,

Try max-width: 100%;

Hope this helps.

Hey, I tried this and is still isnt working.

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Stephanie,

I'm not sure if your using a grid.
Do you want the image to go from one side of browser to the other or one side of your grid to the other?

I want it to go to one side of the browser to the other, but I have created my website inside of a grid.

My image is in my html file, this sorted it thank. Do you know how I can get my footer image to the bottom of the page? Its sitting in the middle.

Wayne Priestley
Wayne Priestley
19,579 Points

can you give me the link to your page so i can look at your css please.

Wayne Priestley
Wayne Priestley
19,579 Points

I just re-read your question Stephanie, You can use the method i described for the image on your footer too, or anything else you want to be the entire width of the browser.

Anything inside the grid will never be able to stretch outside of it.