Using HTC components to make Windows Tabs _ basics

Source: Internet
Author: User
Tags visibility
There are a number of ways to simulate a Windows Style tab in a Web page, and here's a simpler way to do it--with HTC components.

The advantage of using HTC is that it is free to call, a bit of a batch feeling, for example you have a lot of pages to use this tab, then you just have to do a HTC on it, and then in different pages to call each other, without having to repeat the production. It is convenient to use and can save a lot of time.

The specific production methods are as follows:

First, download MPC.HTC

First go to the Microsoft site to download a component called MPC.HTC, which is the raw material for making Windows tabs.

Second, edit the Web page, call MPC.HTC

1, the HTML tag written:
The following are references:

2. Establish style behavior:
The following are references: <STYLE>
Mpc\:container,mpc\:p age{
Behavior:url (MPC.HTC);
}
</STYLE>


That is, Mpc\:container and mpc\:p age are invoked by behavior MPC.HTC

3, the specific content calls:
The following are references: <BODY>
<div>
<mpc:container style= "width:400; Height:200 ">
<mpc:page
Id= "Name"
Tabtitle= "The content here will be prompted by the mouse."
Tabtext= "Here is the tab label content" >
Here are the details of the tab
</mpc:page>
<mpc:page tabtitle= "tabtext=" ">
</mpc:page>
</mpc:container>
</div>
</BODY>


Here the <mpc:container> label determines the width and height of the entire tab using the style's width and height, and then the <mpc:page> ... </mpc:page> Add the contents of the tab between the tabs, with several options on the list <mpc:page> ... </mpc:page> label.

Attached is the code for the Windows tab sample page in the article:

The following are references: <HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<TITLE>mpc</TITLE>
<STYLE>
Mpc\:container,mpc\:p age{
Behavior:url (MPC.HTC);
}
</STYLE>
</HEAD>
<body bgcolor= "#FFFFFF" onload= "ompc.style.visibility= ' Visible '" text= "#000000" >
<div style= "Position:absolute;height:200;width:400;margin-top:20" >
<mpc:container id= "OMPC" style= "width:400; height:200; Visibility:hidden ">
<mpc:page id= "Tab1" tabtitle= "This is a form" tabtext= "form" >
<table align= "CENTER" style= "border:1 solid;font:20pt;
width:300; height:150; Color:white ">
&LT;TR&GT;&LT;TD valign= "Middle" align= "CENTER" > This is a form </td></tr>
</table>
</mpc:page>
<mpc:page id= "TaB2" tabtitle= "Here you can write text" tabtext= "text text" >
<div style= "PADDING:12PX; font:10pt; Font-style:italic ">
Please write the text here ...
</div>
</mpc:page>
<mpc:page id= "Tab3" tabtitle= "This is the image" tabtext= "image" >

</mpc:page>
<mpc:page id= "TAB4" tabtitle= "This can be other content" tabtext= "other content" >
<a href=#><font face= "italics _gb2312" size= "2" > Hyperlink </font></a>
</mpc:page>
</mpc:container></div>
</BODY>
</HTML>



Http://msdn.microsoft.com/downloads/samples/internet/behaviors/library/mpc/mpc.htc

The HTC file is placed in the same directory as the HTM file where you have the tab, or you can change the position of HTC in the following section of the page source code

Mpc\:container {
Behavior:url (MPC.HTC);
}

Mpc\:p Age {
Behavior:url (MPC.HTC);
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.