0

I tried this line of code but it doesn't pop up on my live server.

              <form>
                  <p>
                      <label>Your Name</label>
                      <imput type="text"
                      id= "myText"
                      value="Name"/>
                  </p>
              </form>
tchan958
  • 3
  • 2

2 Answers2

0

The label tag needs to be like this:

<label for="myText">Your Name</label>
<input type="text" id="myText" value="">

You can set the size of the input like this:

<input type="text" id="myText" value="" size="35">

See here for more about setting the size.

A much better way to set the size is with CSS. If you're new to HTML, you are going to want to understand and use CSS.

There are many tutorials online. You can start here if you like.

Rob Moll
  • 3,345
  • 2
  • 9
  • 15
  • Thanks this helped but I'm also using css with the html so how would the css code look like if I want to enlarge the text box or make it longer? – tchan958 Feb 10 '20 at 00:15
0

if you want multiple text boxes, use more than one input tag.

You can add a specific width within the input tag as well if you are wanting to change the size using HTML only.

<input type="text" id="myText" name="Name" style="width: 100px;"/>

Otherwise you can use css to style the size using something like:

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

Or add a class attribute to your input tags and call that class in your CSS.

See here for more. https://stackoverflow.com/a/7545305/12869391

magical
  • 1
  • 1
  • 1