search
HomeWeb Front-endHTML Tutorialhtml: Sample code sharing of tag

html: Sample code sharing of tag

Jun 30, 2017 am 11:16 AM
htmlobjectcode

The

object tag is used to define an embedded object, including: images, audio, Java applets, ActiveX, PDF and Flash. This tag allows you to specify the data and parameters of the object inserted into the HTML document, as well as the code that can be used to display and manipulate the data.

Commonly used functions:

1. Display pictures:

[color=Red]<object 
height
="100%" width="100%"
type="image/jpeg" data="audi.jpeg">
</object>[/color]
<html>
<body>
<h2 id="Picture-nbsp-As-nbsp-Object">Picture As Object</h2>
<object height="100%" width="100%"
type="image/jpeg" data="/i/eg_audi.jpg">
</object>
</body>
</html>
<html>
<body>
<h2 id="Picture-nbsp-As-nbsp-Object">Picture As Object</h2>
<object height="100%" width="100%"
type="image/jpeg" data="http://www.fuguojian.cn/blog2/attachments/month_0812/k2008122805216.jpg">
</object>
</body>
</html>

2. Display web pages:

[color=Red]<object type="text/html" height="100%" width="100%"
data="http://www.w3school.com.cn">
</object>[/color]
<html>
<body>
<h2 id="Web-nbsp-Page-nbsp-AS-nbsp-Object">Web Page AS Object</h2>
<object type="text/html" height="100%" width="100%"
data="http://blog.fuguojian.cn">
</object>
</body>
</html>

3. , Play audio:

[color=Red]<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="liar.wav" />
</object>[/color]
<html>
<body>
<h2 id="Playing-nbsp-The-nbsp-Object">Playing The Object</h2>
<object
height="50%"
width="50%"
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="AutoStart" value="1" />
<param name="FileName" value="http://www.fuguojian.cn/music/Big%20Big%20World.mp3" />
</object>
</body>
</html>

4. Display calendar:

[color=Red]<object width="100%" height="80%"
classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02">
<param name="BackColor" value="14544622">
<param name="DayLength" value="1">
</object>[/color]
<html>
<body>
<h2>
Calendar
 Object</h2>
<object width="100%" height="80%"
classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02">
  <param name="BackColor" value="14544622">
  <param name="DayLength" value="1">
</object>
</body>
</html>

5. Display graphics:

[color=Red]<object width="200" height="200"
classid="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6">
<param name="Line0001"
value="setFillColor(255, 0, 255)">
<param name="Line0002"
value="Oval(-100, -50, 200, 100, 30)">
</object>[/color]
<html>
<body>
<h2 id="Graphic-nbsp-Object">Graphic Object</h2>
<object width="200" height="200"
classid="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6">
<param name="Line0001"
value="setFillColor(255, 0, 255)">
<param name="Line0002"
value="Oval(-100, -50, 200, 100, 30)">
</object>
</body>
</html>

6. Display Flash:

[color=Red]<object width="400" height="40"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com
/pub/shockwave/cabs/flash/swflash.cab#4,0,0,0">
<param name="SRC" value="bookmark.swf">
<embed src="http://www.fuguojian.cn/blog2/123/time.swf" width="400" height="40"></embed>
</object>[/color]
<html>
<body>
<h2 id="Flash-nbsp-Animation-nbsp-As-nbsp-Object">Flash Animation As Object</h2>
<object width="400" height="40"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#4,0,0,0">
<param name="SRC" value="bookmark.swf">
<embed src="http://www.fuguojian.cn/blog2/123/time.swf" width="400" height="40"></embed>
</object>
</body>
</html>

7. Play video:

[color=Red]<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="3d.wmv" />
</object>[/color]
<html>
<body>
<h2 id="Playing-nbsp-The-nbsp-Object">Playing The Object</h2>
<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param
name="FileName"
value="http://www.ananova.com/about/vap_windows_check.wmv" />
</object>
</body>
</html>


element can play QuickTime movies
Through the object element, you can easily play QuickTime movies Code is added to the web page. If the QuickTime player is not installed on the user's computer, the object setting

can be set to automatically install the QuickTime player.

Solution:
These codes for playing QuickTime movies:

[color=Red]<object width="160" height="144"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="sample.mov">
<param name="
autoplay
" value="true">
<param name="controller" value="false">
<embed src="sample.mov" width="160" height="144"
autoplay="true" controller="false"
pluginspage="http://fuguojian.cn/blog2/">
</embed>[/color]</object>
<object> 元素

The width and height attributes of the object elementshould match the size of the video (measured in pixels).
classid uniquely identifies the player software to use. It must be set to "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B".

This unique code identifies an ActiveX control that

must be installed on the user's PC before the movie can play. If the user does not have the ActiveX control installed, the browser will automatically download and install it. The

codebase attribute specifies the base path used to resolve relative URLs specified by the classid, data, and archive attributes. If not specified, its default value is the base URL of the current document. Note: Internet Explorer uses this attribute to specify the download location of the player. This property must be set to "http://www.apple.com/qtactivex/qtplugin.cab"

. This location contains the latest version of QuickTime Player.

The src parameter points to the movie file.

If you want the movie to play automatically, set the autoplay parameter to "true".

If you do not want to display control buttons, set the controller parameter to "false".

The above is the detailed content of html: Sample code sharing of tag. 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, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML in Action: Examples of Website StructureHTML in Action: Examples of Website StructureMay 05, 2025 am 12:03 AM

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

HTML's Purpose: Enabling Web Browsers to Display ContentHTML's Purpose: Enabling Web Browsers to Display ContentMay 03, 2025 am 12:03 AM

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

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

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools