Example 1: input and button element labeling

Best Practice Rating: Good

Example Start

Example End

HTML Source Code

<div class="button">
    <input type="button" value="Press me" onclick='alert("You pressed me!")'/>
</div>

<div class="button">
     <input type="submit" onclick='alert("You pressed me!")'/>
</div>

<div class="button">  
    <button onclick='alert("You pressed me!")'>Example Button</button>
</div>
    

CSS Source Code

  <style type="text/css">
div.button {
  margin: 0;
  padding: 0;
  margin-left: 20px;
  margin-bottom: .5em;
  font-size: 100%;
  font-weight: bold;
}

  </style>