Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
128 changes: 127 additions & 1 deletion news_layout/css/main.css
Original file line number Diff line number Diff line change
@@ -1 +1,127 @@
/* Write your CSS here */
html {
background-color: #485468;
}

a {
text-decoration: none;
}

div, h2, p, figure {
margin: 0;
padding: 0;
}

.header {
color: white;
padding 40px 0 20px
text-align: center;
}

.header h1 {
font-size: 40px
font-weight: bold;
}

.header h2 a {
border-bottom: 1px solid
color: white;
font-size: 20px
}

.header h2 a:hover {
border-bottom-color: white;
opacity:1;
}

.main {
margin: 0 auto;
max-width: 1040px;
padding: 10px;
}

.column {
flex: 1;
flex-direction: column;
}

.article {
background: white;
color: #666;
display: flex;
flex: 1;
flex-direction: column;
flex-basis: auto;
margin: 10px
}

.article-image img {
display: block;
height: 100%;
left: 0;
position: relative;
top: 0;
width: 100%;
}

.article-image.is-16by9 {
padding-top: 20%;
}

.article-body {
display: flex;
flex: 1;
flex-direction: column;
padding: 20px;
}

.article-title {
color: #333;
flex-shrink: 0;
font-size: 1.4em;
font-weight: 200;
}

.article-content {
flex: 1;
margin-top: 5px;
}

.article-info {
display: flex;
font-size: 2em;
justify-content: space-between;
margin-top: 10px;
}


@media screen and (min-width: 800px) {
.columns,
.column {
display: flex;
}
}

@media screen and (min-width: 1000px) {
.first-article {
flex-direction: row;
}

.first-article .article-body {
flex: 1;
}

.first-article .article-image {
height: 100px;
order: 2;
padding-top: 0;
width: 50px;
}

.main-column {
flex: 3;
}

.nested-column {
flex: 2;
}
}
158 changes: 156 additions & 2 deletions news_layout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,164 @@
<html>
<head>
<meta charset="utf-8">
<title>Flexbox Layout</title>
<title>news layout</title>
<link rel="stylesheet" href="css/main.css">
</head>
<header class="header">
<h1>Michigan</h1>
<h2><a href="http://wikitravel.org/en/Michigan">Michigan is the best state in the whole country</a></h2>
</header>
<main class="main columns">
<section class="column main-column">
<a class="article first-article">
<figure class="article-image">
<img src="https://az616578.vo.msecnd.net/files/responsive/embedded/any/desktop/2015/08/07/635745138709033661-1042137897_9287510624_d98be4b215_b.jpg" alt="Turnip Rock">
</figure>
<div class="article body">
<h2 class="article-title">
YO
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros.
</p>
<footer class="article-info">
<span>by dude</span>
<span>50 comments</span>
</footer>
</div>
</a>
<div class="columns">
<div class="column nested-column">
<a class="article" href="#">
<figure class="article-image is-16by9">
<img src="http://www.nature.org/cs/groups/webcontent/@web/@michigan/documents/media/echo-lake-summer.jpg" alt="lake">
</figure>
<div class="article-body">
<h2 class="article-title">
SUP
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
</p>
<footer class="article-info">
<span>by dude</span>
<span>50 comments</span>
</footer>
</a>
</div>
<div class="column">
<a class="article" href="#">
<figure class="article-image is 16by9">
<img src="https://michigannature.files.wordpress.com/2012/05/neil-weaver-memorial-falls-low-res.jpg" alt="water">
</figure>
<div class="article-body">
<h2 class="article-title">
wassah duh
</h2>
<p class="article-content">
stuff goes in here
</p>
<footer class="article-info">
<span>by me</span>
<span>50 comments</span>
</footer>
</div>
</a>
</div>
<div class="article-body">
<h2 class="article-title">
marhaba
</h2>
<p class="article-content">
so much content, the best content
</p>
<footer class="article-info">
<span>by a dog</span>
<span>1938 comments</span>
</footer>
</div>
</div>
</div>
</section>

<section class="column">
<a class="article first-article">
<figure class="article-image">
<img src="https://az616578.vo.msecnd.net/files/responsive/embedded/any/desktop/2015/08/07/635745138709033661-1042137897_9287510624_d98be4b215_b.jpg" alt="Turnip Rock">
</figure>
<div class="article body">
<h2 class="article-title">
YO
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros.
</p>
<footer class="article-info">
<span>by dude</span>
<span>50 comments</span>
</footer>
</div>
</a>
<div class="columns">
<div class="column nested-column">
<a class="article" href="#">
<figure class="article-image is-16by9">
<img src="http://www.nature.org/cs/groups/webcontent/@web/@michigan/documents/media/echo-lake-summer.jpg" alt="lake">
</figure>
<div class="article-body">
<h2 class="article-title">
SUP
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
</p>
<footer class="article-info">
<span>by dude</span>
<span>50 comments</span>
</footer>
</a>
</div>
<div class="column">
<a class="article" href="#">
<figure class="article-image is 16by9">
<img src="https://michigannature.files.wordpress.com/2012/05/neil-weaver-memorial-falls-low-res.jpg" alt="water">
</figure>
<div class="article-body">
<h2 class="article-title">
wassah duh
</h2>
<p class="article-content">
stuff goes in here
</p>
<footer class="article-info">
<span>by me</span>
<span>50 comments</span>
</footer>
</div>
</a>
</div>
<div class="article-body">
<h2 class="article-title">
marhaba
</h2>
<p class="article-content">
so much content, the best content
</p>
<footer class="article-info">
<span>by a dog</span>
<span>1938 comments</span>
</footer>
</div>
</div>
</div>

</section>

<body>
<!-- Starter File -->

</body>
</html>