/    Sign up×
Community /Pin to ProfileBookmark

Dumb question, most likely

I wasn’t quite sure if this should go in the javascript or CSS section:

I have PHP script that will take every post on my site and make a DIV tag for it. The script also generates a menu for each post and gives that a unique ID. Javascript is required to make the menu appear and it references the menu by its ID so they must be unique. However, the CSS for every menu is the same. Is there a way to apply the same CSS to each menu even though they have different IDs (I don’t want to generate CSS for each menu)? If not, is there something else I can have the javascript reference the menu by besides the ID? It needs to be able to change the style of the menu in realtime. Thanks!

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@ray326Sep 22.2006 — Use a class.
Copy linkTweet thisAlerts:
@FiZiXauthorSep 22.2006 — Wow, why didn't I think of that? Thanks!
×

Success!

Help @FiZiX spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...