Questions tagged [html]

HTML (HyperText Markup Language) is the markup language for creating web pages and other information to be displayed in a web browser. Questions regarding HTML should include a minimal reproducible example and some idea of what you're trying to achieve. This tag is rarely used alone and is often paired with CSS and JavaScript.

HTML (HyperText Markup Language) is the markup language used for structuring web pages and other information to be displayed in a web browser. HTML describes the structure of a web page semantically along with cues for presentation, making it a markup language rather than a programming language. A browser 'renders' HTML in conjunction with CSS, which defines the 'style' (colours, fonts, layout, etc.), and JavaScript, which defines interactive and dynamic elements, adding style and behaviour to the pages.

https://html.spec.whatwg.org/multipage/ is the canonical HTML specification.


HTML (HyperText Markup Language) is the primary markup language for creating web pages and other information to be displayed to humans in a web browser.

It was invented by Sir Tim Berners-Lee while developing the first Web browser at CERN to enable researchers to share their findings and was formally released in June 1993. The original "HTML Tags" were first publicly mentioned by Berners-Lee in 1991 and borrowed the syntax from CERN's SGML-based documentation standard. The latest and current version for HTML is HTML5.3.

HTML elements form the building blocks of all web pages. HTML allows images and objects to be embedded in a page. It references styles and scripts and carries meta-data. It can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes, and other items. It can embed scripts written in languages such as JavaScript, which affects the behaviour of HTML web pages. Web pages generated by various programming languages (such as PHP, JSP, VF, ASP.NET, etc.) are rendered as HTML in a browser.

HTML is a hierarchical (tree-structured) markup language. That is, an item might descend from another item, which is its ancestor. However, if item2 is a descendant of item1, they have an additional special relation: item2 is inside of item1, or item1 is wrapped around item2.


Syntax

HTML is written in the form of elements consisting of tags (and their attributes) enclosed in angle brackets (e.g., <html>).

HTML attributes are most commonly expressed in a key="value" format. However, there are exceptions in which some attributes can be written with no value and still be interpreted.

HTML tags most commonly come in pairs. The first is known as the opening tag and the second, which includes a forward slash, is the closing tag (e.g., <h1> and </h1>). Various types of content, such as text or additional HTML elements, can be contained within these tags. Some tags, however, are unpaired, and these are known as empty elements or self-closing tags. They may or may not include the slash (e.g., <img> or <img />).

Collectively, these tags form an HTML document. Web browsers read these documents, interpret each HTML tag, and then render their corresponding visual and/or audible display in the form of a web page.


Standards

HTML standards, as well as those for many other web technologies, are maintained by the World Wide Web Consortium (W3C).

HTML4 was introduced in 1997, and the latest iteration, HTML5, was recently developed by the W3C. What W3C calls HTML5 is a subset, with a few modifications, of the HTML-Living-Standard, which is specified by the Web Hypertext Application Technology Working Group (WHATWG).

The language specification and standards documents for HTML5 are available online.


Design and Scripting

HTML markups are designed, or 'styled', via CSS (Cascading Style Sheets), using one or more of the following:

  • the <link> tag, which loads a CSS file
  • the <style> tag, where CSS rules are defined
  • the style attribute of HTML tags, where inline styles can be specified

Dynamic and interactive parts of a page are programmed most frequently in JavaScript, using one or more of the following:

  • the <script> tag with an src attribute, which points to a script file
  • the <script> opening and closing tags enclosing a script written in JavaScript
  • event attributes of HTML tags, like onclick

FAQ


References:


Free HTML Books:


Related Tags:

HTML5: What’s New?

1180250 questions
156
votes
7 answers

jQuery checkbox event handling

I have the following:
How do I use jQuery to capture any check event occuring in myform and tell which…
aeq
  • 10,377
  • 15
  • 45
  • 46
156
votes
7 answers

Unicode characters in URLs

In 2010, would you serve URLs containing UTF-8 characters in a large web portal? Unicode characters are forbidden as per the RFC on URLs (see here). They would have to be percent encoded to be standards compliant. My main point, though, is serving…
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
156
votes
15 answers

Bootstrap modal: is not a function

I have a modal in my page. When I try to call it when the windows load, it prints an error to the console that says : $(...).modal is not a function This is my Modal HTML :
156
votes
11 answers

HTML: How to create a DIV with only vertical scroll-bars for long paragraphs?

I want to show terms and condition note on my website. I dont want to use text field and also dont want to use my whole page. I just want to display my text in selected area and want to use only vertical scroll-bar to go down and read all…
Awan
  • 18,096
  • 36
  • 89
  • 131
156
votes
5 answers

How can I find the closest previous sibling with class using jQuery?

Here's the rough HTML I get to work with:
  • // this is the single element I need to select
  • daulex
    • 1,615
    • 2
    • 12
    • 10
    156
    votes
    14 answers

    Set date in input type date

    I will set today's date in the datepicker input type date in Chrome. $(document).ready(function() { let now = new Date(); let today = now.getDate() + '/' + (now.getMonth() + 1) + '/' + now.getFullYear(); console.log(today); …
    Sender
    • 6,660
    • 12
    • 47
    • 66
    155
    votes
    12 answers

    Cache busting via params

    We want to cache bust on production deploys, but not waste a bunch of time off the bat figuring out a system for doing so. My thought was to apply a param to the end of css and js files with the current version number:
    Brad Herman
    • 9,665
    • 7
    • 28
    • 30
    155
    votes
    11 answers

    How to perform a real time search and filter on a HTML table

    I've been Googling and searching Stack Overflow for a while, but I just can't get around this problem. I have a standard HTML table, containing, say, fruit. Like so: …
    samiles
    • 3,768
    • 12
    • 44
    • 71
    155
    votes
    5 answers

    Map Tiling Algorithm

    The Map I'm making a tile based RPG with Javascript, using perlin noise heightmaps, then assigning a tile type based on the height of the noise. The maps end up looking something like this (in the minimap view). I have a fairly simple algorithm…
    Dan Prince
    • 29,491
    • 13
    • 89
    • 120
    155
    votes
    2 answers

    CSS selector for other than the first child and last child

    I am making a very advanced website. My question: Is it possible to select all the other children except for the :first-child and the :last-child? I know there is a :not() selector but it doesn't work with more than one not in the parentheses. This…
    Daniel
    • 1,555
    • 2
    • 9
    • 4
    155
    votes
    5 answers

    Do we still need forward slashes when closing void elements in HTML5?

    In HTML5, do we still need the end slash like in XHTML? validator.w3.org didn't complain if I dropped it, not even a warning. But some online documents seem to indicate the end slash is still required for tags such as…
    CaptSaltyJack
    • 15,283
    • 17
    • 70
    • 99
    155
    votes
    7 answers

    How to position a DIV in a specific coordinates?

    I want to position a DIV in a specific coordinates ? How can I do that using Javascript ?
    Adham
    • 63,550
    • 98
    • 229
    • 344
    155
    votes
    3 answers

    What is the difference between the hidden attribute (HTML5) and the display:none rule (CSS)?

    HTML5 has a new global attribute, hidden, which can be used to hide content. CSS has the display:none rule, which can also be used to hide content. article { display:none;…
    james.garriss
    • 12,959
    • 7
    • 83
    • 96
    155
    votes
    6 answers

    Difference between HTML "overflow : auto" and "overflow : scroll"

    When I was studying the overflow property's values, I came across these two values: auto and scroll, which adds scrollbar(s) if the content overflows the element. Could someone please explain me whats the difference between them?
    GirishK
    • 1,823
    • 3
    • 16
    • 23
    155
    votes
    6 answers

    Camera access through browser

    We are creating an HTML5 website for mobile and need to get camera access through the web browser without being a native app. We are having trouble making this work in iOS. Is anyone aware of a solution for this?
    Julia
    • 1,551
    • 2
    • 10
    • 3
    1 2 3
    99
    100
    Apple Green