Skip to content

Instantly share code, notes, and snippets.

@nicksuch
Created May 23, 2014 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicksuch/5c3d6b2da80bd7a3952e to your computer and use it in GitHub Desktop.
Save nicksuch/5c3d6b2da80bd7a3952e to your computer and use it in GitHub Desktop.
Applying classes to block-level elements in Markdown (when using the Kramdown processor). Shows source (.md) and generated (.html)
<style type="text/css">
ul.posts {
list-style-type: none;
margin: 0 auto;
width: 60%;
}
li {
margin-bottom: 35px;
text-align: center;
}
p.post-content {
text-align: left;
}
p.post-date {
color: #A0A0A0;
font-style: italic;
margin-bottom: 15px;
}
p.post-content > img {
margin: 0 auto;
max-height: 80%;
max-width: 100%;
}
</style>
<ul class="post-title posts">
<li>
<h2 id="hello-world">Hello World!</h2>
</li>
</ul>
<ul class="post-date posts">
<li>May 21, 2014</li>
</ul>
<ul class="post-content posts">
<li><img src="/images/photos/blog/hello-world.jpg" alt="blog-image" /></li>
</ul>


<style type="text/css"> ul.posts { list-style-type: none; margin: 0 auto; width: 60%; } li { margin-bottom: 35px; text-align: center; } p.post-content { text-align: left; } p.post-date { color: #A0A0A0; font-style: italic; margin-bottom: 15px; } p.post-content > img { margin: 0 auto; max-height: 80%; max-width: 100%; } </style>
  • Hello World!

{: .post-title .posts}

  • May 21, 2014 {: .post-date .posts}
  • blog-image {:.post-content .posts}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment