search
HomeWeb Front-endHTML TutorialDetailed explanation of important attributes of tag in html

Detailed explanation of important attributes of tag in html

Jun 30, 2017 am 11:27 AM
htmlobjectAttributes

archive Properties

For performance reasons, you can choose to pre-download a set of objects containing one or more archives. This is especially true for Java-based applications, where a Java class will depend on many other classes to do its job.

The value of the archive attribute is a quoted list of URLs, each of which points to an archive file that the browser needs to load before the object can be displayed or executed.

classid attribute

The classid attribute is used to specify the location of an object contained in the browser, usually a Java class.

Its value is the absolute or relative URL of the object. If the codebase attribute is provided, relative URLs are relative to the URL specified by the codebase attribute; otherwise, they are relative to the URL of the current document.

For example, to execute the time Java applet contained in the clock.class file, you can include the following code in the HTML document:

<object classid="clock.class"></object>

The browser will use the base URL of the current document as This applet looks for code. Therefore, if the URL of the current document looks like this:

http://www.w3school.com.cn/time.html

The browser will get the applet code for our clock.class instance at the following address:

http://www.w3school.com.cn/clock.class

Tip: The classid attribute is the same as tag is similar, providing the name of the file containing the object.

codebase attribute

The codebase attribute is an optional attribute that provides a base URL. The value of this attribute is a URL that points to the directory containing the object referenced by the classid attribute. The codebase URL overrides the document's base URL, but does not permanently replace it. This base URL is the default if the codebase attribute is not used.

Now, we continue to use the previous example, assuming that the document comes from http://www.w3school.com.cn, but the clock applet is placed in a separate directory called classes. This applet cannot be obtained by specifying classid= "classes/clock.class". Instead, you need to include the codebase attribute and the new base URL:

<object classid="clock.class" codebase="http://www.w3school.com.cn/classes/">
</object>

This line of statement parses to this URL:

http://www.w3school.com.cn/classes/clock.class

Although we used an absolute URL in this example, in practice Relative URLs can also be used. For example, applets are often stored on the same server as the host document. Therefore, for the sake of relocation, it is often better to specify a relative URL for the codebase, such as:

<object classid="clock.class" codebase="/classes/">
</object>

Tip: From the above As you can see in a few examples, the codebase attribute is used in conjunction with the classid attribute to specify the full URL of the object.

codetype attribute

The codetype attribute is used to identify the program code type.

The codetype attribute is only needed if the browser cannot determine the applet's MIME type based on the classid attribute, or if the server does not transmit the correct MIME type when downloading an object.

The codetype attribute is similar to the type attribute. The difference is that it is used to identify the program code type, while the type attribute is used to identify the data file type.

The following example explicitly tells the browser that the object's code is Java:

<object codebase="clock.class" codetype="application/java">
</object>

declare

Attribute declare attribute can define an object. But it also prevents the browser from downloading and processing it.

When used with the name attribute, this tool is similar to some kind of forward declaration in more traditional

programming languages

, such a declaration can delay the download of the object until the object It is indeed used in the documentation. data attribute

The data attribute specifies the URL of the data file for the object to process.

The value of this attribute is the URL of the file, which may be an absolute or relative URL relative to the file's base URL, or an absolute or relative URL relative to the URL provided with the codebase attribute.

The browser determines the type of data by the type of object inserted into the document.

This attribute is similar to the src attribute in the Detailed explanation of important attributes of  tag in html tag in that it downloads the data to be processed by the containing object. The difference, of course, is that the data attribute allows the inclusion of almost any file type, not just image files.

The above is the detailed content of Detailed explanation of important attributes of tag in html. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!