Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of attribute selector</title> <style> [class~="warning"] { color: #fff; background: red; } </style> </head> <body> <p class="warning">The style will apply to this paragraph.</p> <p class="warning highlight">The style will also apply to this paragraph.</p> <p class="highlight">The style will not apply to this paragraph.</p> </body> </html>