summaryrefslogtreecommitdiff
path: root/content/digarden/pages/20220202144214-css.org
blob: 881afd03a7de0895e5a4bbdeed43e764cbf73e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
:PROPERTIES:
:ID:       31e25f4a-008f-442d-9bb1-594d75303c84
:END:
#+title: CSS

* Селектор html атрибута
#+begin_src css
  /* <a> elements with a title attribute */
  a[title] {
      color: purple;
  }

  /* <a> elements with an href matching "https://example.org" */
  a[href="https://example.org"] {
      color: green;
  }

  /* <a> elements with an href containing "example" */
  a[href*="example"] {
      font-size: 2em;
  }

  /* <a> elements with an href ending ".org" */
  a[href$=".org"] {
      font-style: italic;
  }

  /* <a> elements whose class attribute contains the word "logo" */
  a[class~="logo"] {
      padding: 2px;
  }

#+end_src