HTML Global Attributes - GeeksforGeeks

Skip to content geeksforgeeks
  • Courses
    • DSA Courses
    • Programming Languages
  • Tutorials
    • Python Tutorial
      • Python Loops and Control Flow
    • Java
      • Java Interview Questions
      • Java Quiz
      • Advance Java
    • Programming Languages
    • System Design
    • Interview Corner
    • Computer Science Subjects
    • DevOps
    • Linux
    • Software Testing
    • Databases
    • Android
    • Excel
    • Mathematics
  • DSA
    • Data Structures
    • Algorithms
      • Analysis of Algorithms
      • Searching Algorithms
      • Sorting Algorithms
    • Practice
      • Company Wise Coding Practice
      • Practice Problems Difficulty Wise
      • Language Wise Coding Practice
      • Curated DSA Lists
    • Company Wise SDE Sheets
    • DSA Cheat Sheets
    • Puzzles
  • Data Science
    • Data Science Packages
    • Data Visualization
    • Data Analysis
  • Web Tech
    • Web Development Using Python
      • Django
      • Flask
    • Cheat Sheets
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App HTML Global Attributes Last Updated : 10 May, 2024 Summarize Comments Improve Suggest changes Like Article Like Save Share Report Follow

HTML Global Attributes are attributes that can be used with any HTML element. They include id, class, style, title, lang, tabindex, and others, providing common functionality and enhancing element behavior and presentation across web pages.

List of Global Attributes:

Global Attributes

Description

Example

accesskey It is the keyboard shortcuts to activate/focus specific elements. Try

autocapitalize It is used to capitalize the text entered/edited by the user automatically. Try

autofocus The autofocus attribute in HTML is used to specify that the element should get focus when the page loads. It is a boolean attribute. Try

class It specifies one or more class names for an HTML element. Try

contenteditable It is used to specify whether the content present in the element is editable or not. When this attribute is not set in an element, this element will inherit from its parent element. Try

contextmenu It is the id of a <menu> that provide contextmenu for this element. Try

data-* It can be used to define our own custom data attributes. Try

dir It is used to specify the text direction of the element content. Try

draggable It is used to specify whether an element is draggable or not. Links and images are by default draggable. Try

enterkeyhint It provides a hint on what label or icon to present on a virtual keyword while pressing keys. Try

hidden It is used to define the visibility of elements. It contains a boolean value. If this attribute is used then browsers will not display elements that have the hidden attribute specified. Try

id It is a unique identifier that is used to specify the document and used by CSS and JavaScript to perform a certain task for a unique element. Try

inputmode It is used mainly to provide a hint to browsers on which virtual keyboard configuration to use when editing this element or its contents. Try

is It specifies that standard HTML behaves as a registered custom built-in element. Try

itemid It is a global identifier of an item that is unique. Try

itemprop It adds properties to an item. Try

itemscope It works with item types to ensure that the HTML contained in a block is about a particular item. Try

itemtype It specifies the URL vocabulary which is used to define itemprops. Try

lang It is used to specify the language of the element content. Some examples of languages are en for English, es for Spanish, etc. Try

nonce It is a cryptographic nonce (“number used once”) used by a content security policy to check given fetch allowed to proceed or not.
part It is a space-separated list of the part names of the element. Try

slot It is used to assign a slot in a shadow DOM shadow tree to an element. Try

spellcheck The Spell Check feature in HTML is used to detect grammatical or spelling mistakes in the text fields. Try

style Style in HTML are basically rules that describe how a document will be presented in a browser. Try

tabindex It is used to specify the tab order of an element. It is used when the tab button is used for navigating. Try

title It is used to define the title of an HTML document, sets the title in the browser toolbar, and provides the title for the web page when it is added to favorites. Try

translate The translate attribute in HTML is used to specify whether the content of an element is translated or not. Try

https://media.geeksforgeeks.org/auth/avatar.png GeeksforGeeks Improve Previous Article HTML Attributes Complete Reference Next Article HTML5 Complete Reference

Similar Reads

  • HTML Tutorial HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript 11 min read
  • HTML Introduction HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. HTML is a markup language, not a programming language, meaning it annotates text to define how it is structured and displayed by web browsers.It forms the building blocks of all we 5 min read
  • HTML Editors An HTML Editor is a software application designed to help users create and modify HTML code. It often includes features like syntax highlighting, tag completion, and error detection, which facilitate the coding process. There are two main types of HTML editors: Text-Based Editors - Allow direct codi 5 min read
  • HTML Basics HTML stands for Hyper Text Markup Language. It is the standard markup language for creating Websites. It is used to describe the structure of a Web page. HTML consists of elements that tell the browser how the content is displayed on the screen. We’ll walk you through fundamental HTML examples and t 6 min read
  • HTML Comments HTML Comments are text in an HTML document that is not displayed by the browser. They allow you to leave notes and explanations directly in the code, which can be especially helpful during the development process or when you need to make future updates. To add a comment in your HTML code, you enclos 4 min read
  • HTML Elements An HTML Element consists of a start tag, content, and an end tag, which together define the element's structure and functionality. Elements are the basic building blocks of a webpage and can represent different types of content, such as text, links, images, or headings. For example, the <p> el 5 min read
  • HTML Attributes HTML Attributes are special words used within the opening tag of an HTML element. They provide additional information about HTML elements. HTML attributes are used to configure and adjust the element's behavior, appearance, or functionality in a variety of ways. Each attribute has a name and a value 9 min read
  • HTML Headings HTML headings are used to define the content hierarchy and structure of a webpage. They range from <h1> to <h6>, with <h1> being the most important heading and <h6> the least important. Proper use of headings helps improve readability, SEO, and accessibility. Levels of HTML H 3 min read
  • HTML Paragraphs The <p> tag in HTML signifies a paragraph. Enclosed within the opening <p> and closing </p> tags, any content is recognized as a paragraph. As a block-level element, a new paragraph inherently starts on a fresh line, with browsers intuitively adding space before and after a paragra 5 min read
  • HTML Text Formatting HTML text formatting refers to the use of specific HTML tags to modify the appearance and structure of text on a webpage. It allows you to style text in different ways, such as making it bold, italic, underlined, highlighted, or struck-through. Table of Content Categories of HTML Text FormattingLogi 4 min read
  • HTML Quotations The HTML Quotation elements are used to insert quoted texts in a web page, that is the portion of texts different from the normal texts in the web page. Below are some of the most used quotation elements of the HTML. TagDescription<abbr>Defines abbreviation or acronym.<address>Defines co 3 min read
  • HTML Colors HTML Colors can be applied to text, backgrounds, borders, links, forms, tables, etc. This article provides an in-depth look at how colors can be applied to various elements such as text, backgrounds, borders, links, forms, and tables in HTML. We will explore different color formats including hexadec 11 min read
  • HTML Links Hyperlinks HTML links, or hyperlinks, connect web pages and are created using the `<a>` tag with the `href` attribute. They enable users to navigate between pages or resources. Links can be text, images, or other elements, enhancing web navigation and interactivity. Users can click on links to navigate b 3 min read
  • HTML Images The HTML <img> tag is used to embed an image in web pages by linking them. It creates a placeholder for the image, defined by attributes like src, width, height, and alt, and does not require a closing tag. There are two ways to insert the images into a webpage: By providing a full path or add 5 min read
  • HTML Favicon An HTML favicon (short for "favorite icon") is a small icon representing a website, typically displayed in the browser's tab, bookmarks, or address bar. It enhances brand recognition and provides a visual representation of the site. Favicons are defined using the <link> tag with the rel="icon" 3 min read
  • HTML Tables HTML Tables allow you to arrange data into rows and columns on a web page, making it easy to display information like schedules, statistics, or other structured data in a clear format. What is an HTML Table?An HTML table is created using the <table> tag. Inside this tag, you use <tr> to 9 min read
  • HTML List

    • HTML Lists An HTML list is a structured record of related information used to display data or information on web pages in an ordered or unordered form. Lists are fundamental for organizing content in a clear and readable way. Types of HTML ListsThere are three main types of lists in HTML: Unordered ListsOrdere 4 min read
    • HTML Ordered Lists HTML Ordered List is created by the HTML <ol> tag, to display elements in an ordered form, either numerical or alphabetical. Within the <ol> tag, list items <li> are used to define the items in sequential order. Syntax: <ol> <li>...</li> <li>...</li> 5 min read
    • HTML Unordered Lists An HTML Unordered List (<ul>) displays elements in a bulleted format. List items within an unordered list are defined using the <li> tag. The <ul> tag requires both opening and closing tags. Syntax: <ul> <li>Item 1</li> <li>Item 2</li> </ul>Unord 4 min read
    • HTML Description Lists HTML Description List <dl> organizes terms and descriptions, utilizing <dt> and <dd> tags within <dl>. This structured format clarifies content presentation, enhancing comprehension and readability for diverse information on web pages. Syntax <dl> <dt>Course</d 2 min read
  • HTML Block and Inline Elements HTML Block elements, are used to structure the main content of a webpage. They typically start on a new line and take up the full width of their container examples <div>, <p>, <h1> to <h6>, and <ul>, etc. On the other hand, Inline elements are used within block-level el 3 min read
  • HTML Iframes HTML iframes are used to embed external content such as videos, maps, or entire web pages into their web projects. This article will cover the syntax, attributes, and use cases of iframes, providing a solid foundation for leveraging them in web development. What are HTML Iframes?An iframe (short for 5 min read
  • HTML File Paths HTML file paths refer to the location of files within a website's directory structure. They specify the route from the current HTML document to other resources like images, stylesheets, or scripts, enabling browsers to correctly locate and load these assets. To insert a file in a web page, its sourc 3 min read
  • HTML Layout HTML layouts are the backbone of web pages, structuring content for user-friendly navigation. They ensure organized presentation and enhance user experience. This guide explores elements and techniques vital for crafting effective HTML layouts. Understanding HTML LayoutsHTML Layout refers to the str 4 min read
  • HTML Computer Code Elements The computer has a unique formatting and text style for displaying the messages related to codes. There are several elements available to mark up computer code elements using HTML which are as follows: Table of Content The code TagThe kbd TagThe pre TagThe samp TagThe var TagHTML Computer Code Eleme 5 min read
  • HTML5 Semantics HTML5 Semantics refers to the use of specific tags like <header>, <footer>, <nav>, <article>, <section>, etc., to provide clearer structure and meaning to web content. This improves accessibility, and SEO, and facilitates better understanding by both humans and machines 7 min read
  • HTML Entities HTML entities offer methods to display reserved characters, ensuring correct rendering. Reserved characters, like '<', can create ambiguity if not displayed properly. HTML provides entity names and numbers for symbols not on basic keyboards (e.g., £, ¥, €, ©), resolving ambiguity and enabling acc 4 min read
  • HTML Symbols there are some characters in html those are reserved, they have special meaning when they used in an html document. Like if you used less than or greater than sign in your html document then the browser will treat them differently special symbols ©:copyright sign Syntax : &copy; code : < 6 min read
  • HTML Emojis HTML emojis are graphical representations of emotions, objects, symbols, etc., displayed using Unicode characters or emoji entities within HTML documents. They enrich communication, adding visual context to web pages, emails, and messaging platforms. The <meta charset="UTF-8"> element defines 4 min read
  • HTML Charsets HTML charsets define character encodings used by the document. The charset attribute within the <meta> tag specifies the character encoding for the HTML document, ensuring proper interpretation of text. Common values include UTF-8 and ISO-8859-1. ASCIIThe American Standard Code for Information 3 min read
  • HTML URL Encoding A Uniform Resource Locator (URL) is simply the address of a website to access the website content like www.geeksforgeeks.org. But certain characters are allowed to be used in the URL like alphabets A-Z and a-z, numbers 0-9, and a few special characters. They can be used as it is but the rest of the 4 min read
  • HTML Forms HTML Forms use the <form> tag to collect user input through various interactive controls. These controls range from text fields, numeric inputs, and email fields to password fields, checkboxes, radio buttons, and submit buttons. Table of Content Form ElementsCommonly Used Input Types in HTML F 5 min read
  • HTML Responsive Web Design HTML Responsive Web Design is a modern approach to web development that ensures web pages look great on any device, from phones and tablets to desktop computers. It focuses on making HTML elements automatically adjust—resizing, hiding, or repositioning based on the screen size. This approach guarant 11 min read
  • HTML Video The <video> element in HTML allows you to embed video content directly into web pages. It supports various video formats, including MP4, WebM, and Ogg. In this guide, we’ll learn about the key features of HTML5 video. video and audio tags are introduced in HTML5. Basic SyntaxTo include a video 4 min read
  • HTML Examples HTML (Hypertext Markup Language) serves as the backbone of web development, allowing us to create web pages and applications. It uses a diverse range of tags and attributes to define the structure and layout of a web page, thereby facilitating the creation of web pages and applications. This compreh 8 min read
  • HTML Graphics

    • SVG Tutorial SVG stands for Scalable Vector Graphics and is a powerful XML-based markup language for describing two-dimensional vector graphics. It is a web standard that enables the creation of resolution-independent graphics. Unlike raster images (such as JPEG or PNG), SVG graphics maintain quality even when z 5 min read

    HTML Tutorial References

    • HTML Tags - A to Z List HTML tags are fundamental elements used to structure and format the content on web pages. It provides the necessary instructions to the web browsers to render text, images, links, and other media content. What are HTML Tags? HTML tags are the basic building blocks of any website. They are used to cr 15+ min read
    • HTML Attributes Complete Reference HTML attributes are special words placed inside the opening tags of HTML elements to define their characteristics. Each attribute consists of two parts: the attribute name and its value, separated by an equal sign (=) and enclosed in double quotes (" "). Syntax of HTML Attribute<tag_name attribut 7 min read
    • HTML Global Attributes HTML Global Attributes are attributes that can be used with any HTML element. They include id, class, style, title, lang, tabindex, and others, providing common functionality and enhancing element behavior and presentation across web pages. List of Global Attributes: Global Attributes Description Ex 3 min read
    • HTML5 Complete Reference HTML stands for Hyper Text Markup Language. It is used to design web pages using a markup language. HTML is an abbreviation of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within the tag, which defines the stru 7 min read
    • HTML5 MathML Complete Reference The MathML comes in HTML5 the current MathML version is 3 it was introduced in the year 2015. The MathML stands for Mathematics Markup Language. It is used to represent mathematical equations or expressions in web browsers like other HTML elements. The MathML is used to describe mathematics as a bas 3 min read
    • HTML DOM Complete Reference HTML DOM: The Document Object Model (DOM) is a programming interface for HTML(HyperText Markup Language) and XML(Extensible markup language) documents. Example: [GFGTABS] HTML <!DOCTYPE html> <html> <head> <title>DOM console.count() Method</title> <style> h1 { col 15+ min read
    • HTML DOM Audio/Video Complete Reference HTML DOM is an object model for programming interface. It is used to modify the structure, style and content of HTML document. The DOM Audio/Video contain the methods and properties related to audio and video. The complete list of HTML DOM Audio/Video methods and properties are given below: HTML Aud 6 min read
    • SVG Element Complete Reference SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. It is a type of vector graphic that may be scaled up or down. Elements are the core things that is required to work with SVGs. List of SVG Elements: SVG Elements Description Example <a>T 6 min read
    • SVG Attribute Complete Reference SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. It is a type of vector graphic that may be scaled up or down. Attributes are the things that give the SVG shape, color, etc it will make the SVGs as attractive as you need. List of SVG Attribu 9 min read
    • SVG Property Complete Reference SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. It is a type of vector graphic that may be scaled up or down. Properties are used for passing the value to the element, there are lots of properties that can be used in SVG elements. table{ di 8 min read
    • HTML Canvas Complete Reference The HTML “canvas” element is used to draw graphics via JavaScript. The “canvas” element is only a container for graphics. One must use JavaScript to actually draw the graphics. Canvas has several methods for drawing paths, boxes, circles, text, and adding images. Example: This example shows the basi 4 min read
  • HTML Exercises, Practice Questions and Solutions Are you eager to learn HTML or looking to brush up on your skills? Dive into our HTML Exercises, designed to cater to both beginners and experienced developers. With our interactive portal, you can engage in hands-on coding challenges, track your progress, and elevate your web development expertise. 3 min read
Article Tags :
  • HTML
  • Web Technologies
  • HTML Global-Attributes
Like three90RightbarBannerImg Explore More We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy Got It ! Lightbox Improvement Suggest changes Suggest Changes Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal. geeksforgeeks-suggest-icon Create Improvement Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all. geeksforgeeks-improvement-icon Suggest Changes min 4 words, max CharLimit:2000

What kind of Experience do you want to share?

Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam Experiences

Từ khóa » Html Attributes Nedir