/    Sign up×
Community /Pin to ProfileBookmark

Ok, on my site, I have to use the following on a list-item in an unordered list(this way works):

[code]<li style=”padding-left:5px; border:1px solid #000; border-left:0; border-bottom:0; width:145px; background-color:#c33; color:#fff;”>[/code]

I tried putting this in a stylesheet:

[code].menuHeader {
padding-left:5px;
border:1px solid #000;
border-left:0;
border-bottom:0;
width:145px;
background-color:#c33;
color:#fff;
}[/code]

And this in the HTML:

[code]<li class=”menuHeader”>[/code]

But, for some reason, it doesn’t apply the class attributes, and treats it like a normal list-item. Any ideas? Thanx in advance,
-Dan

to post a comment
CSS

16 Comments(s)

Copy linkTweet thisAlerts:
@NedalsMar 29.2004 — Worked for me in both Mozilla and IE6 with and without the <ul> tag.

ie: list of white text on a red, bordered background.
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — [i]Originally posted by Nedals [/i]

[B]Worked for me in both Mozilla and IE6 with and without the <ul> tag.

ie: list of white text on a red, bordered background. [/B]
[/QUOTE]

Thanx, but is it proper to leave out the <ul> tag? I want to keep my site valid.

-Dan
Copy linkTweet thisAlerts:
@David_HarrisonMar 29.2004 — I made a little page with what you posted and I don't have any such difficulty. You got a page with this problem on?

[upl-file uuid=f3347246-8a0f-43aa-919b-9749d502471f size=757B]no error.txt[/upl-file]
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — [i]Originally posted by lavalamp [/i]

[B]I made a little page with what you posted and I don't have any such difficulty. You got a page with this problem on? [/B][/QUOTE]

Ok, I've modified the second heading on the menu of [url=http://216.36.173.149/]my website[/url]. As you can see, it isn't applying the class atributes to the <li>.

-Dan

PS: Mite wanna look as soon as you can, because I'll be changing it back after a while
Copy linkTweet thisAlerts:
@pyroMar 29.2004 — I don't see a menuHeader class in your CSS anywhere...
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — [i]Originally posted by pyro [/i]

[B]I don't see a menuHeader class in your CSS anywhere... [/B][/QUOTE]

[i]From http://216.36.173.149/styles.css[/i]

<snip>

[b].menuheader {

padding-left:5px;

border:1px solid #000;

border-left:0;

border-bottom:0;

width:145px;

background-color:#c33;

color:#fff;

}[/b]
[/quote]

[b]**EDIT**[/b]

Ok, I'm changing it back now, but you can find a copy of the faulty page [url=http://216.36.173.149/ocrap.php]here[/url].

-Dan
Copy linkTweet thisAlerts:
@pyroMar 29.2004 — You must not have uploaded the latest styles.css, as it still is not there. [FONT=courier new].menuTitle[/FONT] is, though...
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — [i]Originally posted by pyro [/i]

[B]You must not have uploaded the latest styles.css, as it still is not there. [FONT=courier new].menuTitle[/FONT] is, though... [/B][/QUOTE]

Have you refreshed? It's there for me!

-Dan
Copy linkTweet thisAlerts:
@Paul_JrMar 29.2004 — The class isn't being applied in the Mark-Up.
Copy linkTweet thisAlerts:
@pyroMar 29.2004 — Ah, I see the problem (now that I can see the correct CSS).

[font=monospace].menuheader[/font] is not as specific of a rule as [font=monospace]#nav ul li[/font], so it is using the [font=monospace]#nav ul li[/font] instead. It will use the more specific of the two rules. Change [font=monospace].menuheader[/font] to [font=monospace]#nav ul li.menuheader[/font] and it should be fine.
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — OK! THANX (again) RYAN!

-Dan

[b]**EDIT**[/b]

NOT WORKING?
Copy linkTweet thisAlerts:
@pyroMar 29.2004 — There's no space in [font=monospace]li.menuheader[/font]
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — Yeah there is! I had it with no space a while ago to see if it worked, but there's one there now, and it still doesn't work?

-Dan
Copy linkTweet thisAlerts:
@pyroMar 29.2004 — There is [b]not[/b] supposed to be a space there. Sorry about my wording above - I just reread it and it's very confusing.
Copy linkTweet thisAlerts:
@Daniel_TauthorMar 29.2004 — Oh, OK! Now it's workin! Thanx Ryan!

-Dan
Copy linkTweet thisAlerts:
@pyroMar 29.2004 — Sure thing. ?
×

Success!

Help @Daniel_T 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...