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

stephanie harrison roberts
stephanie harrison roberts
1,713 Points

Moving a class element in CSS

Hi all, sorry for this question.....Im clearly being dumb! how would I go about moving some text on my page thats been assigned a class, but sort of goes above the H1 heading on the page. So it has its own class and I can change things like color in the CSS etc...but I cant move its position on the page. I want to make it nearer to the H1 heading, as in close the gap between the two. Ive tried adding margins and padding to the class in CSS but nothing changes its position?

thanks in advance

Stephanie

Adam Beer
Adam Beer
11,314 Points

Please show we your code. I'm not sure what you want exactly.

Code Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

      ```html
      <p>This is code!</p>
      ```

1 Answer

Steven Parker
Steven Parker
231,261 Points

As a generic suggestion, you might need to reduce or remove the existing margins on both your added element and on the h1 you want to move it nearer to.

If that doesn't resolve it, post your actual code as Adam suggested to allow a more specific answer.