-2

What is the meaning of the '^' symbol in CSS? I found this on bootsrap. note: [class^=border] <------ (see code below)

.bd-example-border-utils [class^=border] {
    display: inline-block;
    width: 5rem;
    height: 5rem;
    margin: .25rem;
    background-color: #f5f5f5;
 }
Cihat Kisa
  • 85
  • 1
  • 7

2 Answers2

0
.bd-example-border-utils [class^=border]

This will select each div inside .bd-example-border-utils whose class attribute begins with: border

Kareem Dabbeet
  • 3,838
  • 3
  • 16
  • 34
0

The ^= selector is used to select elements with a name that start with the specified value.

For example, the following example select all elements with a class attribute that begins with "border".

[class^="border"] {
  background-color: #f5f5f5;
}
Fifi
  • 467
  • 6
  • 17