Use CSS to automatically add 'required field' asterisk to form inputs

前端 未结 16 2753
有刺的猬
有刺的猬 2020-11-28 19:10

What is a good way to overcome the unfortunate fact that this code will not work as desired:

16条回答
  •  [愿得一人]
    2020-11-28 19:32

    input[required]{
        background-image: radial-gradient(#F00 15%, transparent 16%), radial-gradient(#F00 15%, transparent 16%);
        background-size: 1em 1em;
        background-position: right top;
        background-repeat: no-repeat;
    }
    

提交回复
热议问题