Spacing Words in Header

D

DigMar

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
 
E

Evertjan.

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.
 
D

Dr John Stockton

JRS: In article <[email protected]>
, dated Tue, 14 Mar 2006 08:37:17 remote, seen in
news:comp.lang.javascript said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top