javascript - Markup for tabbed interfaces -
i checked out couple solutions tabbed interfaces (including jquery ui), , markup follows same ul-li-a pattern:
<ul class="tabs"> <li><a href="#tab1">title 1</a></li> <li><a href="#tab2">title 2</a></li> </ul>
is considered best practice, , why? far have used span or div tags, , worked fine. also, why "a" tags? here trigger hover , active states on older browsers?
it's semantic markup several reasons:
it unordered list of stuff, namely title 1, title 2 etc.
if javascript disabled, have
div
elements ids of tab1 , tab2 in markup, links behave correctly , send rightdiv
.it makes tabs accessible.
and there lot of reasons using semantic html.
Comments
Post a Comment