Hallo,
wird das ganze links ausgerichtet.
nein!
Weil das div dann nur 300px breit ist. Der Text ist schon zentriert.
Kommentiere ich aber /*width: 300px;*/ aus, wird das Ganze mittig platziert.
Wieso?
Weil das div dann eine Zeile lang ist. Die Linie ist aber dann auch länger.
Was mache ich falsch & wie bekomme ich den Schriftzug mit einer Unterlinie, die länger als der Text ist (weshalb ja text-decoration imho wegfällt), zentriert ausgerichtet?
So müsste es gehen:
<style type="text/css">
<!--
.ueberschrift {
font-family: Arial;
font-size: 25px;
text-align: center;
font-weight: bold;
color: #6B7EB3;
padding-bottom:0px;
width: 300px;
border-bottom-width: 2px;
border-bottom-style:solid;
border-bottom-color: #6B7EB3;
}
-->
</style>
<div style="text-align:center; width:100%"><div class="ueberschrift">Text</div></div>
Gruß
Axel