Live Code Editor

Write HTML, CSS, and JavaScript code with instant preview

Output

HTML Online Editor & Compiler

Write, Run & Share HTML code online using our HTML online Code editor for free. It's a robust online code editor for HTML5, CSS3, and JavaScript, providing a simple and fast way to start coding.

About HTML

HTML (Hyper Text Markup Language) is the standard markup language for web pages, created by Tim Berners-Lee in 1991. Almost every web page uses HTML to structure content on the internet.

Syntax Help

Fundamentals:

  • HTML document must start with <!DOCTYPE html>
  • HTML documents begin with <html> and end with </html>
  • Headings are defined with <h1> to <h6>
  • Paragraphs are defined in <p> tags
  • Links are defined in <a> tags
  • Images are defined in <img> tags
  • Buttons are defined in <button> tags
  • Lists are defined in <ul> or <ol> with <li> items

HTML Elements and Attributes:

  • HTML element is everything from the start tag to the end tag
  • Elements can have attributes that provide additional information
  • Example: <a href="https://example.com">Click Here</a>

CSS (Cascading Style Sheets)

CSS describes how HTML elements should look, including color, font style, size, and background color.

Example CSS:

body {
    padding: 25px;
    background-color: #f5f5f5;
}

.title {
    color: #228B22;
    font-family: 'Arial', sans-serif;
    font-size: 24px;
}

HTML Tables

  • Tables are defined in <table> tag
  • Table rows are defined with <tr>
  • Table headers are defined with <th>
  • Table data/cells are defined with <td>
  • Table caption is defined with <caption>

HTML & JavaScript

JavaScript is used to make web pages interactive and dynamic.

  • The <script> tag is used to write JavaScript code
  • Can reference external JavaScript files or write inline scripts
  • Allows you to manipulate HTML elements, handle events, and create dynamic content