3 replies [Last post]
emma23
emma23's picture
Offline
newbie
Last seen: 12 years 7 weeks ago
Timezone: GMT-4
Joined: 2010-06-22
Posts: 2
Points: 3

I am using a dwt, and I am trying to get the font for each item in the navation bar to be bold when that link's page is active. I have used this same code before on another site, and it works. I don't know why it isn't working here.

I have this code in my master.dwt:

<div id="navigation">
<ul>
<li><a href="default.html" id="homelink">home</a></li>
<li><a href="gallery/gallery.htm" id="gallerylink">gallery</a></li>
<li><a href="about/about.htm" id="aboutlink">about</a></li>
<li><a href="contact/contact.htm" id=contactlink">contact</a></li>
</ul>

On each of my pages, I use code to reference the ID. For example, #aboutlink on the About page:

<!-- #BeginTemplate "../master.dwt" -->
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<!-- #BeginEditable "doctitle" -->
<title>About</title>
<style type="text/css">
#aboutlink {font-weight: bold;}
</style>
<!-- #EndEditable -->
<link href="../styles/style2.css" rel="stylesheet" title="CSS" type="text/css" />
</head>

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 3 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Well. If you were to have

Well. If you were to have validated your HTML like we ask, you would notice you are missing a quote before your id on the last LI.

That being said. Nothing in your code shows anyway of targeting the "current page".
Since each of your anchors have IDs, you could give your body a different id for each page and then match them up based off of that.

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

emma23
emma23's picture
Offline
newbie
Last seen: 12 years 7 weeks ago
Timezone: GMT-4
Joined: 2010-06-22
Posts: 2
Points: 3

I realize the quote is

I realize the quote is missing. I just typed that here for an example. That is not the problem.

I don't know what you mean by "targeting the current page." The code is on the current page. And I cannot add and ID to the body when I am using a dynamic web template.

Sorry, I am a real beginner at this.

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 24 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

We can't solve anyone's

We can't solve anyone's problems unless we have what we need to diagnose those problems. We have sticky messages in each sub-forum that tells you what we need. Have you read them?

If not, why not?

If so, why aren't you giving us what we ask for?

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.