473,700 Members | 2,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Spacing Words in Header

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.htm l" target="_top">H ome</a> <a
href="about.htm l" target="_top">T he Company</a> <a
href="products. html"target="_t op">Products</a> <a href="download. html"
target="_top">D ownloads</a> <a href="contact.h tml"
target="_top">C ontact</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
3 1555
DigMar wrote on 14 mrt 2006 in comp.lang.javas cript:
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.htm l" target="_top">H ome</a> <a
href="about.htm l" target="_top">T he Company</a> <a
href="products. html"target="_t op">Products</a> <a href="download. html"
target="_top">D ownloads</a> <a href="contact.h tml"
target="_top">C ontact</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
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
JRS: In article <11************ **********@e56g 2000cwe.googleg roups.com>
, dated Tue, 14 Mar 2006 08:37:17 remote, seen in
news:comp.lang. javascript, DigMar <in**@digitalma rketing1.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.htm l" target="_top">H ome</a> <a
href="about.ht ml" target="_top">T he Company</a> <a
href="products .html"target="_ top">Products</a> <a href="download. html"
target="_top"> Downloads</a> <a href="contact.h tml"
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;Compa ny".

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.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1517
by: Ding Lei | last post by:
Hello folks, I am using xml for a newsletter, along with a xsl file to display it in a browser. In the xml file, a newline, tab or whitespace character all causes exactly one spacing between two words. That's generally OK for English or other european languages. But since I am using Chinese, in our convention, there shall not be any spacing between two Chinese words. but I definitely won't my xml file being messed up with very very long...
2
3406
by: Ryan | last post by:
(Sorry if this gets posted twice. News server acted up on me.) Greetings - I am in the last stages of developing a site for a musician, and I have a few questions. Site in question: http://www.chancesend.com/test/info.html (I am aware that none of the top navigation links work. I am also aware that the Mailing List portion does not work. I just haven't gotten
5
12111
by: Poonam | last post by:
Hi there. How can i maintain the spacing between to divs if palced side by side with 10px spacing between them.. Not using any tables. And atleast making one of the div relative positioning. Tks poonam.
3
2193
by: JBH | last post by:
I'm having difficulty removing spacing between two rows in a table. Below is a copy of my source code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>About Isadore Gallery</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="keywords" content="history of Isadore Gallery, about
2
1504
by: Lumpierbritches | last post by:
Thank you in advance for any and all assistance. I'm trying to create a report that will work similar to the label wizard in Access. I have a premade form I'm attempting to fill with data from the db. I can manually make the information fit, by making the report the full 8.5" x 11", however, when I attempt to size the report so that an individual record prints in each one, the sizing is all off. Is there a secret for dividing up the report...
1
2642
by: David Gibson | last post by:
Hi, Is there a function to remove double spacing between some names in a text field. I have a text field with names where the name can be 1, 2, 3 or rarely 4 words & there is dounle spacing between them. I wish to trim out the double spacing to single. The TRIM functions I have found only seem to work on left or right, ie leading or trailing spaces.
2
1642
by: Greg Linwood | last post by:
I'm using a Data Grid and want to apply wider spacing between columns than rows. As such, cellspacing / padding aren't any use to me. I used to do this in html tables by simply adding columns with a single point transparent .gif, set to a specific .pt width. This worked very well for precise alignment. I can't find an easy way to do this using a DataGrid. It is possible for me to add columns (I'm doing this at run-time) but the darned...
10
11046
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way to do that in CSS without having to code in extra dummy columns in HTML to create gutters? -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ ...
4
2200
by: Mamluk Caliph | last post by:
For quite some time I've used code as the following to be able to "cut&paste" parts from different headerfiles of the same name. It has worked with GCC, MS, Borland, Keil to name a few. In principle the mechanism looks like this: #define CHAINPATH /usr/include #define DEFSTR( x ) \ #x
0
8731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8648
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9218
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7816
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4660
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2031
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.