By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Spacing Words in Header

P: n/a
Hello,

Thi is a newbie question regarding the spacing of words in a header
with links. I simply want to space the clickable words on my header bar
more horizontally. Here is my code to make more sense:
// HEADER MENU OPTIONS

document.write('<span class="header">');
document.write('<a href="index.html" target="_top">Home</a> <a
href="about.html" target="_top">The Company</a> <a
href="products.html"target="_top">Products</a> <a href="download.html"
target="_top">Downloads</a> <a href="contact.html"
target="_top">Contact</a><br>');
// -- END -->
I want the linked headers, Home, The Company, Products, Downloads and
Contact to be spaced apart more horizontally, maybe 10 spaces or so so
it doesn't look like a strange sentence. Can this be done?

Thanks,

Corey

Mar 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
DigMar wrote on 14 mrt 2006 in comp.lang.javascript:
Thi is a newbie question regarding the spacing of words in a header
with links. I simply want to space the clickable words on my header bar
more horizontally. Here is my code to make more sense:

// HEADER MENU OPTIONS

document.write('<span class="header">');
document.write('<a href="index.html" target="_top">Home</a> <a
href="about.html" target="_top">The Company</a> <a
href="products.html"target="_top">Products</a> <a href="download.html"
target="_top">Downloads</a> <a href="contact.html"
target="_top">Contact</a><br>');
// -- END -->

I want the linked headers, Home, The Company, Products, Downloads and
Contact to be spaced apart more horizontally, maybe 10 spaces or so so
it doesn't look like a strange sentence. Can this be done?


Yes, but that does not make it a javascript question.
Putting a piece of HTML in document.write() doesn't help a bit.

Look at and in their NGs: HTML and CSS.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 14 '06 #2

P: n/a
You will want to set the word-spacing property of class header to some
value greater than 0.

http://www.w3.org/TR/CSS2/text.html#spacing-props

Mar 14 '06 #3

P: n/a
JRS: In article <11**********************@e56g2000cwe.googlegroups .com>
, dated Tue, 14 Mar 2006 08:37:17 remote, seen in
news:comp.lang.javascript, DigMar <in**@digitalmarketing1.com> posted :
Thi is a newbie question regarding the spacing of words in a header
with links. I simply want to space the clickable words on my header bar
more horizontally. Here is my code to make more sense:

// HEADER MENU OPTIONS

document.write('<span class="header">');
document.write('<a href="index.html" target="_top">Home</a> <a
href="about.html" target="_top">The Company</a> <a
href="products.html"target="_top">Products</a> <a href="download.html"
target="_top">Downloads</a> <a href="contact.html"
target="_top">Contact</a><br>');
// -- END -->
I want the linked headers, Home, The Company, Products, Downloads and
Contact to be spaced apart more horizontally, maybe 10 spaces or so so
it doesn't look like a strange sentence. Can this be done?


Not really a javascript question; there might be a javascript answer.

When posting code, don't allow your agent to wrap lines; posted code
should be directly executable. See FAQ.

You could pad the gaps with alternate   (or &nbsp;) and space;
adding a pair of those should be enough.

You could deem it a Table, and mark it as such; that way, you could get
forms of spacing other than equal-gap.

You could use CSS, but you'll then have to consider whether the required
form of spacing is available in all target browsers. Word-spacing,
which you ask for, will probably not be satisfactory with an entry like
"The Company", but might be so with "The&nbsp;Company".

Your script could be compacted by setting, for example,
S1 = 'target="_top"' and using that repeatedly - only the filename and
the visible string need to be given each time. Not worthwhile for a
single use, but could be if multiply-used.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.