Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,994 members, 7,828,510 topics. Date: Wednesday, 15 May 2024 at 10:45 AM

Need Help With My Class Selector Not Working In Css - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Need Help With My Class Selector Not Working In Css (457 Views)

How To Apply Border, Margin And Padding Properties In CSS / Aside, Media Query In Css How Do I Create A Responsive Website? / Can You Survive If You Stopped Working In Tech? (2) (3) (4)

(1) (Reply) (Go Down)

Need Help With My Class Selector Not Working In Css by Depressedkidd: 10:18pm On Feb 08, 2021
I'm new to html CSS.
I have this html line

<header>
<Section>
<Nav>
<Ul>
<Li class="sitenav"><a href="register.html">Register</a></li>
</Ul>
</Nav>
</Section>
</Header>

And the CSS goes something like this

.sitenav{
Border-style: solid;
}


But that doesn't work, all tags are closed properly and I can't seem to find the problem.

If I replace the ".sitenav" selector with a regular "li" selector in my css, it works. Please anyone know what the issue could be?
Re: Need Help With My Class Selector Not Working In Css by Nobody: 10:52pm On Feb 08, 2021
Maybe you need to recheck your syntax well.
And watch for capitalizations too.
Seems to work here.

1 Like

Re: Need Help With My Class Selector Not Working In Css by LongD(m): 8:13am On Feb 09, 2021
Depressedkidd:
I'm new to html CSS.
I have this html line

<header>
<Section>
<Nav>
<Ul>
<Li class="sitenav"><a href="register.html">Register</a></li>
</Ul>
</Nav>
</Section>
</Header>

And the CSS goes something like this

.sitenav{
Border-style: solid;
}


But that doesn't work, all tags are closed properly and I can't seem to find the problem.

If I replace the ".sitenav" selector with a regular "li" selector in my css, it works. Please anyone know what the issue could be?
Try giving it thickness e.g. 1px. Also add a color. The default is white I think, so if your background color is white also you'll see nothing.

1 Like

Re: Need Help With My Class Selector Not Working In Css by Nobody: 8:48am On Feb 11, 2021
There is no # tag in your code

(1) (Reply)

Web Developer Needed / How Amateurs Are Making $100k Selling Apps With No Coding Knowledge / Edukero Marketing & Sales Programs

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.