aria-*
-
aria-*, data-* 속성 비교 :: 마이구미HTML, CSS 2019. 1. 9. 00:09
이 글은 aria-* 속성과 data-* 속성을 비교한다.두 속성 모두 HTML5 스펙에 존재한다.data-* - MDN, aria-* - MDN 우선 aria-*, data-* 속성을 사용한 예제를 보자.다음은 css 가상 클래스(before, after)와 함께, 많이 사용하는 예제이다.두 속성은 같은 목적으로 사용할 경우, 동일한 결과를 낸다. // htmllabel : label : // scss .item1 { &:after { content: attr(aria-label); } } .item2 { &:after { content: attr(data-label); } } 두 방법 모두 동일한 결과를 낸다.위와 같은 동일한 목적으로 사용함에 있어, 문제 될 것이 전혀 없다. javascript 에..