First, stop trying to absolutely-position everything. The content should be arranged logically so that the label is paired with the content. That is, other labels shouldn't appear before the relevant content.
Below is one way to mark-up the content. It's rather messy as there's no appropriate semantic elements: using div and span elements this often is usually something to avoid. Note that only the labels have been absolutely-positioned so that they appear to the left.
The class names used represent what I think you're trying to present. The two meaningless name - foo and bar - occur because I'm not sure, though I could guess. Feel free to replace them with something better.
Code:
.container {
background: #333333;
color: #ffffff;
padding: 1em;
width: 20em;
}
.personal, .background, .contact {
margin: 0.5em auto 0;
position: relative;
padding-left: 5em;
width: 8em;
}
.personal {
margin-top: 0;
}
.institution, .bar {
background: transparent;
color: #c0c0c0;
}
.label {
position: absolute;
left: 0;
}
HTML Code:
<div class="container">
<div class="personal">
<div class="name">
<span class="label">Name:</span>
Magnus
</div>
<div class="birth">
<span class="label">Birth:</span>
1985
</div>
</div>
<div class="background">
<span class="label">Bakgrund:</span>
<div class="foo">
NA
<div class="institution">Gripenskolan, Nkpng</div>
<div class="bar">A - provet 2004</div>
</div>
<div class="foo">
Programmet
<div class="institution">KTH</div>
</div>
</div>
<div class="contact">
<span class="label">Kontakt:</span>
<div class="e-mail">e-mail here</div>
<div class="telephone">0702-</div>
</div>
</div>
Hope that helps,
Mike
Bookmarks