Selecting Default Elements

Description

The :default element selects the default element from among a group of similar elements.

The submit button is always the default button in a form.

Example

The following code uses the :default Element.


<!DOCTYPE HTML>
<html>
<head>
<style>
:default {<!--from   www .ja va  2  s  .  c  o  m-->
  outline: medium solid red;
}
</style>
</head>
<body>
  <form method="post" action="http://example.com/form">
    <p>
      <label for="name">Name: <input id="name" name="name" /></label>
    </p>
    <button type="submit">Submit Vote</button>
    <button type="reset">Reset</button>
  </form>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table