+ 2

How can i do this?is it possible?please check out the code:)

in this code i want to style a dislike button as display none, but just only for this post i just want to set this style for one of the posts or posts that i want , not all of the posts of my blog, so what do you suggest ? is it possible to hide a class with an id in another class?(i don't know how to explain) check out this code to see what i mean:(the html part only) https://code.sololearn.com/WsMmxI4Xa2UU/

19th Jan 2020, 9:42 PM
MAHDI
MAHDI - avatar
2 Respuestas
+ 1
"is it possible to hide a class with an id in another class?(i don't know how to explain)" I guess this means, selecting the span.rate-down as the decedent of sibling of parent of p#m1 i.e. going up and then down of the hierarchy. You can find this link useful for such approach - https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector#1014958 However, It will be simpler to use js. Like, window.onload = function () { if(document.getElementById("m1")) { [...document.getElementsByClassName("rate-down")].forEach(x=>x.style.display="none"); } }
20th Jan 2020, 11:21 AM
Mahmud Nabil
Mahmud Nabil - avatar
+ 1
thanks so much , you don't know how important it is for me:)))) Mahmud Nabil:)))))
20th Jan 2020, 5:38 PM
MAHDI
MAHDI - avatar