[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/HTML/Reference/Elements/button [Back]  [Original]

<button>: - HTML: Hypertext Markup Language | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

<button>:

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

* Some parts of this feature may have varying levels of support.

HTML <button> . . HTML , CSS .

In this article

<button class="favorite styled" type="button">Add to favorites</button>
.styled {
  border: 0;
  line-height: 2.5;
  padding: 0 20px;
  font-size: 1rem;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  border-radius: 10px;
  background-color: rgba(220, 0, 0, 1);
  background-image: linear-gradient(
    to top left,
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.2) 30%,
    rgba(0, 0, 0, 0)
  );
  box-shadow:
    inset 2px 2px 3px rgba(255, 255, 255, 0.6),
    inset -2px -2px 3px rgba(0, 0, 0, 0.6);
}

.styled:hover {
  background-color: rgba(255, 0, 0, 1);
}

.styled:active {
  box-shadow:
    inset -2px -2px 3px rgba(255, 255, 255, 0.6),
    inset 2px 2px 3px rgba(0, 0, 0, 0.6);
}
, , , (, , ), .
.
, .
.
ARIA button
ARIA checkbox, link, menuitem, menuitemcheckbox, menuitemradio, radio, switch, tab
DOM HTMLButtonElement

.

autofocus

, . autofocus .

autocomplete

This attribute on a <button> is nonstandard and Firefox-specific. Unlike other browsers, Firefox persists the dynamic disabled state of a <button> across page loads. Setting autocomplete="off" disables this feature; see Firefox bug 654072.

disabled

, .

Firefox, unlike other browsers, persist the dynamic disabled state of a <button> across page loads. Use the autocomplete attribute to control this feature.

form

<form> (" "). <form> id . form <form> <form> .

form <form> , <form> .

formaction

<button> , URL. , action . .

formenctype

<button> , formenctype . .

  • application/x-www-form-urlencoded: .
  • multipart/form-data: type file <input> .
  • text/plain: . .

, enctype .

formmethod

<button> , formmethod HTTP . .

  • post: HTTP . , .
  • get: action URL ? . , .

, method .

formnovalidate

<button> , formnovalidate . , novalidate .

formtarget

<button> , formtarget . (, , <iframe>) . , target . .

  • _self: . .
  • _blank: . , .
  • _parent: . _self .
  • _top: ( , ) . _self .
name

. , value .

type

. .

  • submit: . , .
  • reset: <input type="reset">, .
  • button: . .
value

. , value .

<button> <input> . <input> value , <button> HTML (<em>, **, <img>) ::after ::before .

type button . , ( ) .

html
<button name="button"></button>

. . .

, <button> .

html
<button name="favorite" type="button">
  <svg aria-hidden="true" viewBox="0 0 10 10">
    <path d="M7 9L5 8 3 9V6L1 4h3l1-3 1 3h3L7 6z" />
  </svg>
  Add to favorites
</button>

, CSS , .

, . , .

. , . 44x44 CSS .

. .

margin CSS .

Firefox

Firefox will add a small dotted border on a focused button. This border is declared through CSS in the browser stylesheet, but you can override it to add your own focused style using <a href="/ko/docs/Web/CSS/::-moz-focus-inner">button::-moz-focus-inner { }</a>.

If overridden, it is important to ensure that the state change when focus is moved to the button is high enough that people experiencing low vision conditions will be able to perceive it.

Color contrast ratio is determined by comparing the luminosity of the button text and background color values compared to the background the button is placed on. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for large text. (Large text is defined as 18.66px and bold or larger, or 24px or larger.)

<button> . <input> type="button" type="submit" .

<button> ?
Windows 8.1 OS X 10.X
Firefox - Firefox 30.0 (tabindex ) - Firefox 63
Chrome - Chrome 35 - Chrome 65
Safari N/A (tabindex ) - Safari 12 (bug 22261)
Internet Explorer - Internet Explorer 11 N/A
Presto - Opera 12 - Opera 12
<button> ?
iOS 7.1.2 Android 4.4.4
Safari Mobile (tabindex ) N/A
Chrome 35 (tabindex )

Specification
HTML
# the-button-element


Web Proxy Viewer  |  New URL  |  Original Page