External file links inheriting CSS - how to stop?

T

Tom

I'm calling an external .js file with plain html links for my
navigation text area (so I can update it across the site more easily),
but the links are "inheriting" my css hyperlink qualities. I
specifically want them NOT to be bold. What code would I add into my
external .js file to change the font of the navigation links to NOT
bold? I tried sticking in <font="normal"> in front, but that didn't
work. I'm a JS newbie, by the way.

Thanks,
Tom
 
D

DB McGee

Tom said:
I'm calling an external .js file with plain html links for my
navigation text area (so I can update it across the site more easily),
but the links are "inheriting" my css hyperlink qualities. I
specifically want them NOT to be bold. What code would I add into my
external .js file to change the font of the navigation links to NOT
bold? I tried sticking in <font="normal"> in front, but that didn't
work. I'm a JS newbie, by the way.


This sounds like a CSS issue to me. You need to define some CSS styles to
apply specifically to the navigation text anchors.

For example:

a.navtext { font-weight: normal; }

Then in the HTML for your navigation text:

<a class="navtext" href="#">Nav Text</a>
 
T

Tom

Thanks for the response, DB:

I'm not sure where you mean to insert the

<a class="navtext" href="#">Nav Text</a>

or what href you mean (each individual one below?)...

Here's my .js file:


document.write('<b><font color="#356666" face="Verdana"
size="2">Departments:</font></b> ' + '<a
href="computer-and-electronics.html">Computer & Electronics</a>' + ' |
<a href="apparel-and-accessories.html">Apparel & Accessories</a>' + ' |
<a href="home-and-garden.html">Home & Garden</a>' + ' | <a
href="kids-and-baby.html">Kids & Baby</a>' + ' | <a
href="sports-and-outdoors.html">Sports & Outdoors</a>' + ' | <a
href="health-and-beauty.html">Health & Beauty</a>' + ' | <a
href="flowers-and-gifts.html">Flowers & Gifts</a>' + ' | <a
href="shopping-malls-and-department-stores.html">Shopping Malls &
Department Stores</a></font>');

Could you clarify?

Thanks again,
Tom

All-Internet Shopping Directory
http://www.all-internet.com
 
D

DB McGee

Thanks for the response, DB:

I'm not sure where you mean to insert the

<a class="navtext" href="#">Nav Text</a>

or what href you mean (each individual one below?)...

Here's my .js file:


document.write('<b><font color="#356666" face="Verdana"
size="2">Departments:</font></b> ' + '<a
href="computer-and-electronics.html">Computer & Electronics</a>' + ' |
<a href="apparel-and-accessories.html">Apparel & Accessories</a>' + ' |
<a href="home-and-garden.html">Home & Garden</a>' + ' | <a
href="kids-and-baby.html">Kids & Baby</a>' + ' | <a
href="sports-and-outdoors.html">Sports & Outdoors</a>' + ' | <a
href="health-and-beauty.html">Health & Beauty</a>' + ' | <a
href="flowers-and-gifts.html">Flowers & Gifts</a>' + ' | <a
href="shopping-malls-and-department-stores.html">Shopping Malls &
Department Stores</a></font>');

Could you clarify?


For each of the anchor tags in that javascript block, add a class
declaration:

eg. <a class="navtext" href="computer-and-electronics.html">Computer &
Electronics</a>

Then you just need to add the CSS class declaration 'navtext' to your CSS
file.
 
F

Fabian

Tom Brown hu kiteb:
DB:
Could you please edit out my email address from your post?

Tom,

Once posted, you can't edit a post. Oh, you can send a cancel notice,
but not all news servers honour those, and in any case it will remain in
google forever.

Your only real solution is not to put your email address anywhere you
might reasonably expect it to be harvested. Putting a used email address
on usenet (no, your headers are not safe) is really asking for trouble.
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top