Capital letters cannot be used in HTML data attributes.

HTML data attributes are a great way to add custom data to an element. However, there are certain rules for the names of these attributes, and the use of capital letters is not permitted.

For example, if you try to create a data attribute such as data-slidesPerView, this violates HTML rules. Instead, it must be written in all lowercase. In other words, it is properly data-slidesperview.

This is due to the HTML specification, which requires that attribute names be in ASCII lowercase only. If this rule is violated, the browser may not recognize the attribute name correctly.

Therefore, when using data attributes, keep in mind that attribute names should be written in lowercase only.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top