What's the best way to highlight a required field on a web form?

前端 未结 9 1006
深忆病人
深忆病人 2021-01-02 00:04

I don\'t find the oft-used \"*\" to be very nice looking - can anyone suggest a nicer-looking method or point me to an example?

I tried making the field highlighted

9条回答
  •  温柔的废话
    2021-01-02 00:41

    If you use stylesheets to format your HTML, then you can create a style for .mandatory. As an example, set the mandatory input to use this style, then you can play with it more easily until you have the right mix of color, border, and other style elements to suit your overall design.

    HTML

    
    

    CSS

    .mandatory {
        color: red;
        font-size: 12pt;
        font-weight: bold;
        font-style: italic;
    }
    

    I also use the asterisk as the OP mentioned as a "backup".

    -R

提交回复
热议问题