Edit on
<code class="centered">
<span data-subtext="opening tag">
<span class="header">&lt;a&nbsp;</span><span class="header">href=</span>
<span class="header magenta" data-supertext="the page that we link to">"https://google.com/"</span>
<span class="header">&gt;</span>
</span>
<span class="header blue" data-supertext="linked text the user clicks on">google is your friend</span>
<span data-subtext="closing tag"><span class="header">&lt;/a&gt;</span></span>
</code>
@import "compass/css3";

code {
font-family: consolas, monaco, monospace;
}
.centered {
display: block;
text-align: center;
color: #666;
}

.header {
font-size: 30px;
line-height: 1;
margin-bottom: 30px;
font-weight: normal;
padding: 45px 0 30px;
margin: 10px 0;
display:inline-block;
position: relative;
}
.blue {
color: #08c;
}
.magenta {
color: #c08;
}

[data-supertext],[data-subtext] {
display:inline-block;
position: relative;
&:before, &:after {
position: absolute;
width: 100%;
line-height: 1;
}
&:before {
content: attr(data-supertext);
z-index: 1000;
font-family: sans-serif;
font-weight: normal;
font-size: 12px;
text-align: center;
top: 5px;
}
&:after {
content: "";
position: absolute;
left: 0;
height: 15px;
border: 2px dotted #B7B6B1;
border-bottom: none;
overflow: hidden;
z-index: 10;
top: 20px;
}
}
[data-subtext] {
&:before {
top: auto;
bottom: 5px;
content: attr(data-subtext);
}
&:after {
top: auto;
bottom: 20px;
border: 2px dotted #B7B6B1;
border-top: none;
}
}
View Compiled
Rerun