Categories Programming & Tech

Explaining the Accessible Benefits of Using Semantic HTML Elements | CSS-Tricks

Here’s something you’ll spot in the wild:

Custom Button

This is one of those code smells that makes me stop in my tracks because we know there’s a semantic

<![CDATA[
/* */
]]><![CDATA[
/* */
]]><![CDATA[
/* */
]]><![CDATA[
/* */
]]> {
const consent = truste.cma.callApi("getGDPRConsentDecision","css-tricks.com");

// Google Analytics and Segment are functional
if (consent.consentDecision.includes(2) || (consent.source === 'implied' && truste.eu.bindMap.behaviorManager !== 'eu')) {
// Google Analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-68528-29', 'auto');

if (typeof articleYear !== "undefined") {
ga('set', 'dimension1', articleYear);
}
if (typeof articleAuthor !== "undefined") {
ga('set', 'dimension2', articleAuthor);
}
if (typeof articleType !== "undefined") {
ga('set', 'dimension3', articleType);
}

ga('send', 'pageview');

// Segment Analytics
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e