scrimba
Responsive Design
Think responsively
Playing with the title's position, and the downsides of negative margins
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Playing with the title's position, and the downsides of negative margins
AboutCommentsNotes
Playing with the title's position, and the downsides of negative margins
Expand for more info
css
styles.css
run
preview
console
/*  Fonts
-----
font-family: 'Lora', serif;
font-family: 'Ubuntu', sans-serif;
*/

body {
margin: 0;
font-family: 'Ubuntu', sans-serif;
font-size: 1.125rem;
font-weight: 300;
}

img {
max-width: 100%;
display: block;
}

/* =================
Typography
================= */

h1,
h2,
h3 {
font-family: 'Lora', serif;
font-weight: 400;
color: #143774;
margin-top: 0;
}

h1 {
font-size: 2rem;
margin: 0;
}

a {
color: #1792d2;
}

a:hover,
a:focus {
color: #143774;
}

strong {
font-weight: 700;
}

/* h1 subtitle */
.subtitle {
font-weight: 700;
color: #1792d2;
font-size: .75rem;
margin: 0;
}

.article-title {
font-size: 1.5rem;
}

.article-read-more,
.article-info {
font-size: .875rem;
}

.article-read-more {
color: #1792d2;
text-decoration: none;
font-weight: 700;
}

.article-read-more:hover,
.article-read-more:focus {
color: #143774;
text-decoration: underline;
}

.article-info {
margin: 2em 0;
}


/* =================
Layout
================= */

.container {
width: 90%;
max-width: 900px;
margin: 0 auto;
}

.container-flex {
display: flex;
flex-direction: column;
justify-content: space-between;
}

header {
background: #f8f8f8;
padding: 2em 0;
text-align: center;
}

@media (min-width: 675px) {
.container-flex {
flex-direction: row;
}

main {
width: 75%;
}

aside {
width: 20%;
}
}

/* navigation */

nav ul {
list-style: none;
padding: 0;
display: flex;
justify-content: center;
}

nav li {
margin-left: 2em;
}

nav a {
text-decoration: none;
color: #707070;
font-weight: 700;
padding: .25em 0;
}

nav a:hover,
nav a:focus {
color: #1792d2;
}

.current-page {
border-bottom: 1px solid #707070;
}

.current-page:hover {
color: #707070;
}

@media (max-width: 675px) {
nav ul {
flex-direction: column;
}

nav li {
margin: .5em 0;
}
}

/* articles */

.article-featured {
border-bottom: #707070 1px solid;
padding-bottom: 2em;
margin-bottom: 2em;
}

.article-recent {
display: flex;
flex-direction: column;
margin-bottom: 2em;
}

.article-recent-main {
order: 2;
}

.article-recent-secondary {
order: 1;
}



Console
index.html
-4:42