[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Learn_web_development/Core/Accessibility/CSS_and_JavaScript [Back]  [Original]

CSS JavaScript - Web | 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

CSS JavaScript

CSS JavaScript , . CSS JavaScript .

: HTML, CSS, JavaScript .
: CSS JavaScript .

In this article

CSS JavaScript ?

CSS JavaScript HTML , . , CSS JavaScript .

CSS

CSS .

CSS HTML , . HTML: , . , . . , .

, . , .

, , . HTML .

""

, ,

html
<h1>Heading</h1>

<p>Paragraph</p>

<ul>
  <li>My list</li>
  <li>has two items.</li>
</ul>

CSS .

css
h1 {
  font-size: 5rem;
}

p,
li {
  line-height: 1.5;
  font-size: 1.6rem;
}

.

  • , , .
  • . .
  • .

HTML .

.

html
<p>The water is <em>very hot</em>.</p>

<p>
  Water droplets collecting on surfaces is called <strong>condensation</strong>.
</p>

.

css
strong,
em {
  color: #a60000;
}

. . .

, .

html
<p>
  Web content is marked up using Hypertext Markup Language, or
  <abbr>HTML</abbr>.
</p>

, .

css
abbr {
  color: #a60000;
}

, . .

.

html
<p>Visit the <a href="https://www.mozilla.org">Mozilla homepage</a>.</p>

.

css
a {
  color: #ff0000;
}

a:hover,
a:visited,
a:focus {
  color: #a60000;
  text-decoration: none;
}

a:active {
  color: #000000;
  background-color: #a60000;
}

(: ), (: ) . , , (: ) . Firefox( ) Chrome( ) .

Firefox     .  4   .               . [Firefox . 4 . .]

Chrome     .  4   .              . [Chrome . 4 . .]

. . .

.

html
<div>
  <label for="name">Enter your name</label>
  <input type="text" id="name" name="name" />
</div>

form-css.html CSS . ( .)

CSS , , .

. ( ). / . .

.

table-css.html HTML CSS . ( .)

CSS . ( ), .

. .

. . WCAG .

: .

/ . . , .

. , ( ) , . (Tab Enter/Return .)

 1  3      .    .            . [ 1 3 . . .]

. . .

visibility:hidden display:none . , .

: .

. .

. , . , . , ( ) .

JavaScript

JavaScript .

JavaScript , UI 2D 3D . 100% . .

. , , , , , . HTML: .

JavaScript . . , . JavaScript WAI-ARIA . .

3D . WebGL 3D <canvas> . 100% . , .

JavaScript

JavaScript . JavaScript . HTML, CSS JavaScript . .

! JavaScript 3D , . , . JavaScript HTML .

JavaScript . JavaScript , . JavaScript . , .

JavaScript .

  • . .
  • JavaScript HTML <video> ( <video> ).

. form-validation.html . . .

. JavaScript , (: JavaScript ) . . . .

: .

. <label> .

html
<label for="name">Enter your name:</label>
<input type="text" name="name" id="name" />

. UI ( ) .

js
form.onsubmit = validate;

function validate(e) {
  errorList.innerHTML = "";
  for (let i = 0; i < formItems.length; i++) {
    const testItem = formItems[i];
    if (testItem.input.value === "") {
      errorField.style.left = "360px";
      createLink(testItem);
    }
  }

  if (errorList.innerHTML !== "") {
    e.preventDefault();
  }
}

: display visibility .

. , (: 4 ) . (if (testItem.input.value === '')) .

. (if (errorList.innerHTML !== '')) (preventDefault() ) ( ). .

errorList .

js
function createLink(testItem) {
  const listItem = document.createElement("li");
  const anchor = document.createElement("a");

  const name = testItem.input.name;
  anchor.textContent = `${name} field is empty: fill in your ${name}.`;
  anchor.href = `#${name}`;
  listItem.appendChild(anchor);
  errorList.appendChild(listItem);
}

. , / .

errorField (CSS UI ). .

, WAI-ARIA ( ).

html
<div class="errors" role="alert" aria-relevant="all">
  <ul></ul>
</div>

WAI-ARIA .

: HTML required, min/minlength, max/maxlength ( <input> ). (: IE10 ).

: WebAIM .

JavaScript

JavaScript . .

JavaScript , . . mouseover, mouseout, dblclick . .

( ) . focus blur .

. .

mouse-and-keyboard-events.html ( .) . . .

js
imgThumb.onmouseover = showImg;
imgThumb.onmouseout = hideImg;

imgThumb.onfocus = showImg;
imgThumb.onblur = hideImg;

. / . ( ) . tabindex="0" .

click . Enter/Return onclick . tabindex . ( .).

!

? . : CSS JavaScript .

CSS JavaScript .

WAI-ARIA!


Web Proxy Viewer  |  New URL  |  Original Page