This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > February 2006 > why isnt this working?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author why isnt this working?
wadup

2006-02-24, 10:16 pm

i normally use a span to define "you are here" on my menu....i am working on a
new project with a couple more things than normal in the menu items and my span
isnt working.....

does any one know why and if not another way to achieve this? the site is
http://www.saysocreative.com/clients/refuge/

and attached is the code



#main_links ul {
margin:0;
padding:0;
list-style:none;

}

#main_links ul li {
padding:0 0 0 0;
margin:0 5.1px 0 0;
float:left;
text-decoration:none;
background:black;
}

#main_links ul li a {
padding:0 0 0 0;
margin:0 0px 0 0;
display:block;
height:31px;
width:88px;
font:12px "Comic Sans MS";
color:black;
font-weight:bolder;
text-align:center;
text-decoration:none;
background:black url(../images/tabs.gif) 0 0 no-repeat;
}

#main_links ul li a:hover {
color:black;
text-decoration:none;
background-position:0 -33px;
}

#main_links ul li a:active {
background-position:0 0;
color:white;
}

#main_links p {
padding:8px 0 0 0;
border:0;
margin:0;
}




<div id="main_links">

<ul>
<li><a href="#"><p>refuge, who?</p></a></li>
<li><a href="#"><p>vision</p></a></li>
<li><a href="#"><p>leaders</p></a></li>
<li><a href="#"><p>weekly word</p></a></li>
<li><a href="#"><p>say cheese</p></a></li>
<li><a href="#"><p>c-u-there</p></a></li>
<li><a href="#"><p>check me out</p></a></li>
<li><a href="#"><p>say what</p></a></li>

</ul>
</div>

PeteC

2006-02-24, 10:16 pm

wadup wrote:
> i normally use a span to define "you are here" on my menu....i am
> working on a new project with a couple more things than normal in the
> menu items and my span isnt working.....


Can't see any <span> in your code or css.

On the website, there is a roll-over, which changes the background of each
button from orange to yellow, and if I click on a button the text goes
white. That bit seems to be working OK.

Regards,

Pete.
--
Peter Connolly
http://www.acutecomputing.co.uk
Derby
UK
Skype ID: acutecomputing


wadup

2006-02-24, 10:16 pm

i took the span out because it wasnt working......i left it blank so that
anyone can give thier suggestions....

the rollovers are working perfectly.....

what i need the span for is to get the green tab to show so that the user
knows what section he is in.....i normally use a span class to do this, i have
seen some people use <li id="whatever"> </li> to do this also.....

i tried both and neither worked.......

this is the first time i am using the one image technique to do roll
overs.....so obviously it has somehtign to do with that.....

any help will be great....


Tim G

2006-02-25, 3:14 am


"wadup" <webforumsuser@macromedia.com> wrote in message
news:dto8tp$qt2$1@forums.macromedia.com...
>i took the span out because it wasnt working......i left it blank so that
> anyone can give thier suggestions....
>
> the rollovers are working perfectly.....
>
> what i need the span for is to get the green tab to show so that the user
> knows what section he is in.....i normally use a span class to do this, i
> have
> seen some people use <li id="whatever"> </li> to do this also.....
>
> i tried both and neither worked.......
>
> this is the first time i am using the one image technique to do roll
> overs.....so obviously it has somehtign to do with that.....
>
> any help will be great....


I don't know if I'm having a problem with my newsreader or not.... did you
get an answer to this?

tim


Tim G

2006-02-25, 3:14 am

Hmm. Looks like you didn't get any further help here.

Forget spans.

I'm sure there's an easy tutorial on this somewhere, but I don't know where
offhand, so here goes....

An easy way to mark an "on state" for a page is to give all your links
individual IDs and then give the body tag an ID on each page (if you're
using DW templates, you will need to make the body ID an editable
attribute).

For example, let's say your links are in an unordered list. You might work
with them like so:

<ul>
<li id="homelink"><a href="home.htm" title="home page">home</a></li>
<li id="contactlink"><a href="contact.htm" title="contact us">contact
us</a></li>
...etc
</ul>

If you're not using templates, the other HTML step is simple; e.g.:

<body id="homepage">

If you're using DW templates, go to code view, select <body>, go to Modify >
Templates > Make Attribute Editable. Click Add..., type id, then type a
default name in the Label and Default fields (I usually just type "page",
since all my page IDs end this way).

When you need to modify the body ID (i.e. when you create a new page), you
will go to Modify > Template Properties and type in your ID name (e.g.
homepage).

Okay, now to the CSS. You have two sets of IDs that you can use to control
your "on" state. So your CSS will look something like this:

#homepage #homelink a, #homepage #homelink a:hover, #contactpage
#contactlink a, #contactpage #contactlink a:hover [etc etc] {
\\** your CSS on state styles here **\\
font-weight: bold;
color: red;
background-color: #fff;
}

Notice carefully how you have to do things above: after each comma, you must
give the entire "naming chain" in order for this to work, and work only
where you intend it to work.

Hint: since the person is on the given page, you don't want the link for
that particular page to look like a link choice, meaning you want a default
cursor. So you can add that to your style:

cursor: default;

HTH,

tim


Murray *TMM*

2006-02-25, 6:14 pm

It's much easier, Tim, to just add a little embedded stylesheet in the head
of each child document and explicitly set the down button's style there.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Tim G" <webservicesNOSPAM@pactumgroup.com> wrote in message
news:dtp2oq$psm$1@forums.macromedia.com...
> Hmm. Looks like you didn't get any further help here.
>
> Forget spans.
>
> I'm sure there's an easy tutorial on this somewhere, but I don't know
> where offhand, so here goes....
>
> An easy way to mark an "on state" for a page is to give all your links
> individual IDs and then give the body tag an ID on each page (if you're
> using DW templates, you will need to make the body ID an editable
> attribute).
>
> For example, let's say your links are in an unordered list. You might work
> with them like so:
>
> <ul>
> <li id="homelink"><a href="home.htm" title="home page">home</a></li>
> <li id="contactlink"><a href="contact.htm" title="contact us">contact
> us</a></li>
> ..etc
> </ul>
>
> If you're not using templates, the other HTML step is simple; e.g.:
>
> <body id="homepage">
>
> If you're using DW templates, go to code view, select <body>, go to Modify
> default name in the Label and Default fields (I usually just type "page",
> since all my page IDs end this way).
>
> When you need to modify the body ID (i.e. when you create a new page), you
> will go to Modify > Template Properties and type in your ID name (e.g.
> homepage).
>
> Okay, now to the CSS. You have two sets of IDs that you can use to control
> your "on" state. So your CSS will look something like this:
>
> #homepage #homelink a, #homepage #homelink a:hover, #contactpage
> #contactlink a, #contactpage #contactlink a:hover [etc etc] {
> \\** your CSS on state styles here **\\
> font-weight: bold;
> color: red;
> background-color: #fff;
> }
>
> Notice carefully how you have to do things above: after each comma, you
> must give the entire "naming chain" in order for this to work, and work
> only where you intend it to work.
>
> Hint: since the person is on the given page, you don't want the link for
> that particular page to look like a link choice, meaning you want a
> default cursor. So you can add that to your style:
>
> cursor: default;
>
> HTH,
>
> tim
>
>



wadup

2006-02-25, 6:14 pm

Tim, thanks for your help......it doesnt answer the posed question however it
provided good insight as to another way to do it.....

Murry can you expand on your statment?

and also give it a shot to get the "hover" state to stay so the user knows
"you are here"



Murray *TMM*

2006-02-25, 6:14 pm

Consider this template snippet -

<!-- TemplateBeginEditable name="head" -->
<style type="text/css">
<!--
a#button1 { down-state-styles-here }
-->
</style>
<!-- TemplateEndEditable -->

and this HTML for your menu -

....<a href="link1.html" id="button1">
....<a href="link2.html" id="button2">
....<a href="link3.html" id="button3">

Since the stylesheet is embedded in the editable region of the template, it
will be written into each new child page. Since it's in an editable region,
it will be editable on each child page. This will let you simply adjust the
button ID number to set the menu....

Geddit?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"wadup" <webforumsuser@macromedia.com> wrote in message
news:dtppdo$omg$1@forums.macromedia.com...
> Tim, thanks for your help......it doesnt answer the posed question however
> it
> provided good insight as to another way to do it.....
>
> Murry can you expand on your statment?
>
> and also give it a shot to get the "hover" state to stay so the user knows
> "you are here"
>
>
>



wadup

2006-02-25, 6:14 pm

geddit!


So you gonna try an take a shot at my original problem? which is making the button stay on the "down" state for the page the user is on?

thanks for the help though....
Murray *TMM*

2006-02-25, 6:15 pm

Uhh - isn't that what I just did?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"wadup" <webforumsuser@macromedia.com> wrote in message
news:dtpv7v$2ac$1@forums.macromedia.com...
> geddit!
>
>
> So you gonna try an take a shot at my original problem? which is making
> the button stay on the "down" state for the page the user is on?
>
> thanks for the help though....



wadup

2006-02-25, 6:15 pm

no you showed me a more efficient way of doing my "you are here" coding....

my original question is that i cant get my "you are here" button state to
work......my first post i included the link to the site and al the css i
used......i excluded any attempt to try it in the code to clear the code up.....

Murray *TMM*

2006-02-25, 6:15 pm

Change this (in the stylesheet) -

#current_links ul li a

to this -

ul li#current_links a


--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"wadup" <webforumsuser@macromedia.com> wrote in message
news:dtq12k$4gf$1@forums.macromedia.com...
> no you showed me a more efficient way of doing my "you are here"
> coding....
>
> my original question is that i cant get my "you are here" button state to
> work......my first post i included the link to the site and al the css i
> used......i excluded any attempt to try it in the code to clear the code
> up.....
>



Tim G

2006-02-25, 6:15 pm


"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:dtpk0a$i45$1@forums.macromedia.com...
> It's much easier, Tim, to just add a little embedded stylesheet in the
> head of each child document and explicitly set the down button's style
> there.


Hey, I just told 'em how to do it the way you taught me last year. I guess
I'm not keeping up! ;)

Actually, tho, I kind of like the old method. A more work in the original
CSS, but less stuff in the HTML page.

Thanks, Murray.

tim


Murray *TMM*

2006-02-25, 6:15 pm

8)

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Tim G" <webservicesNOSPAM@pactumgroup.com> wrote in message
news:dtqako$g5h$1@forums.macromedia.com...
>
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:dtpk0a$i45$1@forums.macromedia.com...
>
> Hey, I just told 'em how to do it the way you taught me last year. I guess
> I'm not keeping up! ;)
>
> Actually, tho, I kind of like the old method. A more work in the original
> CSS, but less stuff in the HTML page.
>
> Thanks, Murray.
>
> tim
>



wadup

2006-02-25, 6:15 pm

Murrary it worked! thanks a million once again....

rather than just fixing the problem i want to learn in the mean time....

why wouldnt "#current_links ul li a" work vs "ul li#current_links a"??



Murray *TMM*

2006-02-25, 10:14 pm

The former says to find an element with id="current_links", within which is
a <ul> within which is a <li> within which is an <a>. That's clearly wrong.

The latter says to find a <ul> within which is an <li id="current_links">
within which is an <a>, and that's what you have - which is why it worked.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"wadup" <webforumsuser@macromedia.com> wrote in message
news:dtqmcr$124$1@forums.macromedia.com...
> Murrary it worked! thanks a million once again....
>
> rather than just fixing the problem i want to learn in the mean time....
>
> why wouldnt "#current_links ul li a" work vs "ul li#current_links a"??
>
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews