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

getting rid of margins on a full page background image in HTML&CSS

Hello all! I'm trying to get rid of any white space around the background image.....i tried margins: auto;, and that didnt work, any suggestions? Code below!

Thanks alot, Steph

<html>
<head class="main-head">
    <title>Coding Mama</title>
         <link rel="stylesheet" href="Background.css">
            <meta name="description" 
            content="A general guide on the use of meta tags in html pages">

</head>
<body>
    <img src="Brackets_Images/redgrafitti.jpg" class="background_image">

</body>
.background_image{
    width: 100%;
    height: 100%;
    position: fixed;
}

3 Answers

Try this:

display: block;

Hello Adam, Hope you're well? Thanks for that, its now working, phew!!

steph

Sounds good. Yes I'm fine! And you? Have a nice day!

Yes all good so far today thanks...no doubt I'll be calling on your expertise before to long! :)