Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS, fill all div width with text

Tags:

html

css

How to automatically change the space between the letters.I want the text to take up the entire width of the div. Text is not static. (Always changing text, can be 123" or "text text"...)

  <style type="text/css">
    #menu{
      width: 200px;
      background-color: #000;
      color: #336699;
      font-size: 16px;
      letter-spacing: 100%;
    }
  </style>
<body>
<div id="menu">
  tekstas
</div>
like image 248
lolalola Avatar asked Dec 02 '10 10:12

lolalola


1 Answers

EDIT: Unfortunately this only changes word spacing, not letter spacing. There is not way to do kerning in CSS. Possibly CSS3, however.

This is easily accomplished with the text-align: justify CSS attribute:

#menu 
{ 
      width: 200px; 
      background-color: #000; 
      color: #336699; 
      font-size: 16px; 
      text-align: justify; 
}
like image 88
Bojangles Avatar answered Oct 19 '22 03:10

Bojangles