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
Craig Stovall
6,914 Pointsimage behind(outline) body
I want to have an image that outlines the body. I need suggestions on markup and style for a responsive design. When I reduce the browser I haven't been able to figure out how to remove the image just so the body appears and then scales down.
4 Answers
Adam Sackfield
Courses Plus Student 19,663 PointsWhat do you mean by outlines the body. Do you have a picture showing the desired end result. Also to remove the image when the browser re-sizes you would need to use media queries and display: none on that element at the relevant sizes.
Craig Stovall
6,914 PointsI'm not aware how I can post an image here. If you know how please share. I have included an image on the style sheet under the html element.
html { background: #92520a url('../img/leatherimagelogo.jpg') repeat; max-width: 100%; }
And then I have set up the margins and padding of the body to shrink in so that the image can be seen all around the outside of the body.
body { font-family: 'Oswald', Arial, Helvetica, sans-serif; background: #E3DEC1; margin: 5em 11em 3em 11em; border: 3px solid #B94629; border-radius: 10px; box-shadow: 0 0 10px 10px; }
I am familiar with the media queries but I'm not always sure how to set them up with the correct attributes and symbols .#
I need to figure out a way to target the image in the html and remove it when the browser reduces.
Adam Sackfield
Courses Plus Student 19,663 PointsNot sure about up loading image here could use jsfiddle and add the code and post the link. As for media queries give your image in the html an id say #bg, then at then bottom of the css file add say. @media screen and (max-height=600px){ #bg { display: none; } } or then you can change the screen size to where ever it begins to break.
James Barnett
39,199 PointsCheck out the markdown cheatsheet link, there's an example of how to embed an image using markdown. I perfer codepen as it has much better UX than jsfiddle, of course there are several other good alternatives to jsfiddle as well.
Adam Sackfield
Courses Plus Student 19,663 PointsI tried the markdown to set code blocks from post but didn't do anything!
Craig Stovall
6,914 Pointsok. thanks.
Craig Stovall
6,914 PointsCraig Stovall
6,914 PointsHello Adam, as I have been looking at other forum post for help on different questions I saw where you commented a couple of times about closing out a question. Can you tell me exactly what I am supposed to do to close one out and have the green check mark show up? Thanks,
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsAligned to the persons name to the right hand side should have a best answer button and up and down signs
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsNot if the subject is General Discussion though
Craig Stovall
6,914 PointsCraig Stovall
6,914 Pointsthanks