Solution 1 :

#labels {
text-align: left;
}
<!DOCTYPE html>
<html>
<head>
<style>
.error {color: #FF0000;}
</style>
</head>
<body>
<form method="post" action="">  
  Name: <input type="text" name="name" value="">
  <br><br>
  E-mail: <input type="text" name="email" value="">
  <br><br>
  Website: <input type="text" name="website" value="">
  <br><br>
  Comment: <textarea name="comment" rows="5" cols="40"></textarea>
  <br><br>
  <input type="submit" name="submit" value="Submit">  
</form>
</body>
</html>

You might like this code.
You just have to remove <br> which means break. It gives you a line space.
So, you have to remove it.

Edited :

#labels {
text-align: left;
}
<!DOCTYPE html>
<html>
<head>
<style>
.error {color: #FF0000;}
</style>
</head>
<body>
<form class="" action="index.html" method="post">
  

<label id="labels" for="">Name</label>
  <input class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" type="text" name="" value="" placeholder="Enter Name"> <br>
  <label id="labels" for="">Email Address</label>
  <input class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" type="email" name="" value="" placeholder="Enter Email"> <br>
  <label id="labels" for="">Enter Phone</label> 
  <input class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" type="number" name="" value="" placeholder="Enter Phone Number">


</form>
</body>
</html>

Problem :

I am trying to place the form label on the top-left side, but it does not work. I used Bootrstrap for designing and then I tried to change the CSS code by using ID. It doesn’t help. Any advice?
Thank you in advance

#labels {
text-align: left;
}
<form class="" action="index.html" method="post">
  <label id="labels" for="">Name</label><br>
  <input class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" type="text" name="" value="" placeholder="Enter Name"> <br>
  <label id="labels" for="">Email Address</label><br>
  <input class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" type="email" name="" value="" placeholder="Enter Email"> <br>
  <label id="labels" for="">Enter Phone</label> <br>
  <input class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" type="number" name="" value="" placeholder="Enter Phone Number">


</form>

Comments

Comment posted by KienHT

The text-align property is default to left. What else do you want?

Comment posted by ibb.co/gvYJfL9

Do you want like this? –

Comment posted by CBroe

FYI: IDs

Comment posted by nail zadeh

Thank you for the reply, but it did not work. I need the labels on top (top-left) of the input form, that’s why I needed

By