BTW- This method can be applied to any css property.
<script>
$(function() {
$("div.variant-width").each(function() {
var myclass = $(this).text();
var mytarget = $(this).parent();
switch (myclass) {
case "big":
mytarget.css("width", "50%");
break;
case "mid":
mytarget.css("width", "33.33333%");
break;
case "small":
mytarget.css("width", "25%");
break;
default:
break;
}
});
});
</script>
The videos Kurzgesagt channel creates are so beautifully animated, that I almost forget that I learn so much while watching them!