Log in

View Full Version : Making same width horizontal tabs



Alvaro3663
10-19-2009, 05:10 AM
I've seen in CSS horizontal tabs that the width of each tab depends on the length of the text within.

How can I make same width tabs containing words of different length and each word centered inside the tab?

Thanks

:)

davelf
10-19-2009, 06:13 AM
sorry don't really understand what you mean, like this?



<html>
<head>
<style>
.tab{
width:100px;
text-align:center;
border:thick;
border-style:dotted;
}

</style>
</head>


<body>
<div class="tab">
testing what
</div>
<br />
<div style="border:thick;
border-style:dotted;">
testing
</div><br />
<div style="border:thick;
border-style:dotted;">
hahahahahaha
</div><br />

<div class="tab">
what happen
</div>
</body>
</html>

Alvaro3663
10-19-2009, 06:36 AM
Yes! thanks :)