I am trying to target h4 tags within a ul li. I want the list items to have a bullet point but I want the h4 tag li’s to have no list styling. I have tried this css but the list styling still appears on the li’s with a h4 tag inside. Am I missing something here?
Many thanks betzster. I used your second suggestion, to avoid having lots of lists and it worked perfectly. I didn’t think about putting non li elements within a ul. Cheers.
But putting an h4 tag inside a ul without being in a list item doesn’t validate. You can put a class on the list item with the h4 in it and target it that way. You can also put in an if else statement with php or use javascript although those last 2 aren’t very semantic. I’d probably just go with a class unless not validating properly isn’t a concern for you.
Author
Posts
Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘CSS’ is closed to new topics and replies.