I’ve tried adding a <style>...</style> block to the html but it seems to have no effect.

The CSS usage says to add style='whatever' on each place you want to apply some CSS. But I want to apply the same style in multiple places without having to re-type it and find/change each place when I change my mind.

TL;DR: I want to use CSS the way it’s supposed to work

  • Almaumbria
    link
    fedilink
    English
    arrow-up
    4
    ·
    18 days ago

    Hii, style='...' is for writing the CSS code directly into the HTML element. For anything you need to be reusable, what you want is to define a class within the <style>...</style> block, eg:

    .my_class {
      color:            #B8B8B8;
      background-color: #303030;
      border-color:     #383838;
    }
    

    And then you can set an element to use it via class="my_class". You can have multiple classes on the same element if you separate the names with spaces (class="my_class another_class").