Css text help

  • Thread starter Thread starter Paul C
  • Start date Start date
P

Paul C

Hi
Is there a way of changing the AV of text so that the letters sit closer to
one another
Thanks
Paul M
 
Hi,
This is controlled by letter-spacing, eg
<style>
p{
letter-spacing: .1em;
}
</style>
<p>Some text here</p>
Try messing about with the value to get what you want.

Cheers,
Jon
 
Thanks
I am trying to get the letters of this nav list closer how can I impliment
the style into this
Thanks
Paul M

}
#navlist a, #navlist a:visited {
display: block;
padding: 5px 0px 5px 5px;
background-color: #DADADA;
background-repeat: no-repeat;
background-position: 0% 50%;
color: #666666;
text-decoration: none;
border-top: 0px solid #FFFFFF;
border-right: 0px solid #FFFFFF;
border-bottom: 2px solid #FFFFFF;
border-left: 0px solid #DADADA;
font-size: 11px;
font-weight: bold;
font-family: Arial, Verdana, Arial, Helvetica, sans-serif;
}
 
Did you look at my page?

By the way, it appears that Safari doesn't support negative letter-spacing
values, so your attempts will not be successful on that browser, I don't
think.
 
Thanks Murray I did look at your page
Still can't get it to work I have slotted it in, is this correct apart from
the value and can I use px instead of em?
Thanks
Paul M

#navlist a, #navlist a:visited {
display: block;
padding: 5px 0px 5px 5px;
background-color: #DADADA;
background-repeat: no-repeat;
background-position: 0% 50%;
color: #666666;
text-decoration: none;
border-top: 0px solid #FFFFFF;
border-right: 0px solid #FFFFFF;

letter-spacing: -.02em;

border-bottom: 2px solid #FFFFFF;
border-left: 0px solid #DADADA;
font-size: 11px;
font-weight: bold;
font-family: Arial, Verdana, Arial, Helvetica, sans-serif;
}
 
Yes, that's correct usage. You can use PX instead of EM, but the problem
with that is that the px value is now an absolute value, and may be totally
inappropriate if someone resizes the text in their browser.
 
Thanks Murray
So it is best to use em for all text? Do you have any problems like when you
use points, ie is the size interpreted differently by different browsers
Paul M
 
Well, points are for print, and not for pixel-based displays, so I don't use
them at all (except in print stylesheets). And if you do use them, yes, you
will see differences in sizing from one browser/platform to another.
So it is best to use em for all text?

em is just a relative measure. It says "whatever size is currently being
displayed as the default, multiply it by this value and display this text
that size". The reason you would want to use em for letter-spacing is that
when the text size is increased by the viewer, you would want the spacing to
increase proportionately.

What you use to size your text is more a function of your personal
preferences, and your ability to understand what you are getting! Using
relatively sized text *can* be a bit confusing until you get there, since
it's additive across the page, meaning that if you have set your default
size to be .8 em, and you have another container which is explicitly sized
at .5 em, the result will be text sized at .4 em, i.e., .5 x .8.
 
Back
Top