✅ – Cosec – 16-19 Oct 5

how to have a css/js selector using both id and name?
C
Cosec559d ago
ok got it. It is by
#id[name="nameInthatID"] { //styling }
#id[name="nameInthatID"] { //styling }
UU
Unknown User559d ago
S
ScriptyChris559d ago
Regarding id, it depends what specificity do you want. # gives the highest selector specificity, but if you do [id="some-id"] then whole selector will have lower specificity, because it will be ID vs attribute selector So #id[name="nameInthatID"] will get higher specificity than [id="id"][name="nameInthatID"]
C
Cosec559d ago
I see 🤔
UU
Unknown User558d ago