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

Help with responsive CSS edits on About Page.

None of my code is even showing up on my preview. I typed everything in to adjust the profile photo and the code to adjust the header and none of it is even showing in my preview. I checked to make sure responsive css was on the html and it was. I am confused as to why this code isn't working. Any assistance would be appreciated. https://w.trhou.se/gifsdgb00g

4 Answers

Brodey Newman
Brodey Newman
10,962 Points

Hey Steven!

I think I found your problem. In your about.html, you have your img tag below.

<img src="img/nick.jpg" alt="Photograph of Nick Petitt" class"profile-photo">

The problem here is that the image you're trying to view is in a folder called 'Img' and you're specifying the path to that image as 'img/nick.jpg'. If you capitalize that 'I' in your path, the image will show on your page. :)

Let me know if this helps. Below is what your code should look like.

<img src="Img/nick.jpg" alt="Photograph of Nick Petitt" class"profile-photo">

Thank you very much! I still am seeming to have issues with my profile photo being too large and it seems the CSS comments I put in to size the photo like the example are not working. Can you help me with this? The CSS for my contact page aren't working as well, so any help is appreciated.

https://w.trhou.se/5lrxd6by48

Jon Wood
Jon Wood
9,884 Points

Just checked your workspace. The images won't show because you're referencing the img folder, but the folder is actually Img.

Also, double check where you use the IDs that the responsive CSS is using. I think I saw them on the contact HTML but not on the index HTML.

Brodey Newman
Brodey Newman
10,962 Points

Steven,

In response to your other question about not seeing the css changes you made for the img element,

I noticed in your HTML you have:

<img src="Img/nick.jpg" alt="Photograph of Nick Petitt" class"profile-photo">

If you look at, ' class"profile-photo" ' , you'll notice you don't have the '=' after 'class'. This is causing an error, which is not allowing your css selector to add styling to that element.

Your code should look like mine below:

<img src="Img/nick.jpg" alt="Photograph of Nick Petitt" class="profile-photo">

Let me know if this helps. :)

That just brings his photo up and the CSS is still not applied to make it rounded and to the left of the text.

Brodey Newman
Brodey Newman
10,962 Points

Hello Steven,

I'm having a hard time visualizing what exactly you're trying to do, but from your explanation above I was able to code up something that might look similar to what you're doing.

This may not be something that you've covered in your lessons yet so It might look new to you. If you haven't seen it before and it overwhelms you a bit, don't worry, you will figure learn about it in future lessons.

What I did below was wrap your content inside of the section in their own divs so I can move them around.

<div class="left">
        <img src="Img/nick.jpg" alt="Photograph of Nick Petitt" class="profile-photo">
</div>

<div class="right">
        <h3>About</h3>
        <p> 
              Hi I am Steven McNeil and this is my web design portfolio. When I am not designing websites I am running a blog named STL Hat Trick and spending time with my family.
        </p>
        <p>
              If you'd like to follow me on Twitter, my username is <a href="http://twitter.com/smcneil_87">@SMcNeil_87</a>
        </p>
</div> 

As you can see, I gave both of the 'div' elements their own class names so I can add styling to them and move them around like puzzle pieces.

Below is the CSS I used to make the 'left' div, which wraps the image, float to the left, and the 'right' div, which wraps your content, to the right.

/****************************
Testing
*****************************/

.left {
  float: left;
  width: 40%;
}

.right {
  float: right;
  width: 60%;
}

@media screen and (max-width: 700px) {
   .left {
    float: none;
    width: 100%;
  }

  .right {
    float: none;
    width: 100%;
  }
}

Specifying the width of the boxes when they're floated allows you to position the boxes on the same line. I also set a media query at a 700px breakpoint to remove the floats for mobile so that the boxes stack on top of each other.

Try this out and play around with it, and let me know if this is what you were aiming for, and like I said, if this is too much info right now, don't worry. Play around with it and try and do some cool stuff.