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

Josh Keenan
Josh Keenan
20,315 Points

Margin problems..

Hey everyone,

So I decided I'm going to start working on my portfolio site ,check it out ;) https://joshuakeenan.com , and I have a visible problem with my css and me and 2 friends are stuck as to what is causing this white border to appear around the whole site. I'll add both files.

<html>
<head>
    <title>Welcome!</title>
    <link rel="stylesheet" href="css/main.css">
</head>
<body>

    <header class="main-header">
        <h1>Website in development</h1>
        <p>Joshua Keenan</p>
    </header>

    <div class="primary-content">
        <p>Looking for a web developer?</p>


    </div>
    <div class="boom">
        <h2>Simple:Style</h2>
    </div>
</body>
</html>
@font-face {
  font-family: 'Helsinki';
  src: url('../fonts/HelsinkiXXL-Thin.eot');
  src: url('../fonts/HelsinkiXXL-Thin.woff') format('woff'),
       url('../fonts/HelsinkiXXL-Thin.ttf') format('truetype');
}

body {
    margin: 0 auto;
    margin: 0;
}


* {
    box-sizing: border-box;
    margin: 0;
}


h1  {
    color: #fff;
    font-family: โ€˜Lucida Consoleโ€™, Monaco, monospace;
    margin: 0 auto;
}

p {

    color: #fff;
    font-family: 'Helsinki';
    font-size: 1.5em;
}

h2 {

    color: #fff;
    font-family: 'Helsinki';
    font-size: 4em;
}
.main-header {

    height: 720px;

    background: #acacac url("http://i.imgur.com/zPaL0WQ.jpg") no-repeat center;
    background-size: cover;
}

.main-header h1 {

    text-align: center;
    font-size: 3em;
}

.main-header p {

    text-align: center;

}

.primary-content {
    box-sizing: border-box;
    height: 120px;
    font-family: โ€˜Lucida Consoleโ€™, Monaco, monospace;
    margin: 0 auto;
    text-align: center;

    background: #acacac;
    background-size: cover;
}

.boom {
    background: url("http://i.imgur.com/y8x4Zoh.jpg") no-repeat center;
    text-align: center;
    background-size: cover;
    margin-top: -53px;
    height: 420px;

}

Edit: Adding that we decided to remove all padding as we thought that was the cause

1 Answer

Hi Josh,

It appears that for some reason you body styles aren't being applied to the page following the link you posted.

Did you save your CSS correctly? I only ask because its odd for the styles to not even show up in the console.

Josh Keenan
Josh Keenan
20,315 Points

As far as we can all see there are no problems with it. Why i'm here asking for help. We are all compsci students staring at it befuddled

Josh Keenan
Josh Keenan
20,315 Points

update: thought it was cache not clearing but no, cleared it and no progress, also we have realised an old version of the css file is being applied and no updates are being shown. Cache has been cleared so we are getting there

Josh Keenan
Josh Keenan
20,315 Points

SOLVED! Server auto logged me out but it still let me edit but the saved files weren't uploaded to the server. Relogged and problem solved, thanks for the help!