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 reduce space between header-info and main content

Hello,

I am trying to reduce the space between my main-header information and content in my container. I have tried to do this with negative margins and max-height properties. However I can not get it to work. If anyone know a trick to do for this, it would be much appreciated.

HTML

<div id="header_info"> <header class="main-header"> <h1>Tracy Excell</h1> <ul class="nav"> <li><a id="home">Home</a></li> <li><a href="#portfolio">Portfolio</a></li> <li><a href="#contact">Contact</a></li> </ul> </header>

<div id="wrapper">

<img src="images/kiwiicon2.jpg" alt="Profile-picture" class="profile-image">

<div id="first-paragraph"> <p class="paragraph">Hi I'm a front end developer who loves responsive design and css.
I recently finished a degree in front end web development at Treehouse and am excited to put all my skills to use!</p> </div> </div>

<div id="container">

CSS

@media (min-width: 769px) {

columns {

-webkit-column-count: 2; /* Chrome, Safari, Opera */
-moz-column-count: 2; /* Firefox */
column-count: 2;
flex-wrap: no-wrap;

}

.main-header h1 {

justify-content: center;

}

.nav { flex-direction: row; max-width: 350px;

}

.nav li {

border: none;
background-color:#eff5f5;
justify-content: center;

}

body { margin: 2em; padding: 0; }

header-info {

position: relative;

}

.profile-image { position: absolute; right: 5em; height: 200px; width: 200px;

}

first-paragraph {

position: absolute;
left: 3em;
width: 500px;

}

header-info {

max-height: 300px;

}

I want the bottom margin to be a lot less than it currently is.

1 Answer

One of the issues may be how you are referencing the items in your css.

You should be calling classes with a period in front and, several times in the provided code you are not doing that.

.header-info {}

.first-paragraph {}

Hopefully by using correct syntax your margin-top/margin-bottom and/or padding-top/padding-bottom will work properly.

Thank you. I will go through my CSS and make sure that it is correct.