css notes

  • Metadata

    • topic:: 00 Coding00 Coding
      #MOC / for programming language, coding guide and libraries focusing on data analytics and html/css
    • updated:: 2022-06-09 Private or Broken Links
      The page you're looking for is either not available or private!
    • reviewed:: 2022-06-09 Private or Broken Links
      The page you're looking for is either not available or private!
    • #CodeNote
  • Use attribute selector to single out html element

    • use [attribute^="value"] to select elements with the specified attribute, whose value starts with the specified value.
      • ^= indicates find only attribute that starts with the value fed to it
      • $= for end and
      • *= for anywhere
  • Efficient css coding (minimizing preceding classes)

    • using :is() will allow the preceding class selection to be attached to every element in the :is()
        .markdown-preview-view :is(h1, h2, h3, h4 ,h5, h6) em,
        .cm-header.cm-em {
            color: red;
        }
      
    • copied from pseudometa via discord 2022-04-13 Private or Broken Links
      The page you're looking for is either not available or private!

      References

  • CSS Attribute Selector (w3schools.com)