quick css questions

Hey, i just a few quick questions 1) is there a way to select an element based off of whether it's a certain count of one on the page? I know nth-child and nth-of-type do this, but only if the elements are siblings. If i wanted to select the 3rd p element on the whole page for example, would that be possible? maybe it's with that of selector that's floating around? 2) I've noticed that if you have a list inside of another list, the child's ul/ol element will have it's user agent margin removed, what causes this? is it because of the way sub-lists work? https://codepen.io/deerCabin/pen/wvVRoVG Thanks in advance.
12 Replies
ἔρως
ἔρως7d ago
1- no, not without javascript 2- pure css it has a simple ul ul selector to remove the margins thats it
snxxwyy
snxxwyyOP7d ago
that's what i was thinking, but i thought there was a css for some reason haha oh that makes sense, where can i see the whole user agent stylesheet to find these styles? i know you can see snippets in the dev tools but is there a whole css file or something?
ἔρως
ἔρως7d ago
snxxwyy
snxxwyyOP7d ago
ah that's super useful, thank you
ἔρως
ἔρως7d ago
you're welcome if you search for ul ul, you will see the style that removes the margins
snxxwyy
snxxwyyOP7d ago
ah yeah i see now
ἔρως
ἔρως7d ago
everything you see, by default, is in there
snxxwyy
snxxwyyOP7d ago
Yeah that’s quite useful, are there other GitHub repos with other browser ones in?
ἔρως
ἔρως7d ago
probably firefox
snxxwyy
snxxwyyOP7d ago
yeah i think that might be the only other
snxxwyy
snxxwyyOP7d ago
though it's not on github, it's hosted here https://hg.mozilla.org/mozilla-central
mozilla-central summary
A summary of repository state for mozilla-central
ἔρως
ἔρως7d ago
many projects that use a different source control service have a mirror on github
Want results from more Discord servers?
Add your server