<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>&lt;input type="text"&gt; 示例</title>
    <style>
      div {
        margin-bottom: 10px;
        position: relative;
        }

        input[type="number"] {
          width: 100px;
        }

        input + span {
          padding-right: 30px;
        }

        input:invalid+span:after {
          position: absolute; content: '✖';
          padding-left: 5px;
        }

        input:valid+span:after {
          position: abso