OsakaWebbie
Programmer
I'm making my first attempt at using CSS to position things (rather than just set fonts and stuff), so pardon my ignorance. Although I've been trying to learn it on my own with online docs I find, it's getting confusing. What I'm trying to do is take chord symbols and lyrics from a database of songs and lay them out such that each chord lines up above its associated word. My first attempt used code like this:
But the horizontal space for each chord is still there between the words - I want the words to have their normal spacing, and the chord's left edge to be lined up with whatever the next character is (after the span, the way I have it now). How can I do that? I assume it has to do with span vs. div, or position types, or something, but...
Code:
<style>.lyrics { font-size: 12pt; margin-bottom: 0; margin-top: 14pt; font-family: Arial, Helvetica;}
.chord { position:relative; left:0px; top:-14pt; font-size: 12pt; color:red; font-weight:bold; font-family: Arial, Helvetica; }
</style></head>
<body><p class=lyrics><span class=chord>D</span>Great in power, <span class=chord>Bm</span>great in glory</p>
<p class=lyrics><span class=chord>G</span>Great in mercy, <span class=chord>Em</span>King of <span class=chord>A</span>heaven</p>
<p class=lyrics><span class=chord>D</span>Great in battle, <span class=chord>Bm</span>great in wonder</p>
<p class=lyrics><span class=chord>G</span>Great in Zion, <span class=chord>Em</span>King over <span class=chord>Asus A</span>all the <span class=chord>D</span>earth</p>