From d79f316e1c617b165487da0198765d992cce2fff Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 15 Jul 2021 13:41:58 -0400 Subject: delete pages that were never translated from en-US (pl, part 2) (#1551) --- files/pl/_redirects.txt | 2 - files/pl/_wikihistory.json | 45 - files/pl/learn/tools_and_testing/index.html | 48 - .../mozilla/add-ons/webextensions/api/index.html | 61 - files/pl/tools/performance/index.html | 98 -- files/pl/web/api/speechrecognition/index.html | 153 --- .../index.html | 595 --------- files/pl/web/html/element/input/index.html | 1376 -------------------- files/pl/web/http/headers/cache-control/index.html | 169 --- 9 files changed, 2547 deletions(-) delete mode 100644 files/pl/learn/tools_and_testing/index.html delete mode 100644 files/pl/mozilla/add-ons/webextensions/api/index.html delete mode 100644 files/pl/tools/performance/index.html delete mode 100644 files/pl/web/api/speechrecognition/index.html delete mode 100644 files/pl/web/css/css_grid_layout/realizing_common_layouts_using_css_grid_layout/index.html delete mode 100644 files/pl/web/html/element/input/index.html delete mode 100644 files/pl/web/http/headers/cache-control/index.html diff --git a/files/pl/_redirects.txt b/files/pl/_redirects.txt index 9040e696b0..51ca506e89 100644 --- a/files/pl/_redirects.txt +++ b/files/pl/_redirects.txt @@ -1465,7 +1465,6 @@ /pl/docs/Narzędzia/Page_Inspector/How_to /pl/docs/Tools/Page_Inspector/How_to /pl/docs/Narzędzia/Page_Inspector/How_to/Open_the_Inspector /pl/docs/Tools/Page_Inspector/How_to/Open_the_Inspector /pl/docs/Narzędzia/Page_Inspector/Przewodnik_przez_UI /pl/docs/Tools/Page_Inspector/UI_Tour -/pl/docs/Narzędzia/Performance /pl/docs/Tools/Performance /pl/docs/Narzędzia/Walidatory /pl/docs/Tools/Validators /pl/docs/Narzędzia/about:debugging /pl/docs/Tools/about:debugging /pl/docs/Narzędzia:Walidatory /pl/docs/Tools/Validators @@ -1663,7 +1662,6 @@ /pl/docs/Web/CSS/@-moz-document /pl/docs/Web/CSS/@document /pl/docs/Web/CSS/CSS_Colors /pl/docs/Web/CSS/CSS_Color /pl/docs/Web/CSS/CSS_Colors/Narzedzie_doboru_kolorow /pl/docs/Web/CSS/CSS_Colors/Color_picker_tool -/pl/docs/Web/CSS/CSS_Grid_Layout/Realizacja_typowych_ukladow_za_pomoca_ukladu_siatki_CSS /pl/docs/Web/CSS/CSS_Grid_Layout/Realizing_common_layouts_using_CSS_Grid_Layout /pl/docs/Web/CSS/CSS_Reference /pl/docs/Web/CSS/Reference /pl/docs/Web/CSS/CSS_Reference/Rozszerzenia_Mozilli /pl/docs/Web/CSS/Mozilla_Extensions /pl/docs/Web/CSS/CSS_Selectors/Użycie_pseudoklasy_:target_w_selektorach /pl/docs/Web/CSS/CSS_Selectors/Using_the_:target_pseudo-class_in_selectors diff --git a/files/pl/_wikihistory.json b/files/pl/_wikihistory.json index 85e8f6414f..6ca2ddb0bc 100644 --- a/files/pl/_wikihistory.json +++ b/files/pl/_wikihistory.json @@ -831,12 +831,6 @@ "cs" ] }, - "Learn/Tools_and_testing": { - "modified": "2020-07-16T22:38:56.487Z", - "contributors": [ - "chrisdavidmills" - ] - }, "MDN": { "modified": "2020-02-19T18:16:07.796Z", "contributors": [ @@ -959,12 +953,6 @@ "rebloor" ] }, - "Mozilla/Add-ons/WebExtensions/API": { - "modified": "2020-05-25T16:21:21.207Z", - "contributors": [ - "rebloor" - ] - }, "Mozilla/Add-ons/WebExtensions/Your_first_WebExtension": { "modified": "2020-12-12T09:20:57.064Z", "contributors": [ @@ -1241,13 +1229,6 @@ "kubutekf" ] }, - "Tools/Performance": { - "modified": "2020-07-16T22:36:13.164Z", - "contributors": [ - "jwhitlock", - "wbamberg" - ] - }, "Tools/Validators": { "modified": "2020-07-16T22:35:03.596Z", "contributors": [ @@ -3455,12 +3436,6 @@ "Rev" ] }, - "Web/API/SpeechRecognition": { - "modified": "2020-10-15T22:25:11.426Z", - "contributors": [ - "malarium" - ] - }, "Web/API/Stylesheet/disabled": { "modified": "2019-03-23T23:45:18.937Z", "contributors": [ @@ -4264,13 +4239,6 @@ "CreateWWW" ] }, - "Web/CSS/CSS_Grid_Layout/Realizing_common_layouts_using_CSS_Grid_Layout": { - "modified": "2019-05-22T06:37:48.964Z", - "contributors": [ - "DominikKowalczyk", - "vbert" - ] - }, "Web/CSS/CSS_Lists_and_Counters/Using_CSS_counters": { "modified": "2019-03-23T23:43:40.448Z", "contributors": [ @@ -5367,12 +5335,6 @@ "Sullei" ] }, - "Web/HTML/Element/Input": { - "modified": "2019-03-23T22:58:57.333Z", - "contributors": [ - "pkuczynski" - ] - }, "Web/HTML/Element/a": { "modified": "2020-10-15T21:11:09.186Z", "contributors": [ @@ -5855,13 +5817,6 @@ "Alpha" ] }, - "Web/HTTP/Headers/Cache-Control": { - "modified": "2020-10-15T22:03:23.970Z", - "contributors": [ - "myhau", - "stopsopa" - ] - }, "Web/HTTP/Headers/Referrer-Policy": { "modified": "2020-10-15T22:25:31.082Z", "contributors": [ diff --git a/files/pl/learn/tools_and_testing/index.html b/files/pl/learn/tools_and_testing/index.html deleted file mode 100644 index 9430b94ada..0000000000 --- a/files/pl/learn/tools_and_testing/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: Tools and testing -slug: Learn/Tools_and_testing -tags: - - Accessibility - - Automation - - Beginner - - CSS - - CodingScripting - - HTML - - JavaScript - - Landing - - Learn - - NeedsTranslation - - Testing - - Tools - - Topic - - TopicStub - - cross browser - - user testing -translation_of: Learn/Tools_and_testing ---- -
{{LearnSidebar}}
- -

Once you've started to become comfortable programming with core web technologies (like HTML, CSS, and JavaScript), and you start to get more experience, read more resources, and learn more tips and tricks, you'll start to come across all kind of tools, from ready-rolled CSS and JavaScript, to testing and automation apps, and more besides. As your web projects become larger and more complex, you'll want to start taking advantage of some of these tools, and working out reliable testing plans for your code. This part of the learning area aims to give you what you need get started and make informed choices.

- -

The web industry is an exciting place to work, but it is not without its complications. The core technologies we use to build web sites are fairly stable now, but new features are being added all the time, and new tools — that facilitate working with, and are built on top of these technologies — are constantly appearing. On top of that, we still need to keep cross-browser support in the forefront of our minds, and make sure that our code follows best practices that allow our projects to work across different browsers and devices that our users are using to browser the Web, and be usable by people with disabilities.

- -

Working out what tools you should be using can be a difficult process, so we have written this set of articles to inform you of what types of tool are available, what they can do for you, and how to make use of the current industry favourites.

- -
-

Note: Because new tools appear and old ones go out of fashion all the time, we have deliberately written this material to be as neutral as possible — we want to focus first and foremost on the general types of tasks these tools will help you accomplish, and keep prescribing specific tools to a minimum. We obviously need to show tool usage to demonstrate specific techniques, but be clear that we do not necessarily recommend these tools as the best or only way to do things — in most cases there are other ways, but we want to provide you with a clear methodology that works.

-
- -

Learning pathway

- -

You should really learn the basics of the core HTML, CSS, and JavaScript languages first before attempting to use the tools detailed here. For example, you'll need to know the fundamentals of these languages before you start debugging problems in complex web code, or making effective use of JavaScript libraries, or writing tests and running them against your code using test runners, etc.

- -

You need a solid foundation first.

- -

Modules

- -
-
Real world web development tools (TBD)
-
In this module, we explore the different kinds of web development tools available. This includes reviewing the most common kinds of tasks you may be called on to solve, how they can fit together in a workflow, and the best tools currently avaiable for carrying out those tasks.
-
Cross browser testing
-
This module looks specifically at the area of testing web projects across different browsers. Here we look identifying your target audience (e.g. what users, browsers and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to fix/mitigate those, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing.
-
diff --git a/files/pl/mozilla/add-ons/webextensions/api/index.html b/files/pl/mozilla/add-ons/webextensions/api/index.html deleted file mode 100644 index 724bf34516..0000000000 --- a/files/pl/mozilla/add-ons/webextensions/api/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: JavaScript APIs -slug: Mozilla/Add-ons/WebExtensions/API -tags: - - NeedsTranslation - - TopicStub - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/API ---- -
{{AddonSidebar}}
- -
-

JavaScript APIs for WebExtensions can be used inside the extension's background scripts and in any other documents bundled with the extension, including browser action or page action popups, sidebars, options pages, or new tab pages. A few of these APIs can also be accessed by an extension's content scripts (see the list in the content script guide).

- -

To use the more powerful APIs you need to request permission in your extension's manifest.json.

- -

You can access the APIs using the browser namespace:

- -
function logTabs(tabs) {
-  console.log(tabs)
-}
-
-browser.tabs.query({currentWindow: true}, logTabs)
-
- -
-

Many of the APIs are asynchronous, returning a {{JSxRef("Promise")}}:

- -
function logCookie(c) {
-  console.log(c)
-}
-
-function logError(e) {
-  console.error(e)
-}
-
-let setCookie = browser.cookies.set(
-  {url: "https://developer.mozilla.org/"}
-);
-setCookie.then(logCookie, logError)
-
- -
-

Note that this is different from Google Chrome's extension system, which uses the chrome namespace instead of browser, and which uses callbacks instead of promises for asynchronous functions. As a porting aid, the Firefox implementation of WebExtensions APIs supports chrome and callbacks as well as browser and promises. Mozilla has also written a polyfill which enables code that uses browser and promises to work unchanged in Chrome: https://github.com/mozilla/webextension-polyfill.

- -

Firefox also implements these APIs under the chrome namespace using callbacks. This allows code written for Chrome to run largely unchanged in Firefox for the APIs documented here.

- -

Microsoft Edge uses the browser namespace, but doesn't yet support promise-based asynchronous APIs. In Edge, for the time being, asynchronous APIs must use callbacks.

- -

Not all browsers support all the APIs: for the details, see Browser support for JavaScript APIs.

- -

Tip: Throughout the JavaScript API listings you will find short code examples that illustrate how the API is used. You can exercise these examples, without needing to create a web extension, using the console in the Toolbox. For example, here is the first code example on this page running in the Toolbox console in Firefox Developer Edition:

- -

Illustration of a snippet of web extension code run from the console in the Toolbox

- -

JavaScript API listing

- -

See below for a complete list of JavaScript APIs:

-
- -
{{LandingPageListSubpages}}
diff --git a/files/pl/tools/performance/index.html b/files/pl/tools/performance/index.html deleted file mode 100644 index f9cfa310f2..0000000000 --- a/files/pl/tools/performance/index.html +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: Performance -slug: Tools/Performance -tags: - - NeedsTranslation - - TopicStub -translation_of: Tools/Performance -original_slug: Narzędzia/Performance ---- -

The Performance tool gives you insight into your site's general responsiveness, JavaScript and layout performance. With the Performance tool you create a recording, or profile, of your site over a period of time. The tool then shows you an overview of the things the browser was doing to render your site over the profile, and a graph of the frame rate over the profile.

- -

You get four sub-tools to examine aspects of the profile in more detail:

- - - -

{{EmbedYouTube("WBmttwfA_k8")}}

- -
-

Getting started

- -
-
-
-
UI Tour
-
-

To find your way around the Performance tool, here's a quick tour of the UI.

-
-
-
- -
-
-
How to
-
Basic tasks: open the tool, create, save, load, and configure recordings
-
-
-
- -
-

Components of the Performance tool

- -
-
-
-
Frame rate
-
Understand your site's overall responsiveness.
-
Call Tree
-
Find bottlenecks in your site's JavaScript.
-
Allocations
-
See the allocations made by your code over the course of the recording.
-
-
- -
-
-
Waterfall
-
Understand the work the browser's doing as the user interacts with your site.
-
Flame Chart
-
See which JavaScript functions are executing, and when, over the course of the recording.
-
 
-
-
-
- -
-

Scenarios

- -
-
-
-
Animating CSS properties
-
Uses the Waterfall to understand how the browser updates a page, and how animating different CSS properties can affect performance.
-
 
-
-
- -
-
-
Intensive JavaScript
-
Uses the frame rate and Waterfall tools to highlight performance problems caused by long-running JavaScript, and how using workers can help in this situation.
-
-
-
- -

 

- -
-
-
 
-
-
- -

 

diff --git a/files/pl/web/api/speechrecognition/index.html b/files/pl/web/api/speechrecognition/index.html deleted file mode 100644 index 8f41dfb239..0000000000 --- a/files/pl/web/api/speechrecognition/index.html +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: SpeechRecognition -slug: Web/API/SpeechRecognition -translation_of: Web/API/SpeechRecognition ---- -

{{APIRef("Web Speech API")}}{{SeeCompatTable}}

- -

Interfejs SpeechRecognition jest częścią Web Speech API i kontroluje usługę rozpoznawania mowy. Obsługuje również {{domxref("SpeechRecognitionEvent")}} zwracany przez usługę rozpoznawania mowy.

- -
-

Uwaga: Na Chrome użycie Speech Recognition wymaga zastosowania serwera. Dźwięk jest przesyłany do usługi web, więc nie działa offline.

-
- -

Konstruktor

- -
-
{{domxref("SpeechRecognition.SpeechRecognition()")}}
-
Tworzy nowy obiekt SpeechRecognition.
-
- -

Właściwości

- -

SpeechRecognition dziedziczy równiez właściwości z interfejsu rodzica, {{domxref("EventTarget")}}.

- -
-
{{domxref("SpeechRecognition.grammars")}}
-
Tworzy i zwraca kolekcję obiektów {{domxref("SpeechGrammar")}}, które reprezentują zasady gramatyczne akceptowane przez SpeechRecognition.
-
{{domxref("SpeechRecognition.lang")}}
-
Tworzy i zwraca język bieżącej instacji SpeechRecognition. Jeśli nie zostanie sprecyzowany domyślnie przyjmie wartość z atrybutu {{htmlattrxref("lang","html")}}, a jeśli i on nie został zdefiniowany - z ustawień językowych przeglądarki.
-
{{domxref("SpeechRecognition.continuous")}}
-
Ustawienie przyjęcia ciągłego strumienia mowy lub pojedynczego zwrotu. Domyslnie ustawiony na przyjęcie pojedynczego zwrotu (false.)
-
{{domxref("SpeechRecognition.interimResults")}}
-
Ustawienie kontrolujące zwracanie rezultatów pośrednich. Przyjmuje wartości (true) lub (false.) Rezultat pośredni rozpoznawania mowy to rezultat niepełny, uzyskiwany w trakcie rozpoznawania wypowiedzi (np. kiedy metoda {{domxref("SpeechRecognitionResult.isFinal")}} zwraca  false.) 
-
{{domxref("SpeechRecognition.maxAlternatives")}}
-
Ustawienie maksymalnej liczby alternatywnych wyników rozpoznawania mowy. Domyślnie - 1.
-
{{domxref("SpeechRecognition.serviceURI")}}
-
Specifies the location of the speech recognition service used by the current SpeechRecognition to handle the actual recognition. The default is the user agent's default speech service.
-
- -
-
- -

Methods

- -

SpeechRecognition also inherits methods from its parent interface, {{domxref("EventTarget")}}.

- -
-
{{domxref("SpeechRecognition.abort()")}}
-
Stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a {{domxref("SpeechRecognitionResult")}}.
-
{{domxref("SpeechRecognition.start()")}}
-
Starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition.
-
{{domxref("SpeechRecognition.stop()")}}
-
Stops the speech recognition service from listening to incoming audio, and attempts to return a {{domxref("SpeechRecognitionResult")}} using the audio captured so far.
-
- -

Events

- -

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

- -
-
audiostart
-
Fired when the user agent has started to capture audio.
- Also available via the onaudiostart property.
-
audioend
-
Fired when the user agent has finished capturing audio.
- Also available via the onaudioend property.
-
end
-
Fired when the speech recognition service has disconnected.
- Also available via the onend property.
-
error
-
Fired when a speech recognition error occurs.
- Also available via the onerror property.
-
nomatch
-
Fired when the speech recognition service returns a final result with no significant recognition. This may involve some degree of recognition, which doesn't meet or exceed the {{domxref("SpeechRecognitionAlternative.confidence","confidence")}} threshold.
- Also available via the onnomatch property.
-
result
-
Fired when the speech recognition service returns a result — a word or phrase has been positively recognized and this has been communicated back to the app.
- Also available via the onresult property.
-
soundstart
-
Fired when any sound — recognisable speech or not — has been detected.
- Also available via the onsoundstart property.
-
soundend
-
Fired when any sound — recognisable speech or not — has stopped being detected.
- Also available via the onsoundend property.
-
speechstart
-
Fired when sound that is recognised by the speech recognition service as speech has been detected.
- Also available via the onspeechstart property.
-
speechend
-
Fired when speech recognised by the speech recognition service has stopped being detected.
- Also available via the onspeechend property.
-
start
-
Fired when the speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition.
- Also available via the onstart property.
-
- -

Examples

- -

In our simple Speech color changer example, we create a new SpeechRecognition object instance using the {{domxref("SpeechRecognition.SpeechRecognition", "SpeechRecognition()")}} constructor, create a new {{domxref("SpeechGrammarList")}}, and set it to be the grammar that will be recognised by the SpeechRecognition instance using the {{domxref("SpeechRecognition.grammars")}} property.

- -

After some other values have been defined, we then set it so that the recognition service starts when a click event occurs (see {{domxref("SpeechRecognition.start()")}}.) When a result has been successfully recognised, the {{domxref("SpeechRecognition.onresult")}} handler fires,  we extract the color that was spoken from the event object, and then set the background color of the {{htmlelement("html")}} element to that colour.

- -
var grammar = '#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;'
-var recognition = new SpeechRecognition();
-var speechRecognitionList = new SpeechGrammarList();
-speechRecognitionList.addFromString(grammar, 1);
-recognition.grammars = speechRecognitionList;
-//recognition.continuous = false;
-recognition.lang = 'en-US';
-recognition.interimResults = false;
-recognition.maxAlternatives = 1;
-
-var diagnostic = document.querySelector('.output');
-var bg = document.querySelector('html');
-
-document.body.onclick = function() {
-  recognition.start();
-  console.log('Ready to receive a color command.');
-}
-
-recognition.onresult = function(event) {
-  var color = event.results[0][0].transcript;
-  diagnostic.textContent = 'Result received: ' + color;
-  bg.style.backgroundColor = color;
-}
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Web Speech API', '#speechreco-section', 'SpeechRecognition')}}{{Spec2('Web Speech API')}}
- -

Browser compatibility

- - - -

{{Compat("api.SpeechRecognition")}}

- -

See also

- - diff --git a/files/pl/web/css/css_grid_layout/realizing_common_layouts_using_css_grid_layout/index.html b/files/pl/web/css/css_grid_layout/realizing_common_layouts_using_css_grid_layout/index.html deleted file mode 100644 index 5013e75f11..0000000000 --- a/files/pl/web/css/css_grid_layout/realizing_common_layouts_using_css_grid_layout/index.html +++ /dev/null @@ -1,595 +0,0 @@ ---- -title: Projektowanie typowych układów za pomocą układu siatki CSS -slug: Web/CSS/CSS_Grid_Layout/Realizing_common_layouts_using_CSS_Grid_Layout -translation_of: Web/CSS/CSS_Grid_Layout/Realizing_common_layouts_using_CSS_Grid_Layout -original_slug: >- - Web/CSS/CSS_Grid_Layout/Realizacja_typowych_ukladow_za_pomoca_ukladu_siatki_CSS ---- -

Na zakończenie tego zestawu poradników do Układów Siatki CSS (ang. CSS Grid Layout), przejdę przez kilka różnych układów, demonstrujących niektóre z  technik, których można użyć podczas projektowania z użyciem tej technologii. Przyjrzymy się przykładowi, korzystającemu z wartości grid-template-areas, typowemu 12-kolumnowemu systemowi elastycznej siatki, a także wykazowi produktów stworzonemu za pomocą automatycznego rozmieszczania. Jak wynika z wyżej przedstawionych przykładów, często istnieje więcej niż jeden sposób, aby osiągnąć pożądany efekt z układem siatki. Wybierz  tę metodę, która jest najbardziej pomocna w rozwiązaniu problemów przed którymi stoisz i  dla projektów, które realizujesz.

- -

Responsywny układ strony korzystający z 1 do 3 kolumn o zmiennej pozycji elementów przy użyciu grid-template-areas

- -

Znacząca część stron internetowych jest odmianą tego typu układu; zawierającego treść, panele boczne, nagłówek oraz stopkę. Podczas projektowania responsywnej witryny, możesz zechcieć wyświetlić stronę w układzie pojedynczej kolumny dla małych ekranów, dla  wyświetlacza o wartości granicznej dodać panel boczny, a dla najszerszych ekranów wprowadzić układ w trzech kolumnach.

- -

Image of the three different layouts created by redefining our grid at two breakpoints.

- -

Zamierzam stworzyć taki układ korzystając z  nazwanych pól szablonu, o których możecie dowiedzieć się więcej z kursu Grid template areas.

- -

Mój szkielet  składa się z pojemnika zawierającego elementy z przeznaczeniem na: nagłówek i stopkę, główną zawartość strony, menu, panel boczny oraz blok przeznaczony na reklamę.

- -
- - -
<div class="wrapper">
-        <header class="main-head">The header</header>
-        <nav class="main-nav">
-            <ul>
-                <li><a href="">Nav 1</a></li>
-                <li><a href="">Nav 2</a></li>
-                <li><a href="">Nav 3</a></li>
-            </ul>
-        </nav>
-        <article class="content">
-            <h1>Main article area</h1>
-            <p>In this layout, we display the areas in source order for any screen less that 500 pixels wide. We go to a two column layout, and then to a three column layout by redefining the grid, and the placement of items on the grid.</p>
-        </article>
-        <aside class="side">Sidebar</aside>
-        <div class="ad">Advertising</div>
-        <footer class="main-footer">The footer</footer>
-</div>
-
- -

Używamy cechy {{cssxref("grid-template-areas")}} by stworzyć układ strony. Nie korzystamy jeszcze z zapytań o środki dostępu (ang. media-queries). Musimy teraz nadać odpowiednie nazwy polom. Żeby to zrobić skorzystamy z właściwości {{cssxref("grid-area")}}.

- -
.main-head {
-  grid-area: header;
-}
-.content {
-  grid-area: content;
-}
-.main-nav {
-  grid-area: nav;
-}
-.side {
-  grid-area: sidebar;
-}
-.ad {
-  grid-area: ad;
-}
-.main-footer {
-  grid-area: footer;
-}
-
- -

Sama w sobie, operacja ta nie tworzy żadnego układu, aczkolwiek pozwala nam na to, dzięki nadanym nazwom.   Nadal nie korzystając z zapytań o urządzenie dostępu, nadam teraz stronie układ tworzony z myślą o wyświetlaczach mobilnych. W tym wypadku zachowam pierwotną kolejność elementów, taką jak w układzie szkieletu, starając się uniknąć najmniejszego rozdźwięku pomiędzy szablonem znaczników, a ukladem siatki, zgodnie z poradami zawartymi w Grid layout and accessibility. Nie definuję kolumn, ani rzędów, jednak taka stylizacja tworzy nam układ jednokolumnowy, co się zaś tyczy rzędów, zostaną stworzone samoistnie dla każdego elementu wskazanej siatki.

- -
.wrapper {
-  display: grid;
-  grid-gap: 20px;
-  grid-template-areas:
-    "header"
-    "nav"
-    "content"
-    "sidebar"
-    "ad"
-    "footer";
-}
-
- -

Zdefiniowany mobilny układ strony (jedna kolumna) będzie się teraz wyświetlał jednakowo na każdym urządzeniu, nieleżnie od jego rozmiarów. Żeby to zmienić możemy posłużyć się zapytaniem o środek dostępu i przedefiniować nasz układ na wypadek, gdyby pojawiło się wystarczająco dużo miejsca na ekranie, żeby zmieścić kolejną kolumnę.

- -
@media (min-width: 500px) {
-  .wrapper {
-    grid-template-columns: 1fr 3fr;
-    grid-template-areas:
-      "header  header"
-      "nav     nav"
-      "sidebar content"
-      "ad      footer";
-  }
-  nav ul {
-    display: flex;
-    justify-content: space-between;
-  }
-}
-
- -

Możesz zaobserwować, jak będzie wyglądał nowy układ przyglądając się wartości cechy {{cssxref("grid-template-areas")}}. Element header  (nagłówek) rozciąga się na dwie kolumny, tak, jak i element nav (menu). Wtrzecim rzędzie sąsiaduje element sidebar (panel boczny) oraz element content (zawartość strony). W czwartym rzędzie umieściłem element ad (blok reklamowy) zamiast panelu bocznego, a na samym końcu element footer (stopkę) rozciągnietą na cały piąty rząd. Użyłem elastycznego bloku (flexbox) dla menu, tak by wyświetliło się w oddalonym rzędzie.

- -

Mogę teraz dodać ostatnią wartość graniczną, wyznaczającą przejście do układu w trzech kolumnach.

- -
@media (min-width: 700px) {
-  .wrapper {
-    grid-template-columns: 1fr 4fr 1fr;
-    grid-template-areas:
-      "header header  header"
-      "nav    content sidebar"
-      "nav    content ad"
-      "footer footer  footer"
-   }
-   nav ul {
-     flex-direction: column;
-   }
-}
-
- -

The three-column layout has two 1fr unit side columns and a middle column that has 4fr as the track size. This means that the available space in the container is split into 6 and assigned in proportion to our three tracks – one part each to the side columns and 4 parts to the center.

- -

In this layout I am displaying the nav in the left column, alongside the content. In the right column we have the sidebar and underneath it the advertisements (ad). The footer now spans right across the bottom of the layout. I then use a flexbox to display the navigation as a column.

- -

{{ EmbedLiveSample('layout_1', '800', '500') }}

-
- -

This is a simple example but demonstrates how we can use a grid layout to rearrange our layout for different breakpoints. In particular I am changing the location of that ad block, as appropriate in my different column setups. I find this named areas method very helpful at a prototyping stage, it is easy to play around with the location of elements. You could always begin to use grid in this way for prototyping, even if you can’t rely on it fully in production due to the browsers that visit your site.

- -

A flexible 12-column layout

- -

If you have been working with one of the many frameworks or grid systems you may be accustomed to laying out your site on a 12- or 16-column flexible grid. We can create this type of system using CSS Grid Layout. As a simple example, I am creating a 12-column flexible grid that has 12 1fr-unit column tracks, they all have a start line named col-start. This means that we will have twelve grid lines named col-start.

- -
- - -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(12, [col-start] 1fr);
-  grid-gap: 20px;
-}
-
- -

To demonstrate how this grid system works I have four child elements inside my wrapper.

- -
<div class="wrapper">
-  <div class="item1">Start column line 1, span 3 column tracks.</div>
-  <div class="item2">Start column line 6, span 4 column tracks. 2 row tracks.</div>
-  <div class="item3">Start row 2 column line 2, span 2 column tracks.</div>
-  <div class="item4">Start at column line 3, span to the end of the grid (-1).</div>
-</div>
-
- -

I can then place these on the grid using the named lines, and also the span keyword.

- -
.item1 {
-  grid-column: col-start / span 3;
-}
-.item2 {
-  grid-column: col-start 6 / span 4 ;
-  grid-row: 1 / 3;
-}
-.item3 {
-  grid-column: col-start 2 / span 2;
-  grid-row: 2;
-}
-.item4 {
-  grid-column: col-start 3 / -1;
-  grid-row: 3;
-}
-
- -

{{ EmbedLiveSample('layout_2', '800', '400') }}

-
- -

As described in the guide to named lines, we are using the named line to place our item. As we have 12 lines all with the same name we use the name, and then the index of the line. You could also use the line index itself if you prefer and avoid using named lines at all.

- -

Rather than setting the end line number, I have chosen to say how many tracks this element should span, using the span keyword. I like this approach as when working with a multiple-column layout system we usually think of blocks in terms of the number of tracks of the grid they span, and adjust that for different breakpoints. To see how the blocks align themselves to the tracks, use the Firefox Grid Inspector. It clearly demonstrates how our items are placed.

- -

Showing the items placed on the grid with grid tracks highlighted.

- -

There are some key differences with how a grid layout works over the grid systems you may have used previously. As you can see, we do not need to add any markup to create a row, grid systems need to do this to stop elements popping up into the row above. With CSS Grid Layout, we can place things into rows, with no danger of them rising up into the row above if it is left empty. Due to this strict column and row placement we can also easily leave white space in our layout. We also don’t need special classes to pull or push things, to indent them into the grid. All we need to do is specify the start and end line for the item.

- -

Building a layout using the 12-column system

- -

To see how this layout method works in practice, we can create the same layout that we created with {{cssxref("grid-template-areas")}}, this time using the 12-column grid system. I am starting with the same markup as used for the grid template areas example.

- -
- - -
<div class="wrapper">
-        <header class="main-head">The header</header>
-        <nav class="main-nav">
-            <ul>
-                <li><a href="">Nav 1</a></li>
-                <li><a href="">Nav 2</a></li>
-                <li><a href="">Nav 3</a></li>
-            </ul>
-        </nav>
-        <article class="content"><h1>Main article area</h1>
-        <p>In this layout, we display the areas in source order for any screen less that 500 pixels wide. We go to a two column layout, and then to a three column layout by redefining the grid, and the placement of items on the grid.</p></article>
-        <aside class="side">Sidebar</aside>
-        <div class="ad">Advertising</div>
-        <footer class="main-footer">The footer</footer>
-    </div>
-
- -

I can then set up our grid, as for the example 12-column layout above.

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(12, [col-start] 1fr);
-  grid-gap: 20px;
-}
-
- -

We are once again going to make this a responsive layout, this time however using named lines. Every breakpoint will use a 12-column grid, however the number of tracks that items will span changes depending on the size of the screen.

- -

We start mobile first, and all we want for the narrowest screens is for the items to remain in source order, and all span right across the grid.

- -
.wrapper > * {
-  grid-column: col-start / span 12;
-}
-
- -

At the next breakpoint we want to move to a two-column layout. Our header and navigation still span the full grid, so we do not need to specify any positioning for them. The sidebar is starting on the first column line named col-start, spanning 3 lines. It goes after row line 3, as the header and navigation are in the first two row tracks.

- -

The ad panel is below the sidebar, so starts at grid row line 4. Then we have the content and footer starting at col-start 4 and spanning 9 tracks taking them to the end of the grid.

- -
@media (min-width: 500px) {
-
-  .side {
-    grid-column: col-start / span 3;
-    grid-row: 3;
-  }
-  .ad {
-    grid-column: col-start / span 3;
-    grid-row: 4;
-  }
-  .content, .main-footer {
-    grid-column: col-start 4 / span 9;
-  }
-  nav ul {
-    display: flex;
-    justify-content: space-between;
-  }
-}
-
- -

Finally we go to the three-column version of this layout. The header continues to span right across the grid, but now the navigation moves down to become the first sidebar, with the content and then the sidebar next to it. The footer now also spans across the full layout.

- -
@media (min-width: 700px) {
-  .main-nav {
-    grid-column: col-start / span 2;
-    grid-row: 2 / 4;
-  }
-  .content {
-    grid-column: col-start 3 / span 8;
-    grid-row: 2 / 4;
-  }
-  .side {
-    grid-column: col-start 11 / span 2;
-    grid-row: 2;
-  }
-  .ad {
-    grid-column: col-start 11 / span 2;
-    grid-row: 3;
-  }
-  .main-footer {
-    grid-column: col-start / span 12;
-  }
-  nav ul {
-    flex-direction: column;
-  }
-}
-
- -

{{ EmbedLiveSample('layout_3', '800', '450') }}

-
- -

Once again the Grid Inspector is useful to help us see how our layout has taken shape.

- -

Showing the layout with grid tracks highlighted by the grid inspector.

- -

Something to note as we create this layout is that we haven’t needed to explicitly position every element on the grid at each breakpoint. We have been able to inherit the placement set up for earlier breakpoints – an advantage of working “mobile first”. We are also able to take advantage of grid auto-placement. By keeping elements in a logical order, auto-placement does quite a lot of work for us in placing items onto the grid. In the final example in this guide we will create a layout that entirely relies on auto-placement.

- -

A product listing with auto-placement

- -

Many layouts are essentially sets of “cards” – product listings, image galleries, and so on. A grid can make it very easy to create these listings in a way that is responsive without needing to add media queries to make it so. In this next example I’m combining CSS Grid and Flexbox Layouts to make a simple product listing layout.

- -

The markup for my listing is an unordered list of items. Each item contains a heading, some text of varying height, and a call to action link.

- -
-
<ul class="listing">
-  <li>
-    <h2>Item One</h2>
-    <div class="body"><p>The content of this listing item goes here.</p></div>
-    <div class="cta"><a href="">Call to action!</a></div>
-  </li>
-   <li>
-     <h2>Item Two</h2>
-     <div class="body"><p>The content of this listing item goes here.</p></div>
-     <div class="cta"><a href="">Call to action!</a></div>
-   </li>
-   <li class="wide">
-     <h2>Item Three</h2>
-     <div class="body"><p>The content of this listing item goes here.</p>
-     <p>This one has more text than the other items.</p>
-     <p>Quite a lot more</p>
-     <p>Perhaps we could do something different with it?</p></div>
-     <div class="cta"><a href="">Call to action!</a></div>
-    </li>
-    <li>
-     <h2>Item Four</h2>
-     <div class="body"><p>The content of this listing item goes here.</p></div>
-     <div class="cta"><a href="">Call to action!</a></div>
-    </li>
-     <li>
-     <h2>Item Five</h2>
-     <div class="body"><p>The content of this listing item goes here.</p></div>
-      <div class="cta"><a href="">Call to action!</a></div>
-    </li>
-</ul>
-
- - - -

We are going to create a grid with a flexible number of flexible columns. I want them never to become smaller than 200 pixels, and then to share any available remaining space equally – so we always get equal width column tracks. We achieve this with the minmax() function in our repeat notation for track sizing.

- -
.listing {
-  list-style: none;
-  margin: 2em;
-  display: grid;
-  grid-gap: 20px;
-  grid-template-columns: repeat(auto-fill,minmax(200px, 1fr));
-}
-
- -

As soon as I add this CSS, the items start to lay out as a grid. If I make the window smaller or wider the number of column tracks changes – without me needing to add breakpoints using media queries and redefine the grid.

- -

I can then tidy up the internals of the boxes using a little touch of flexbox. I set the list item to display: flex and the flex-direction to column. I can then use an auto margin on the .cta to push this bar down to the bottom of the box.

- -
.listing li {
-  border: 1px solid #ffe066;
-  border-radius: 5px;
-  display: flex;
-  flex-direction: column;
-}
-.listing .cta {
-  margin-top: auto;
-  border-top: 1px solid #ffe066;
-  padding: 10px;
-  text-align: center;
-}
-.listing .body {
-  padding: 10px;
-}
-
- -

This is really one of the key reasons I would use flexbox rather than grid, if I am just aligning or distributing something in a single dimension, that’s a flexbox use case. 

- -

{{ EmbedLiveSample('layout_4', '800', '900') }}

-
- -

This is all looking fairly complete now, however we sometimes have these cards which contain far more content than the others. It might be nice to cause those to span two tracks, and then they won’t be so tall. I have a class of wide on my larger item, and I add a rule {{cssxref("grid-column-end")}} with a value of span 2. Now when grid encounters this item, it will assign it two tracks. At some breakpoints, this means that we'll get a gap in the grid – where there isn’t space to lay out a two-track item.

- -

The layout has gaps as there is not space to layout a two track item.

- -

I can cause a grid to backfill those gaps by setting {{cssxref("grid-auto-flow")}}: dense on the grid container. Take care when doing this however as it does take items away from their logical source order. You should only do this if your items do not have a set order – and be aware of the issues of the tab order following the source and not your reordered display.

- -
- - -
.listing {
-  list-style: none;
-  margin: 2em;
-  display: grid;
-  grid-gap: 20px;
-  grid-auto-flow: dense;
-  grid-template-columns: repeat(auto-fill,minmax(200px, 1fr));
-}
-.listing .wide {
-  grid-column-end: span 2;
-}
-
- -

{{ EmbedLiveSample('layout_5', '800', '900') }}

- -

This technique of using auto-placement with some rules applied to certain items is very useful, and can help you to deal with content that is being output by a CMS for example, where you have repeated items and can perhaps add a class to certain ones as they are rendered into the HTML.

-
- -

Further exploration

- -

The best way to learn to use grid layout is to continue to build examples like the ones we have covered here. Pick something that you normally build using your framework of choice, or using floats, and see if you can build it using grid. Don’t forget to find examples that are impossible to build with current methods. That might mean taking inspiration from magazines or other non-web sources. Grid Layout opens up possibilities that we have not had before, we don’t need to be tied to the same old layouts to use it.

- - - - diff --git a/files/pl/web/html/element/input/index.html b/files/pl/web/html/element/input/index.html deleted file mode 100644 index bbe073d4b4..0000000000 --- a/files/pl/web/html/element/input/index.html +++ /dev/null @@ -1,1376 +0,0 @@ ---- -title: -slug: Web/HTML/Element/Input -translation_of: Web/HTML/Element/input ---- -

The HTML <input> element is used to create interactive controls for web-based forms in order to accept data from the user. The semantics of an <input> varies considerably depending on the value of its type attribute.

- - - -

Attributes

- -

This element includes the global attributes.

- -
-
{{htmlattrdef("type")}}
-
The type of control to display. The default type is text, if this attribute is not specified. Possible values are: -
    -
  • button: A push button with no default behavior.
  • -
  • checkbox: A check box. You must use the value attribute to define the value submitted by this item. Use the checked attribute to indicate whether this item is selected. You can also use the indeterminate attribute to indicate that the checkbox is in an indeterminate state (on most platforms, this draws a horizontal line across the checkbox).
  • -
  • color: {{HTMLVersionInline("5")}} A control for specifying a color. A color picker's UI has no required features other than accepting simple colors as text (more info).
  • -
  • date: {{HTMLVersionInline("5")}} A control for entering a date (year, month, and day, with no time).
  • -
  • datetime: {{HTMLVersionInline("5")}} A control for entering a date and time (hour, minute, second, and fraction of a second) based on UTC time zone.
  • -
  • datetime-local: {{HTMLVersionInline("5")}} A control for entering a date and time, with no time zone.
  • -
  • email: {{HTMLVersionInline("5")}} A field for editing an e-mail address. The input value is validated to contain either the empty string or a single valid e-mail address before submitting. The {{cssxref(":valid")}} and {{cssxref(":invalid")}} CSS pseudo-classes are applied as appropriate.
  • -
  • file: A control that lets the user select a file. Use the accept attribute to define the types of files that the control can select.
  • -
  • hidden: A control that is not displayed, but whose value is submitted to the server.
  • -
  • image: A graphical submit button. You must use the src attribute to define the source of the image and the alt attribute to define alternative text. You can use the height and width attributes to define the size of the image in pixels.
  • -
  • month: {{HTMLVersionInline("5")}} A control for entering a month and year, with no time zone.
  • -
  • number: {{HTMLVersionInline("5")}} A control for entering a floating point number.
  • -
  • password: A single-line text field whose value is obscured. Use the maxlength attribute to specify the maximum length of the value that can be entered.
  • -
  • radio: A radio button. You must use the value attribute to define the value submitted by this item. Use the checked attribute to indicate whether this item is selected by default. Radio buttons that have the same value for the name attribute are in the same "radio button group"; only one radio button in a group can be selected at one time.
  • -
  • range: {{HTMLVersionInline("5")}} A control for entering a number whose exact value is not important. This type control uses the following default values if the corresponding attributes are not specified: -
      -
    • min: 0
    • -
    • max: 100
    • -
    • value: min + (max-min)/2, or min if max is less than min
    • -
    • step: 1
    • -
    -
  • -
  • reset: A button that resets the contents of the form to default values.
  • -
  • search: {{HTMLVersionInline("5")}} A single-line text field for entering search strings; line-breaks are automatically removed from the input value.
  • -
  • submit: A button that submits the form.
  • -
  • tel: {{HTMLVersionInline("5")}} A control for entering a telephone number; line-breaks are automatically removed from the input value, but no other syntax is enforced. You can use attributes such as pattern and maxlength to restrict values entered in the control. The {{cssxref(":valid")}} and {{cssxref(":invalid")}} CSS pseudo-classes are applied as appropriate.
  • -
  • text: A single-line text field; line-breaks are automatically removed from the input value.
  • -
  • time: {{HTMLVersionInline("5")}} A control for entering a time value with no time zone.
  • -
  • url: {{HTMLVersionInline("5")}} A field for editing a URL. The input value is validated to contain either the empty string or a valid absolute URL before submitting. Line-breaks and leading or trailing whitespace are automatically removed from the input value. You can use attributes such as pattern and maxlength to restrict values entered in the control. The {{cssxref(":valid")}} and {{cssxref(":invalid")}} CSS pseudo-classes are applied as appropriate.
  • -
  • week: {{HTMLVersionInline("5")}} A control for entering a date consisting of a week-year number and a week number with no time zone.
  • -
-
-
{{htmlattrdef("accept")}}
-
If the value of the type attribute is file, this attribute indicates the types of files that the server accepts; otherwise it is ignored. The value must be a comma-separated list of unique content type specifiers: -
    -
  • A file extension starting with the STOP character (U+002E). (E.g.: ".jpg,.png,.doc")
  • -
  • A valid MIME type with no extensions
  • -
  • audio/* representing sound files {{HTMLVersionInline("5")}}
  • -
  • video/* representing video files {{HTMLVersionInline("5")}}
  • -
  • image/* representing image files {{HTMLVersionInline("5")}}
  • -
-
-
{{htmlattrdef("accesskey")}} {{HTMLVersionInline(4)}} only, {{obsoleteGeneric("inline", "HTML5")}}
-
A single-character that the user can press to switch input focus to the control. This attribute is global in HTML5.
-
{{htmlattrdef("mozactionhint")}} {{non-standard_inline}}
-
Specifies an "action hint" used to determine how to label the enter key on mobile devices with virtual keyboards. Supported values are go, done, next, search, and send; these automatically get mapped to the appropriate string (and are case-insensitive).
-
{{htmlattrdef("autocapitalize")}} {{non-standard_inline}}
-
This is a nonstandard attribute used by iOS Safari Mobile which controls whether and how the text value should be automatically capitalized as it is entered/edited by the user. The non-deprecated values are available in iOS 5 and later. Possible values are: -
    -
  • none: Completely disables automatic capitalization
  • -
  • sentences: Automatically capitalize the first letter of sentences.
  • -
  • words: Automatically capitalize the first letter of words.
  • -
  • characters: Automatically capitalize all characters.
  • -
  • on: {{deprecated_inline()}} Deprecated since iOS 5.
  • -
  • off: {{deprecated_inline()}} Deprecated since iOS 5.
  • -
-
-
{{htmlattrdef("autocomplete")}} {{HTMLVersionInline("5")}}
-
This attribute indicates whether the value of the control can be automatically completed by the browser. This attribute is ignored if the value of the type attribute is hidden, password, checkbox, radio, file, or a button type (button, submit, reset, image). Possible values are: -
    -
  • off: The user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.
  • -
  • on: The browser can automatically complete the value based on values that the user has entered during previous uses.
  • -
- -

If the autocomplete attribute is not specified on an input element, then the browser uses the autocomplete attribute value of the <input> element's form owner. The form owner is either the form element that this <input> element is a descendant of or the form element whose id is specified by the form attribute of the input element. For more information, see the {{htmlattrxref("autocomplete", "form")}} attribute in {{HTMLElement("form")}}.

- -

The autocomplete attribute also controls whether Firefox will, unlike other browsers, persist the dynamic disabled state and (if applicable) dynamic checkedness of an {{HTMLElement("input")}} across page loads. The persistence feature is enabled by default. Setting the value of the autocomplete attribute to off disables this feature; this works even when the autocomplete attribute would normally not apply to the {{HTMLElement("input")}} by virtue of its type. See {{bug(654072)}}.

-
-
{{htmlattrdef("autocorrect")}} {{non-standard_inline}}
-
This is a nonstandard attribute supported by Safari that is used to control whether autocorrection should be enabled when the user is entering/editing the text value of the {{HTMLElement("input")}}. Possible attribute values are: -
    -
  • on: Enable autocorrection
  • -
  • off: Disable autocorrection
  • -
-
-
{{htmlattrdef("autofocus")}} {{HTMLVersionInline("5")}}
-
This Boolean attribute lets you specify that a form control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form element in a document can have the autofocus attribute, which is a Boolean. It cannot be applied if the type attribute is set to hidden (that is, you cannot automatically set focus to a hidden control).
-
{{htmlattrdef("autosave")}} {{HTMLVersionInline("5")}}
-
This attribute should be defined as a unique value. If the value of the type attribute is search, previous search term values will persist in the dropdown across page load.
-
{{htmlattrdef("checked")}}
-
-

When the value of the type attribute is radio or checkbox, the presence of this Boolean attribute indicates that the control is selected by default; otherwise it is ignored.

- -

Firefox will, unlike other browsers, by default, persist the dynamic checked state of an {{HTMLElement("input")}} across page loads. Use the {{htmlattrxref("autocomplete","input")}} attribute to control this feature.

-
-
{{htmlattrdef("disabled")}}
-
-

This Boolean attribute indicates that the form control is not available for interaction. In particular, the click event will not be dispatched on disabled controls. Also, a disabled control's value isn't submitted with the form.

- -

Firefox will, unlike other browsers, by default, persist the dynamic disabled state of an {{HTMLElement("input")}} across page loads. Use the {{htmlattrxref("autocomplete","input")}} attribute to control this feature.

-
-
{{htmlattrdef("form")}} {{HTMLVersionInline("5")}}
-
The form element that the input element is associated with (its form owner). The value of the attribute must be an id of a {{HTMLElement("form")}} element in the same document. If this attribute is not specified, this <input> element must be a descendant of a {{HTMLElement("form")}} element. This attribute enables you to place <input> elements anywhere within a document, not just as descendants of their form elements. An input can only be associated with one form.
-
{{htmlattrdef("formaction")}} {{HTMLVersionInline("5")}}
-
The URI of a program that processes the information submitted by the input element, if it is a submit button or image. If specified, it overrides the {{htmlattrxref("action","form")}} attribute of the element's form owner.
-
{{htmlattrdef("formenctype")}} {{HTMLVersionInline("5")}}
-
If the input element is a submit button or image, this attribute specifies the type of content that is used to submit the form to the server. Possible values are: -
    -
  • application/x-www-form-urlencoded: The default value if the attribute is not specified.
  • -
  • multipart/form-data: Use this value if you are using an {{HTMLElement("input")}} element with the {{htmlattrxref("type","input")}} attribute set to file.
  • -
  • text/plain
  • -
- -

If this attribute is specified, it overrides the {{htmlattrxref("enctype","form")}} attribute of the element's form owner.

-
-
{{htmlattrdef("formmethod")}} {{HTMLVersionInline("5")}}
-
If the input element is a submit button or image, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are: -
    -
  • post: The data from the form is included in the body of the form and is sent to the server.
  • -
  • get: The data from the form are appended to the form attribute URI, with a '?' as a separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters.
  • -
- -

If specified, this attribute overrides the {{htmlattrxref("method","form")}} attribute of the element's form owner.

-
-
{{htmlattrdef("formnovalidate")}} {{HTMLVersionInline("5")}}
-
If the input element is a submit button or image, this Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the {{htmlattrxref("novalidate","form")}} attribute of the element's form owner.
-
{{htmlattrdef("formtarget")}} {{HTMLVersionInline("5")}}
-
If the input element is a submit button or image, this attribute is a name or keyword indicating where to display the response that is received after submitting the form. This is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). If this attribute is specified, it overrides the {{htmlattrxref("target", "form")}} attribute of the elements's form owner. The following keywords have special meanings: -
    -
  • _self: Load the response into the same browsing context as the current one. This value is the default if the attribute is not specified.
  • -
  • _blank: Load the response into a new unnamed browsing context.
  • -
  • _parent: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self.
  • -
  • _top: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self.
  • -
-
-
{{htmlattrdef("height")}} {{HTMLVersionInline("5")}}
-
If the value of the type attribute is image, this attribute defines the height of the image displayed for the button.
-
{{htmlattrdef("incremental")}} {{non-standard_inline}}
-
This is a nonstandard attribute supported by Safari that only applies when the type is search. If the attribute is present, regardless of what its value is, the {{HTMLElement("input")}} fires search events as the user edits the text value. The event is only fired after an implementation-defined timeout has elapsed since the most recent keystroke; new keystrokes reset the timeout. In other words, the event firing is debounced. If the attribute is absent, the search event is only fired when the user explicitly initiates a search (e.g. by pressing the Enter key while within field).
-
{{htmlattrdef("inputmode")}} {{HTMLVersionInline("5")}}
-
A hint to the browser for which keyboard to display. This attribute applies when the value of the type attribute is text, password, email, or url. Possible values are: -
    -
  • verbatim: Alphanumeric, non-prose content such as usernames and passwords.
  • -
  • latin: Latin-script input in the user's preferred language with typing aids such as text prediction enabled. For human-to-computer communication such as search boxes.
  • -
  • latin-name: As latin, but for human names.
  • -
  • latin-prose: As latin, but with more aggressive typing aids. For human-to-human communication such as instant messaging for email.
  • -
  • full-width-latin: As latin-prose, but for the user's secondary languages.
  • -
  • kana: Kana or romaji input, typically hiragana input, using full-width characters, with support for converting to kanji. Intended for Japanese text input.
  • -
  • katakana: Katakana input, using full-width characters, with support for converting to kanji. Intended for Japanese text input.
  • -
  • numeric: Numeric input, including keys for the digits 0 to 9, the user's preferred thousands separator character, and the character for indicating negative numbers. Intended for numeric codes, e.g. credit card numbers. For actual numbers, prefer using <input type="number">
  • -
  • tel: Telephone input, including asterisk and pound key. Use <input type="tel"> if possible instead.
  • -
  • email: Email input. Use <input type="email"> if possible instead.
  • -
  • url: URL input. Use <input type="url"> if possible instead.
  • -
-
-
{{htmlattrdef("list")}} {{HTMLVersionInline("5")}}
-
Identifies a list of pre-defined options to suggest to the user. The value must be the id of a {{HTMLElement("datalist")}} element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the type attribute's value is hidden, checkbox, radio, file, or a button type.
-
{{htmlattrdef("max")}} {{HTMLVersionInline("5")}}
-
The maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value.
-
{{htmlattrdef("maxlength")}}
-
If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the maximum number of characters (in Unicode code points) that the user can enter; for other control types, it is ignored. It can exceed the value of the size attribute. If it is not specified, the user can enter an unlimited number of characters. Specifying a negative number results in the default behavior; that is, the user can enter an unlimited number of characters. The constraint is evaluated only when the value of the attribute has been changed.
-
{{htmlattrdef("min")}} {{HTMLVersionInline("5")}}
-
The minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value.
-
{{htmlattrdef("minlength")}} {{HTMLVersionInline("5")}}
-
If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the minimum number of characters (in Unicode code points) that the user can enter; for other control types, it is ignored.
-
{{htmlattrdef("multiple")}} {{HTMLVersionInline("5")}}
-
This Boolean attribute indicates whether the user can enter more than one value. This attribute applies when the type attribute is set to email or file; otherwise it is ignored.
-
{{htmlattrdef("name")}}
-
The name of the control, which is submitted with the form data.
-
{{htmlattrdef("pattern")}} {{HTMLVersionInline("5")}}
-
A regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored. The regular expression language is the same as JavaScript's. The pattern is not surrounded by forward slashes.
-
{{htmlattrdef("placeholder")}} {{HTMLVersionInline("5")}}
-
A hint to the user of what can be entered in the control . The placeholder text must not contain carriage returns or line-feeds. This attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored. -
Note: Do not use the placeholder attribute instead of a {{HTMLElement("label")}} element. Their purposes are different: the {{HTMLElement("label")}} attribute describes the role of the form element; that is, it indicates what kind of information is expected, the placeholder attribute is a hint about the format the content should take. There are cases in which the placeholder attribute is never displayed to the user, so the form must be understandable without it.
-
-
{{htmlattrdef("readonly")}}
-
This Boolean attribute indicates that the user cannot modify the value of the control. -

{{HTMLVersionInline("5")}} This attribute is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type.

-
-
{{htmlattrdef("required")}} {{HTMLVersionInline("5")}}
-
This attribute specifies that the user must fill in a value before submitting a form. It cannot be used when the type attribute is hidden, image, or a button type (submit, reset, or button). The {{cssxref(":optional")}} and {{cssxref(":required")}} CSS pseudo-classes will be applied to the field as appropriate.
-
{{htmlattrdef("results")}} {{non-standard_inline}}
-
This is a nonstandard attribute supported by Safari that only applies when the type is search. It is used to control the maximum number of entries that should be displayed in the {{HTMLElement("input")}}'s native dropdown list of past search queries. Its value should be a nonnegative decimal integer.
-
{{htmlattrdef("selectionDirection")}} {{HTMLVersionInline("5")}}
-
The direction in which selection occurred. This is "forward" if the selection was made from left-to-right in an LTR locale or right-to-left in an RTL locale, or "backward" if the selection was made in the opposite direction. This can be "none" if the selection direction is unknown.
-
{{htmlattrdef("size")}}
-
The initial size of the control. This value is in pixels unless the value of the type attribute is text or password, in which case, it is an integer number of characters. Starting in HTML5, this attribute applies only when the type attribute is set to text, search, tel, url, email, or password; otherwise it is ignored. In addition, the size must be greater than zero. If you don't specify a size, a default value of 20 is used.
-
{{htmlattrdef("spellcheck")}} {{HTMLVersionInline("5")}}
-
Setting the value of this attribute to true indicates that the element needs to have its spelling and grammar checked. The value default indicates that the element is to act according to a default behavior, possibly based on the parent element's own spellcheck value. The value false indicates that the element should not be checked.
-
{{htmlattrdef("src")}}
-
If the value of the type attribute is image, this attribute specifies a URI for the location of an image to display on the graphical submit button; otherwise it is ignored.
-
{{htmlattrdef("step")}} {{HTMLVersionInline("5")}}
-
Works with the min and max attributes to limit the increments at which a numeric or date-time value can be set. It can be the string any or a positive floating point number. If this attribute is not set to any, the control accepts only values at multiples of the step value greater than the minimum.
-
{{htmlattrdef("tabindex")}} element-specific in {{HTMLVersionInline(4)}}, global in {{HTMLVersionInline("5")}}
-
The position of the element in the tabbing navigation order for the current document.
-
{{htmlattrdef("usemap")}} {{HTMLVersionInline(4)}} only, {{obsoleteGeneric("inline", "HTML5")}}
-
The name of a {{HTMLElement("map")}} element to as an image map.
-
{{htmlattrdef("value")}}
-
The initial value of the control. This attribute is optional except when the value of the type attribute is radio or checkbox.
- Note that when reloading the page, Gecko and IE will ignore the value specified in the HTML source, if the value was changed before the reload.
-
{{htmlattrdef("width")}} {{HTMLVersionInline("5")}}
-
If the value of the type attribute is image, this attribute defines the width of the image displayed for the button.
-
{{htmlattrdef("x-moz-errormessage")}} {{non-standard_inline}}
-
This Mozilla extension allows you to specify the error message to display when a field doesn't successfully validate.
-
- -

Notes

- -

File inputs

- -
-

Note: Starting in {{Gecko("2.0")}}, calling the click() method on an {{HTMLElement("input")}} element of type "file" opens the file picker and lets the user select files. See Using files from web applications for an example and more details.

-
- -

You can't set the value of a file picker from a script; doing something like the following has no effect:

- -
var e = getElementById("someFileInputElement");
-e.value = "foo";
-
- -

Error messages

- -

If you want Firefox to present a custom error message when a field fails to validate, you can use the x-moz-errormessage attribute to do so:

- -
<input type="email" x-moz-errormessage="Please specify a valid email address.">
-
- -

Note, however, that this is not standard and will not have an effect on other browsers.

- -

Examples

- -

A simple input box

- -
<!-- A basic input -->
-<input type="text" name="input" value="Type here">
-
- -

- -

A common use-case scenario

- -
<!-- A common form that includes input tags -->
-<form action="getform.php" method="get">
-    <label>First name: <input type="text" name="first_name" /></label><br />
-     <label>Last name: <input type="text" name="last_name" /></label><br />
-        <label>E-mail: <input type="email" name="user_email" /></label><br />
-<input type="submit" value="Submit" />
-</form>
-
- -

Using mozactionhint on Firefox mobile

- -

You can use the {{htmlattrxref("mozactionhint", "input")}} attribute to specify the text for the label of the enter key on the virtual keyboard when your form is rendered on Firefox mobile. For example, to have a "Next" label, you can do this:

- -
<input type="text" mozactionhint="next" name="sometext" />
-
- -

The result is:

- -

mozactionhint.png

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'the-input-element.html#the-input-element', '<input>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', 'forms.html#the-input-element', '<input>')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('HTML4.01', 'interact/forms.html#h-17.4', '<form>')}}{{Spec2('HTML4.01')}} 
- -

Browser compatibility

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1.0{{CompatGeckoDesktop("1.7 or earlier")}}2 or earlier1.01.0
type1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
type=button1.0{{CompatGeckoDesktop("1.7 or earlier")}}31.01.0
type=checkbox1.0{{CompatGeckoDesktop("1.7 or earlier")}}
- {{CompatGeckoDesktop("1.9.2")}} for indeterminate value
21.01.0
type=color21.0 -

{{CompatGeckoDesktop("29.0")}} (Not for Windows Touch yet)

-
{{CompatNo}}11.01{{CompatNo}}
type=date5.0{{CompatNo}}
- {{unimplemented_inline("825294")}}
{{CompatNo}}10.62{{CompatVersionUnknown}} (recognized but no UI)
type=datetime -

{{CompatNo}}
- (recognized but no UI)

-
{{CompatNo}}
- {{unimplemented_inline("825294")}}
{{CompatNo}}10.62{{CompatVersionUnknown}} (recognized but no UI)
type=datetime-local5.0{{CompatNo}}
- {{unimplemented_inline("825294")}}
{{CompatNo}}10.62{{CompatVersionUnknown}} (recognized but no UI)
type=email5.0{{CompatGeckoDesktop("2.0")}}1010.62{{CompatUnknown}}
type=file1.0{{CompatGeckoDesktop("1.7 or earlier")}}3.021.01.0
type=hidden1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
type=image1.0Gecko 2.0 only sends x and y coordinates when clicked, not longer the name/value of the element21.01.0
type=month5.0{{CompatNo}}
- {{unimplemented_inline("446510")}}
{{CompatNo}}10.62{{CompatVersionUnknown}} (recognized but no UI)
type=number6.0 (Localization in Chrome 11){{CompatGeckoDesktop("29.0")}}10
- (recognized but no UI)
10.62{{CompatVersionUnknown}}
type=password1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
type=radio1.0{{CompatGeckoDesktop("1.7 or earlier")}}
- {{CompatGeckoDesktop("1.9.2")}} for indeterminate value
21.01.0
type=range5.0{{CompatGeckoDesktop("23.0")}}1010.62 (11.01 added support for a default value){{CompatVersionUnknown}}
type=reset1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
type=search5.0{{CompatGeckoDesktop("2.0")}}1011.01{{CompatVersionUnknown}}
type=submit1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
type=tel5.0{{CompatGeckoDesktop("2.0")}}1011.01{{CompatUnknown}}
type=text1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
type=time5.0{{CompatNo}}
- {{unimplemented_inline("825294")}}
{{CompatNo}}10.62{{CompatVersionUnknown}} (recognized but no UI)
type=url5.0{{CompatGeckoDesktop("2.0")}}1010.62{{CompatUnknown}}
type=week5.0{{CompatNo}}
- {{unimplemented_inline("825294")}}
{{CompatNo}}10.62{{CompatVersionUnknown}} (recognized but no UI)
-

accept=[file extension]

-
{{CompatVersionUnknown}}{{CompatNo}}10{{CompatUnknown}}{{CompatNo}}
-

accept=[MIME type]

-
8.0{{CompatGeckoDesktop("16.0")}}1010{{CompatNo}}
accept=audio/*{{CompatVersionUnknown}}{{CompatGeckoDesktop("2.0")}}
- Filters for the following audio file extensions: .aac, .aif, .flac, .iff, .m4a, .m4b, .mid, .midi, .mp3, .mpa, .mpc, .oga, .ogg, .ra, .ram, .snd, .wav, .wma
10{{CompatNo}}{{CompatNo}}
accept=video/*{{CompatVersionUnknown}}{{CompatGeckoDesktop("2.0")}}
- Filters for the following video file extensions: .avi, .divx, .flv, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .ogm, .ogv, .ogx, .rm, .rmvb, .smil, .webm, .wmv, .xvid
10{{CompatNo}}{{CompatNo}}
accept=image/*{{CompatVersionUnknown}}{{CompatGeckoDesktop("2.0")}}
- Filters for the following image file extensions: .jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw
10{{CompatNo}}{{CompatNo}}
accept=[. + ext]{{CompatUnknown}}{{CompatGeckoDesktop("37.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
accesskey1.0{{CompatVersionUnknown}}61.0{{CompatUnknown}}
mozactionhint{{CompatNo}}{{CompatGeckoDesktop("2.0")}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
autocomplete17.0{{CompatGeckoDesktop("2.0")}}59.65.2
autofocus5.0{{CompatGeckoDesktop("2.0")}}109.65.0
checked1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
disabled1.0{{CompatGeckoDesktop("1.7 or earlier")}}61.01.0
form9.0{{CompatGeckoDesktop("2.0")}}{{CompatUnknown}}10.62{{CompatUnknown}}
formaction9.0{{CompatGeckoDesktop("2.0")}}1010.625.2
formenctype9.0{{CompatGeckoDesktop("2.0")}}1010.62{{CompatUnknown}}
formmethod9.0{{CompatGeckoDesktop("2.0")}}1010.625.2
formnovalidate5.0 (in 6.0 only worked with HTML5 doctype, validation support in 7.0 was disabled and re-enabled in 10.0){{CompatGeckoDesktop("2.0")}}1010.62{{CompatUnknown}}
formtarget9.0{{CompatGeckoDesktop("2.0")}}1010.625.2
height1.0{{CompatGeckoDesktop("16.0")}}{{CompatUnknown}}1.0{{CompatUnknown}}
incremental{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}
inputmode{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
list20.0{{CompatGeckoDesktop("2.0")}}109.6{{CompatNo}}
max5.0{{CompatGeckoDesktop("16.0")}}{{CompatUnknown}}10.62{{CompatUnknown}}
maxlength1.0{{CompatGeckoDesktop("1.7")}}21.01.0
min5.0{{CompatGeckoDesktop("16.0")}}{{CompatUnknown}}10.62{{CompatUnknown}}
minlength40.0{{CompatUnknown}}{{CompatUnknown}}27.0{{CompatUnknown}}
multiple1.0 (supported for type=file and type=email as of 5.0){{CompatGeckoDesktop("1.9.2")}} for type=file
- {{CompatVersionUnknown}} for type=email
101.0 (10.62 support for type=file and as of 11.01 type=email){{CompatUnknown}}
name1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
pattern5.0{{CompatGeckoDesktop("2.0")}}109.6{{CompatNo}}
placeholder10.0{{CompatGeckoDesktop("2.0")}}1011.005.0
readonly1.0{{CompatGeckoDesktop("1.7 or earlier")}}6 (missing for type of checkbox, radio)1.01.0
required5.0 (support for select element as of 10){{CompatGeckoDesktop("2.0")}}109.6{{CompatNo}}
size1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
spellcheck10.0{{CompatGeckoDesktop("1.9.2")}}1011.04.0
src1.0{{CompatGeckoDesktop("1.7 or earlier")}}21.01.0
step6.0{{CompatGeckoDesktop("16.0")}}1010.625.0
tabindex1.0{{CompatGeckoDesktop("1.7 or earlier")}}6 (elements with tabindex > 0 are not navigated){{CompatVersionUnknown}}{{CompatUnknown}}
width1.0{{CompatGeckoDesktop("16.0")}}{{CompatUnknown}}1.0{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=button{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=checkbox{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=color{{CompatUnknown}}{{CompatGeckoDesktop("27.0")}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}
type=date{{CompatNo}}{{CompatNo}}{{CompatNo}}10.625.0
type=datetime{{CompatNo}}{{CompatNo}}{{CompatNo}}10.62{{CompatVersionUnknown}}
type=datetime-local{{CompatNo}}{{CompatNo}}{{CompatNo}}10.62{{CompatVersionUnknown}}
type=email{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}{{CompatVersionUnknown}}3.1 (no validation but gives a specific keyboard)
type=file{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}} [1]
type=hidden{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=image{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=month{{CompatNo}}{{CompatNo}}{{CompatNo}}10.62{{CompatVersionUnknown}}
type=number2.3 (no validation but gives a specific keyboard){{CompatGeckoMobile("29.0")}}{{CompatUnknown}}{{CompatVersionUnknown}}4.0 (no validation but gives a specific keyboard)
type=password{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=radio{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=range{{CompatUnknown}}{{CompatNo}}{{CompatUnknown}}{{CompatVersionUnknown}}5.0
type=reset{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=search{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.624.0
type=submit{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=tel2.3{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.623.1
type=text{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
type=time{{CompatNo}}{{CompatNo}}{{CompatNo}}10.62{{CompatVersionUnknown}}
type=url{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.623.1 (no validation but gives a specific keyboard)
type=week{{CompatNo}}{{CompatNo}}{{CompatNo}}10.62{{CompatVersionUnknown}}
accept=[MIME type]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
accept=audio/*{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
accept=image/*{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
accept=video/*{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
accept=[. + ext]{{CompatUnknown}}{{CompatGeckoMobile("37.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
accesskey{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
autocomplete{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
autofocus3.2{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}
checked{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
disabled{{CompatVersionUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
form{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
formaction{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.625.0
formenctype{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
formmethod{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.625.0
formnovalidate{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.62{{CompatUnknown}}
formtarget{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}10.625.0
height{{CompatUnknown}}{{CompatGeckoMobile("16.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
list{{CompatNo}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}
max{{CompatUnknown}}{{CompatGeckoMobile("16.0")}} (UI might remain unimplemented){{CompatUnknown}}10.62{{CompatUnknown}}
maxlength{{CompatVersionUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
min{{CompatUnknown}}{{CompatGeckoMobile("16.0")}} (UI might remain unimplemented){{CompatUnknown}}10.62{{CompatUnknown}}
minlength{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
multiple{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}
name{{CompatVersionUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}1.0
pattern{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
placeholder2.3{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}11.104
readonly{{CompatVersionUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
required{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}
size{{CompatVersionUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
spellcheck{{CompatUnknown}}{{CompatGeckoMobile("2.0")}}{{CompatUnknown}}11.0{{CompatUnknown}}
src{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
step{{CompatUnknown}}{{CompatGeckoMobile("16.0")}} (UI might remain unimplemented){{CompatUnknown}}10.62{{CompatUnknown}}
tabindex{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
width{{CompatUnknown}}{{CompatGeckoMobile("16.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1]: File uploads were broken in Mobile Safari for iOS 8.0 and 8.0.1. The bug was fixed in iOs 8.0.2.

- -

Safari Mobile for iOS applies a default style of {{cssxref("opacity")}}: 0.4 to disabled textual {{HTMLElement("input")}} elements. Other major browsers don't currently share this particular default style.

- -

On Safari Mobile for iOS, setting {{cssxref("display")}}: block on an {{HTMLElement("input")}} of type="date", type="time", type="datetime-local", or type="month" causes the text within the {{HTMLElement("input")}} to become vertically misaligned. See WebKit bug #139848.

- -

As of Chrome v39, an <input type="date"> styled with {{cssxref("display")}}: table-cell; {{cssxref("width")}}: 100%; will have a {{cssxref("min-width")}} imposed by Chrome and it cannot become narrower than this minimum width. See Chromium bug #346051.

- -

Gecko notes

- -

Firefox will, unlike other browsers, by default, persist the dynamic disabled state and (if applicable) dynamic checkedness of an {{HTMLElement("input")}} across page loads. Setting the value of the {{htmlattrxref("autocomplete","input")}} attribute to off disables this feature; this works even when the {{htmlattrxref("autocomplete","input")}} attribute would normally not apply to the {{HTMLElement("input")}} by virtue of its {{htmlattrxref("type","input")}}. See {{bug(654072)}}.

- -

Starting in Gecko 9.0 {{geckoRelease("9.0")}}, Firefox for Android lets users capture images using their camera and upload them, without having to leave the browser. Web developers can implement this feature by simply specifying setting the accept attribute's value to "image/*" on their file input, like this:

- -

<input type="file" accept="image/*">

- -

Firefox for Android sets a default {{ cssxref("background-image") }} gradient on all type="text", type="file", type="button", and type="submit" inputs. This can be disabled using background-image: none.

- -

Firefox for Android also sets a default {{ cssxref("border") }} on all <input type="file"> elements.

- -

Localization

- -

The allowed inputs for certain <input> types depend on the locale. In some locales, 1,000.00 is a valid number, while in other locales the valid way to enter this number is 1.000,00.

- -

Firefox uses the following heuristics to determine the locale to validate the user's input (at least for type="number"):

- - - -

See also

- - - -

{{HTMLRef}}

diff --git a/files/pl/web/http/headers/cache-control/index.html b/files/pl/web/http/headers/cache-control/index.html deleted file mode 100644 index 2efcf437d8..0000000000 --- a/files/pl/web/http/headers/cache-control/index.html +++ /dev/null @@ -1,169 +0,0 @@ ---- -title: Cache-Control -slug: Web/HTTP/Headers/Cache-Control -translation_of: Web/HTTP/Headers/Cache-Control ---- -
{{HTTPSidebar}}
- -

Cache-Control nagłówek jest stosowany do określania dyrektyw sterujących pamięcią podręczną w zapytaniu i odpowiedzi protokołu HTTP. Dyrektywy pamięci podręcznej są jednokierunkowe, co oznacza że dyrektywa użyta w zapytaniu klienta HTTP nie musi pojawić się w odpowiedzi serwera.

- - - - - - - - - - - - - - - - -
Header type{{Glossary("General header")}}
{{Glossary("Forbidden header name")}}no
{{Glossary("Simple response header", "CORS-safelisted response-header")}}yes
- -

Składnia

- -

Wielkość liter nie ma znaczeniu w określaniu dyrektyw. Dyrektywa może posiadać opcjonalny argument który może być podany jako token (słowo) lub string w cudzysłowiu. Możliwe jest podanie wielu dyrektyw przez oddzielenie ich przecinkiem.

- -

Dyrektywy zapytania

- -

Standardowe dyrektywy nagłówka Cache-Control które mogą być użyte w zapytaniu klienta HTTP.

- -
Cache-Control: max-age=<seconds>
-Cache-Control: max-stale[=<seconds>]
-Cache-Control: min-fresh=<seconds>
-Cache-Control: no-cache
-Cache-Control: no-store
-Cache-Control: no-transform
-Cache-Control: only-if-cached
-
- -

Dyrektywy odpowiedzi

- -

Standardowe dyrektywy nagłówka Cache-Control które mogą być użyte w odpowiedzi serwera HTTP.

- -
Cache-Control: must-revalidate
-Cache-Control: no-cache
-Cache-Control: no-store
-Cache-Control: no-transform
-Cache-Control: public
-Cache-Control: private
-Cache-Control: proxy-revalidate
-Cache-Control: max-age=<seconds>
-Cache-Control: s-maxage=<seconds>
-
- -

Extension Cache-Control directives

- -

Extension Cache-Control directives are not part of the core HTTP caching standards document. Be sure to check the compatibility table for their support.

- -
Cache-Control: immutable
-Cache-Control: stale-while-revalidate=<seconds>
-Cache-Control: stale-if-error=<seconds>
-
- -

Directives

- -

Cacheability

- -
-
public
-
Indicates that the response may be cached by any cache.
-
private
-
Indicates that the response is intended for a single user and must not be stored by a shared cache. A private cache may store the response.
-
no-cache
-
Forces caches to submit the request to the origin server for validation before releasing a cached copy.
-
only-if-cached
-
Indicates to not retrieve new data. This being the case, the server wishes the client to obtain a response only once and then cache. From this moment the client should keep releasing a cached copy and avoid contacting the origin-server to see if a newer copy exists.
-
- -

Expiration

- -
-
max-age=<seconds>
-
Specifies the maximum amount of time a resource will be considered fresh. Contrary to Expires, this directive is relative to the time of the request.
-
s-maxage=<seconds>
-
Overrides max-age or the Expires header, but it only applies to shared caches (e.g., proxies) and is ignored by a private cache.
-
max-stale[=<seconds>]
-
Indicates that the client is willing to accept a response that has exceeded its expiration time. Optionally, you can assign a value in seconds, indicating the time the response must not be expired by.
-
min-fresh=<seconds>
-
Indicates that the client wants a response that will still be fresh for at least the specified number of seconds.
-
stale-while-revalidate=<seconds> {{experimental_inline}}
-
Indicates that the client is willing to accept a stale response while asynchronously checking in the background for a fresh one. The seconds value indicates for how long the client is willing to accept a stale response.
-
stale-if-error=<seconds> {{experimental_inline}}
-
Indicates that the client is willing to accept a stale response if the check for a fresh one fails. The seconds value indicates for how long the client is willing to accept the stale response after the initial expiration.
-
- -

Revalidation and reloading

- -
-
must-revalidate
-
The cache must verify the status of the stale resources before using it and expired ones should not be used.
-
proxy-revalidate
-
Same as must-revalidate, but it only applies to shared caches (e.g., proxies) and is ignored by a private cache.
-
immutable
-
Indicates that the response body will not change over time. The resource, if unexpired, is unchanged on the server and therefore the client should not send a conditional revalidation for it (e.g. If-None-Match or If-Modified-Since) to check for updates, even when the user explicitly refreshes the page. Clients that aren't aware of this extension must ignore them as per the HTTP specification. In Firefox, immutable is only honored on https:// transactions. For more information, see also this blog post.
-
- -

Other

- -
-
no-store
-
The cache should not store anything about the client request or server response.
-
no-transform
-
No transformations or conversions should be made to the resource. The Content-Encoding, Content-Range, Content-Type headers must not be modified by a proxy. A non- transparent proxy might, for example, convert between image formats in order to save cache space or to reduce the amount of traffic on a slow link. The no-transform directive disallows this.
-
- -

Examples

- -

Preventing caching

- -

To turn off caching, you can send the following response header. In addition, see also the Expires and Pragma headers.

- -
Cache-Control: no-cache, no-store, must-revalidate
-
- -

Caching static assets

- -

For the files in the application that will not change, you can usually add aggressive caching by sending the response header below. This includes static files that are served by the application such as images, CSS files and JavaScript files, for example. In addition, see also the Expires header.

- -
Cache-Control: public, max-age=31536000
- -

Specifications

- - - - - - - - - - - - - - - - - - - - -
SpecificationTitle
{{RFC("7234")}}Hypertext Transfer Protocol (HTTP/1.1): Caching
{{RFC("5861")}}HTTP Cache-Control Extensions for Stale Content
{{RFC("8246")}}HTTP Immutable Responses
- -

Browser compatibility

- -

{{Compat("http.headers.Cache-Control")}}

- -

See also

- - -- cgit v1.2.3-54-g00ecf