[attribute~=value]





css/style.css
  • [value~=sea]{
  •  background-color: #FFFFCC;
  • }
[value~=sea]{
 background-color: #FFFFCC;
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  • </head>
  • <body>
  •  <input type="text" value="sea" />
  •  <br />
  •  <br />
  •  <input type="text" value="seaman" />
  •  <br />
  •  <br />
  •  <input type="text" value="search a sea" />
  •  <br />
  •  <br />
  •  <input type="submit" name="ok" value="OK" />
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  • </head>
  • <body>
  •  <input type="text" value="sea" />
  •  <br />
  •  <br />
  •  <input type="text" value="seaman" />
  •  <br />
  •  <br />
  •  <input type="text" value="search a sea" />
  •  <br />
  •  <br />
  •  <input type="submit" name="ok" value="OK" />
  • </body>
  • </html>