hey, is htere a way to set padding between words in a navigation div ?
thanks![]()
| SitePoint Sponsor |


hey, is htere a way to set padding between words in a navigation div ?
thanks![]()

<html>
<head>
<title>bla</title>
<style>
p{word-spacing:10px;}
</style>
</head>
<body>
<p>bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla </p>
</body>
</html>


thanks that worked, but how do i do for links ?
it doesn't seem to work on them![]()

<html>
<head>
<title>bla</title>
<style>
a{word-spacing:110px;}
</style>
</head>
<body>
<a href="#">bla bla bla bla bla bla bla </a>
</body>
</html>
it works for me?





I will just suggest that you use EM rather than PX for word-spacing so the space can uniformly grow/shrink if the text is re-sized.


i don't know how this em works :@
is it lie 1em is x PX or somthing ?





Basically, an EM inherits its size from the parent containers' font-size.Originally Posted by sanzo
Lets look at this quick example:
HTML Code:<div id="box"> This is some text. </div>In that case, 1 EM will be equal to 10 PX — the set font-size. That makes the gap between each word 20 PX. Now try increasing the text size through the browser, and you'll notice the gap grows, as do the boxes dimensions. This is because the size of the EM automatically re-adjusts to match the font-size.Code:#box { font-size: 10px; word-spacing: 2em; width: 40em; height: 10em; background: pink; }
Because of this adaptable size, EM's are perfect for some situations, but don't work so well in others.
Common uses include:
- Gaps between paragraphs and other blocks of text
- line-height
And it's even possible to use EM for whole layouts:


ok i'll try it
but 10px looks much, how can you make that smaller, but keep the font size ?





Hi,
You may find the Em Calculator handy.Code:something: 0.5em; something-else: 0.03em; something-bigger-and-fatter: 255.56em;
Bookmarks