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 get image to front?

my #p-one (paragraph with scroll box) id will not go underneath my #profile-photo

<div id="div2"> <section> <h1 id="about" class="lawyer-header">Lawyer Turned Developer</h1> <img id="cover-photo1" src="images/cover-photo1.jpg" alt="Cover Photo"> <img id="ryan-profile" src="images/ryan-profile.jpg" alt"Photo of Ryan McAvoy, Developer"> <figure id="p-one"> <p>.............</p> </figure> </section> </div>

html, body {height: 100%; width: 100%; padding: 0%; margin: 0%;}

div {width: 100%; height: 100%;}

div1 {}

div2 {

background: #e8e8e8; margin-bottom: 0; }

div3 { background: #304179; }

div4 { background: #e8e8e8; }

div5 { background: #d9d9d9 }

div6 { background: #444; }

/* main elements -------------- */ header { color: white; text-align: center; font-size: 75px; vertical-align: middle; padding-top: 20%; padding-bottom: 0px; line-height:50px; }

ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #f3f3f3; }

li { float: right; font-size: 20px;

}

li a { display: block; color: black; text-align: center; padding: 12px 14px; text-decoration: none; }

li a:hover:not(.active) { background-color: #ddd; }

li a.active { color: black; background-color: #fee001; }

/* main classes -------------- */

.mainwording { color: white; text-align: center; border-top: solid #fee001 3px; margin-left: 23%; margin-right: 23%; padding-top: 5px; font-size: 27px; }

.lawyer-header { color: black; margin-top: 0; margin-bottom: 10px; text-align: center; font-size: 65px; vertical-align: middle; padding-top: 20px; padding-bottom: 0;

} .second-heading { margin: 0; color: #e8e8e8; text-align: center; font-size: 75px; vertical-align: middle; padding-top: 50px; padding-bottom: 0px; line-height:50px; }

/* IDs ------ */

logo {

height: 100px; width: 100px; margin: 0; position: fixed; z-index: +1; }

cover-photo1 {

margin-left: auto; margin-right: auto; width:800px; height:200px; display: block; margin-bottom: 0; }

p-one {

width:800px; height:255px; border-style: outset; text-align: justify; padding-top: 35px; padding-left: 15px; padding-right: 15px; box-shadow:10px 10px 2.5px #d9d9d9; background-color: white; font-size: 15px; line-height:1.5em; border:6px; overflow-y:scroll; margin-bottom: 0; margin-top: 0; display: block; margin-left: auto; margin-right: auto;

} #ryan-profile { height: 150px; width: 150px; border-radius: 50%; border: 4px solid #d9d9d9; display: block; position:absolute; top: 50%; left: 50%; margin-top: -100px; margin-left: -100px; position: relative; }

1 Answer

Check out the markdown cheat sheet below the 'Add an answer' area, it will tell you how to properly format code. This will make it a lot easier for us to read, and therefor our answers will be better.

I will not bother to read through this code, but there is something called z-index that you can use to describe what 'layer' of the page a given thing has to appear in.

Therefor set the z-index of the image to say 999 if you know you want it to be in front always.

Hope this helps!