jeudi 18 juillet 2019

HTML form tag is not filling width of screen with css

I have the below HTML code:

<form class="form" action="search.php" method="POST">
    <input type="text" id="searchBox" name="name" placeholder="Enter name" oninput="search(this.value)">
</form>

I want this form to span out the whole width of the window. I am doing this with css below:

.form{
  display: block;
  float:left;
  width: 100%;
  height: 40px;
  background-color: yellow;
  border:none;
}

However, it is not going the full width. It is leaving a small margin on both sides.

enter image description here




Aucun commentaire:

Enregistrer un commentaire