navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Adding a class to a menu

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Adding a class to a menu
Page: [1]
 
MCD

 

Posts: 672
Joined: 3/19/2002
From: Al USA
Status: offline

 
Adding a class to a menu - 8/30/2005 17:04:19   
I need to add a background image (arrow) to a few of the links on a popout menu. I have tried what seems everything and I'm still not getting what I need. Can anyone offer a suggestion or tell me why this doesn't work?

CSS Code

#nav a.arrow {
background-image: url(../arrow.gif) center right no-repeat;
}


In my HTML I simply called the class:

HTML
<li><a class="arrow" href="#">Link 1</a>


BTW - The rest of the menu is working fine.

_____________________________

Author of " How To Build A Website With Duct Tape"
Tailslide

 

Posts: 6270
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 3:23:51   
Hi again!

CSS:

#nav a.arrow {background: url(../arrow.gif) no-repeat right center;}


Your HTML is right.

Here it is working: Test Page

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to MCD)
MCD

 

Posts: 672
Joined: 3/19/2002
From: Al USA
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 10:38:34   
Yep, still me Tailside and I am now past hair pulling stage. I know you are now happy. :)

I cannot see any difference in your declaring a class and mine. Here they both are:

Mine
#nav a.arrow {background: url(../images/arrow.gif) no-repeat right center;}

Yours
#nav a.arrow {background: url(rightarrow.gif) no-repeat right center; }

I am obviously missing something but no matter how much I study your code and other websites I cannot find it.

_____________________________

Author of " How To Build A Website With Duct Tape"

(in reply to Tailslide)
Tailslide

 

Posts: 6270
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 10:45:00   
Hi

See I told you CSS was fun! :)

On your example at the start of this thread your code was slightly different:

#nav a.arrow {background-image: url(../arrow.gif) center right no-repeat;}

note the background-image rather than just background. Did you take out the "-image" from your original CSS?

Edit: Just checked on your site itself - the CSS looks fine but I can't see the classes on the /staff.asp page - can you show us your test page?

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to MCD)
d a v e

 

Posts: 4167
Joined: 7/24/2002
From: England (but live in Finland now)
Status: online

 
RE: Adding a class to a menu - 8/31/2005 10:52:16   
btw, a # hash (or octothorpe, or whatever...) is for an id i.e. a unique instance of that 'thingy' on a page. a class begins with a period/full stop

.class
#id

_____________________________

David Prescott
Gekko web design

(in reply to Tailslide)
Tailslide

 

Posts: 6270
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 10:53:59   
Dave - the #nav is for the <ul id="nav"> and the .arrow is the class for the link with the right arrow attached.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to d a v e)
d a v e

 

Posts: 4167
Joined: 7/24/2002
From: England (but live in Finland now)
Status: online

 
RE: Adding a class to a menu - 8/31/2005 10:55:55   
oops sorry not concentrating - too busy listening to music while i was half reading the css.
:)

_____________________________

David Prescott
Gekko web design

(in reply to Tailslide)
MCD

 

Posts: 672
Joined: 3/19/2002
From: Al USA
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 10:57:45   
I have continued to dicker and study so it is slightly different. You can see my pages at:
www.fbcspringville.com/staff.asp

_____________________________

Author of " How To Build A Website With Duct Tape"

(in reply to Tailslide)
d a v e

 

Posts: 4167
Joined: 7/24/2002
From: England (but live in Finland now)
Status: online

 
RE: Adding a class to a menu - 8/31/2005 10:59:18   
quote:

dicker
are you allowed to say that sort of thing on a forum? ;)

_____________________________

David Prescott
Gekko web design

(in reply to MCD)
Tailslide

 

Posts: 6270
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 11:19:06   
Only thing is that the classes are missing from the links - should be like this:

<div id="navigation">
    <ul id="nav">
          <li><a href="index.asp">Home</a></li>
          <li><a href="staff.asp">Staff</a></li>
          <li><a href="calendar/index.asp">Calendar</a></li>
          <li><a href="prayer.asp">Prayer Requests</a></li>
          <li><a href="newsletter/default.asp">Newsletter</a></li>
          <li><a href="#" class="arrow">Ministries</a>
                 <ul>
                 <li><a href="gods_kids.asp">God's Kids</a></li>
                 <li><a href="little_chapel.asp">Little Chapel</a></li>
                 <li><a href="children.asp">Children</a></li>
                 <li><a href="student.asp">Students</a></li>
                 <li><a href="seniors.asp">Senior Adults</a></li>
                 <li><a href="music.asp">Music</a></li>
                 <li><a href="discipleship.asp">Discipleship</a></li>
                 <li><a href="evangelism.asp">Evangelism</a></li>
                 </ul>
          </li>
          <li><a href="#" class="arrow">Resources</a>
                  <ul>
                  <li><a href="bpnews.asp">Baptist Press</a></li>
                  <li><a href="history.asp">History</a></li>
                  <li><a href="links.asp">Links</a></li>
                  </ul>
          </li>
          <li><a href="salvation.asp">Seeking Jesus?</a></li>
          <li><a href="contact.asp">Contact Us</a></li>
          </ul>


Your CSS looks exactly right to me. Only other thing to check is the path to the image.



_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to d a v e)
Tailslide

 

Posts: 6270
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 11:22:08   
quote:

ORIGINAL: d a v e

oops sorry not concentrating - too busy listening to music while i was half reading the css.
:)


You youngsters (shakes fist in the air at no-one in particular)!

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to d a v e)
MCD

 

Posts: 672
Joined: 3/19/2002
From: Al USA
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 16:32:02   
The problem seems to be that the navigation is in a FP include. Is there any solution to that problem?

I got it to work in a single page without the include page.

< Message edited by MCD -- 8/31/2005 17:38:25 >


_____________________________

Author of " How To Build A Website With Duct Tape"

(in reply to Tailslide)
MCD

 

Posts: 672
Joined: 3/19/2002
From: Al USA
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 17:53:07   
Here is the solution to this mess. My FP was not updating my "include." Once I published the include by right clicking it telling FP to publish the file everything was okay.

Thanks Tailslide for ALL your help. I learned a lot. I also found out I have a lot to learn and that CSS menus have endless possibilities.

_____________________________

Author of " How To Build A Website With Duct Tape"

(in reply to MCD)
caz

 

Posts: 3578
Joined: 10/10/2001
From: Somewhere south of Chester, UK
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 18:01:30   
Well that explains the odd image path for the arrow, it didn't correspond with the rest of your images on that page.
I was just about to post this, -The path to other images on that page is "images/imagename.ext", not "../images/imagename.ext". Is that the problem?
Congratulations, I felt your pain. Gotta love FP.
:)

_____________________________

Do not meddle in the affairs of cats, for they are subtle and will dance, or more on your keyboard.
Cheshire cat. www.doracat.co.uk

I remember when it took less than 4hrs to fly across the Atlantic.

(in reply to MCD)
Tailslide

 

Posts: 6270
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Adding a class to a menu - 8/31/2005 18:17:21   
quote:

ORIGINAL: MCD
Thanks Tailslide for ALL your help. I learned a lot. I also found out I have a lot to learn and that CSS menus have endless possibilities.


No problem - glad it all worked out!


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to MCD)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Adding a class to a menu
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts