HTML global attributes are universal attributes applicable to almost all HTML elements. They are used to provide some common characteristics and behaviors for elements throughout the entire HTML document. Common examples are: 1. id, specifying a unique attribute for the element. Identifier; 2. class, specifies one or more style class names for the element; 3. style, used to set CSS style attributes directly on the element; 4. title, provides additional information about the element; 5. lang, specifies the element's Language identifier; 6. data-*, used to store custom data, etc.
# Operating system for this tutorial: Windows 10 system, Dell G3 computer.
HTML global attributes are universal attributes that apply to almost all HTML elements and are used to provide some common characteristics and behaviors for elements throughout the HTML document. Here are some common examples of HTML global attributes:
id: Specifies a unique identifier for an element through which it can be accessed and manipulated in JavaScript.
class: Specify one or more style class names for the element, used to customize the style or match the rules in the CSS style sheet.
style: Used to set CSS style properties directly on elements, and can add styles to elements through inline styles.
title: Provides additional information about the element that will appear as a tooltip when the mouse is hovering over the element.
lang: Specifies the language identifier of the element, which is used to help assistive technologies such as screen readers process the language and text of the element.
data-* (custom data attribute): used to store custom data. The attribute name starts with data-. These data can be accessed through the dataset attribute in JavaScript.
accesskey: Defines the shortcut key that activates (triggers) the element.
hidden: Indicates whether the element should be hidden, that is, not displayed on the page.
tabindex: Specify the order of elements when using the Tab key to traverse the page.
contenteditable: Specifies whether the element is editable and allows users to modify it.
These global attributes can be applied to almost all HTML elements, but each element's support and effect of these attributes may vary. Appropriate global properties can be selected and used according to actual needs.
The above is the detailed content of What are the global attributes of html?. For more information, please follow other related articles on the PHP Chinese website!
if($res){
return json_encode(array('code'=>1,'msg'=>'成功'));
}else{
return json_encode(array('code'=>0,'msg'=>'失败'));
}
}
public function
}
if($res){
return json_encode(array('code'=>1,'msg'=>'成功'));
}else{
return json_encode(array('code'=>0,'msg'=>'失败'));
}
}
public function
}