-1

What I would like to do is this:

P.S: The red arrow is my own adding. Note that the actual grey line surrounding the form box is in fact not a border, as it was pointed out to me by my instructor. I would like to know how to add text to the line surrounding the form box in CSS.

1 Answers1

2

It is a fieldset tag followed by a legend tag. From the MDN docs

<form>
  <fieldset>
    <legend>Choose your favorite monster</legend>

    <input type="radio" id="kraken" name="monster">
    <label for="kraken">Kraken</label><br/>

    <input type="radio" id="sasquatch" name="monster">
    <label for="sasquatch">Sasquatch</label><br/>

    <input type="radio" id="mothman" name="monster">
    <label for="mothman">Mothman</label>
  </fieldset>
</form>
Run_Script
  • 2,487
  • 2
  • 15
  • 30
Ivan V.
  • 7,593
  • 2
  • 36
  • 53