Responsive Blog Post

By Laurel Beyers

F6
#
How do I use This?

A responsive blog post with title, image, and description with call to action.

HTML
<div class="responsive-blog-post">
  <div class="individual-post">
    <h4>Title of Blog</h4>
    <p class="date">Date</p>
    <img src="https://placehold.it/1200x650">
    <p> First few sentences of blog post show here and then eventually cuts out. First few sentences of blog post show here and then eventually cuts out. First few sentences of blog post show here and then eventually cuts out...</p>
    <a class="button" href="#">Read On</a>
  </div>
</div>


$responsive-blog-post-highlight: $primary-color;
$responsive-blog-post-vert-seperate: 4rem;

.responsive-blog-post {
  margin-bottom: $responsive-blog-post-vert-seperate;

  p {
    color: $dark-gray;
  }

  .button {
    padding: 0.85rem 3rem;
    background: $responsive-blog-post-highlight;

    &:hover {
      background-color: darken($responsive-blog-post-highlight, 5%);
      transition: color 0.3s ease-in;
    }
  }

  .individual-post {
    margin-bottom: $responsive-blog-post-vert-seperate;
  }

  h4 {
    margin-bottom: 0;

    &:hover {
      text-decoration: underline;
      transition: color 0.3s ease-in;
    }

    @media screen and (max-width: 39.9375em) {
      font-size: 1.5rem;
    }
  }

  img {
    margin-bottom: 1.5rem;
  }

  .date {
    font-size: 0.8rem;
    color: $dark-gray;
  }
}


.responsive-blog-post {
  margin-bottom: 4rem;
}

.responsive-blog-post p {
  color: #8a8a8a;
}

.responsive-blog-post .button {
  padding: 0.85rem 3rem;
  background: #1779ba;
}

.responsive-blog-post .button:hover {
  background-color: #146aa3;
  transition: color 0.3s ease-in;
}

.responsive-blog-post .individual-post {
  margin-bottom: 4rem;
}

.responsive-blog-post h4 {
  margin-bottom: 0;
}

.responsive-blog-post h4:hover {
  text-decoration: underline;
  transition: color 0.3s ease-in;
}

@media screen and (max-width: 39.9375em) {
  .responsive-blog-post h4 {
    font-size: 1.5rem;
  }
}

.responsive-blog-post img {
  margin-bottom: 1.5rem;
}

.responsive-blog-post .date {
  font-size: 0.8rem;
  color: #8a8a8a;
}

JS