Skip to content

Instantly share code, notes, and snippets.

@mynameispj
Created July 12, 2012 22:21
Show Gist options
  • Save mynameispj/3101465 to your computer and use it in GitHub Desktop.
Save mynameispj/3101465 to your computer and use it in GitHub Desktop.
512 Pixels Linked List CSS
<h2 class="entry-title">
<a href="web.html">
The title of an awesome post
<span class="glyph" href="web.html">&raquo;</span>
</a>
</h2>
.entry-title span.glyph {
margin-left: 10px;
padding: 10px 11px 10px 9px;
background: #E2E2E2;
height: 20px;
width: 20px;
line-height: 10px;
border-radius: 75px;
margin-top: 5px;
position: absolute;
}
@ntodd
Copy link

ntodd commented Jul 16, 2012

This is what "display: inline-block;" is for.

@mynameispj
Copy link
Author

In most cases, yes. However, in this case, if the glyph was an "inline-block" element, it could be pushed down onto a line all by itself if the title was the right length, and that looked silly and unacceptable. Position: absolute; prevents the glyph from being pushed to its own line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment