Wednesday, February 1, 2017

html - How to hide the first element on the page with particular css class?

One option would be to use the nth-of-type selector:


.button:nth-of-type(1) {
display:none;
}

Note: This selector is supported in IE9+, Chrome, Firefox, Safari and Opera (but not older versions of IE).


Also, it's time to remove the

tags. They have been removed as of HTML5.


Replace it with the equivalent CSS:


a.button {
text-align:center;
}

Here's a working jsFiddle.

No comments:

Post a Comment