100 examples of HTML skills (1)

Source: Internet
Author: User
Tags transparent image

1. Link Control

    Back to the previous page: Use onclick = "history. Go (-1)", as shown in

Back to homepage: Use onclick = 'top. Location. href = "../chinamail.html" ', as shown in figure

2. Link prompt

    Add

    Onmouseover = "window. Status = 'here is... '; return true" onmouseout = "window. Status =''; return true"

    For example, where to go? (Check the status line changes before clicking the link)

3. Background Music

    Show Operation Panel: Add <embed src = "Aladdin. Mid" width = "140" Height = "35" autostart = true controls = "middleconsole">

    Operation Panel not displayed: Add <embed src = "Aladdin. Mid" hidden = true autostart = true loop = true> anywhere on the page.

    Or <embed src = "TT. Ram" autostart = "true" loop = "2" width = "80" Height = "30">

    For browsers that do not support the embed label, you can use the label instead.

4. Set the default character language of the home page to simplified Chinese (For Netscape)

    Add <meta HTTP-EQUIV = "Content-Type" content = "text/html; charset = cn-GB">

5. Different links

    Display in the frame: add the target = "Main" Statement to the Link, where main is the frame name.

    Display on the entire page: add the target = "_ top" Statement to the link

    Open a new window: add the target = "resource window" Statement to the link, for example, <a href = "index.htm" target = "resource window"> </a>

6. Force the homepage to be reread from the server instead of being cached.

    Add
    <Meat HTTP-EQUIV = "Pragma" content = "no-Cache">

    In this way, the browser will forcibly re-read your page without considering the content in cacke, which is equivalent to using reload.

    If it is used on the page where you have a counter, this page is returned no matter where it is
    You can add one counter. However, it may cause user dislike.

    If used in BBS programs, you can update pages without reload.

7. Automatic refresh

    Timed Refresh: <meta HTTP-EQUIV = "refresh" content = "10; url = http: // your own URL">

    Slide effect: the statement is similar to the above, but in page 1 the URL points to page 2, while page 2 points to page 3...
    Page N is returned to page 1 to display the page cyclically.

8. upload images in advance

    If there is a large image to be displayed on the page after your site, you may wish to load it in advance on the first page. Statement:
    where width and height must be set to 0 and placed anywhere on the first HTML page.

    If your visitor stays on the first page long enough, the image will be displayed immediately when he enters the second page.

9. Automatic Connection

    Automatically connects to another specified page after the specified time.
    Method:
    Add the following line to <title>... </title>:
    <Meta http-equiv = "refresh" content = "10"; url = "otherpage.htm">
    10 indicates automatic connection in 10 seconds.

     

10. Automatic line feed:

    Automatically wrap lines on the home page to adapt to different browsers or resolutions.
    <Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">

11. Control the text location with a single pixel GIF File

To accurately control the text position in HTML, you can create a 1x1 transparent image (for example, blance.gif ). Then add the code to HTML:

Change the number 100 to control

12. container tag

<BLOCKQUOTE> </BLOCKQUOTE> the tag can include all objects on the webpage, but cannot add variables to it.

13. Set the image size

To enable your web page to display text content immediately before the image is downloaded.
Add the file size variable to the Graphic Element on your home page:

XXX, YYY is the real pixel of your image

14. move text

This is commonly used on the home page, and its production method is very simple.
<Marquee> text to be moved </marquee>
1. direction of movement: <direction =!> ! = Left, right
2. How to move: <bihavior =!> ! = Scroll, side, Alternate
3. Number of cycles: <loop =!> ! = Times. If not specified, the loop is not limited.
4 loop speed: <scrollamount =!> ! = Number

15. How do I remove the underline Of the homepage hyperlink?

Place the following statement between <Style>
A {text-Decoration: None}
}
</Style>
<Script language = "JavaScript">
VaR contents = true;
</SCRIPT>

What's simpler is
<Style>
<! --
A {text-Decoration: None}
A: hover {color: red; text-Decoration: underline}
-->
</Style>

16. Floating background (the background image does not scroll)

When you hold the drop-down bar, the background does not move. (This slows down the browsing speed. :-() Join:
<Body backgroud = "# ffff" bgproperties = "fixed">

Or use a CSS style sheet to define:
<Style type = "text/CSS">
<! --
Body {background-image: URL (image/bg.gif); background-Attachment: Fixed}
-->
</Style>

17. Leave the background image untiled
CSS style sheet definition:
<Style type = "text/CSS">
<! --
Body {background-image: URL (image/bg.gif); background-repeat: No-repeat}
-->
</Style>

18. Test the browser category and automatically mount different web pages

At present, Microsoft and Netscape browsers are not fully compatible with all web pages. Some are very beautiful in Some browsers, but they are a mess when viewed in other browsers. If you need to test your browser, you can add the following JavaScript code and save a separate webpage:

<Script language = "JavaScript">
Function testbrowser (){
Ie = (navigator. appname =
"Microsoft Internet Explorer ")&&
(Parseint (navigator. appversion)> = 3 ))
NS = (navigator. appname = "Netscape ")&&
(Parseint (navigator. appversion)> = 3 ))
If (NS ){
SetTimeout (''location. href = "nn4.htm" '', 10 );
} Else {
SetTimeout (''location. href = "ie4.htm" '', 10 );
}
}
</SCRIPT>

19. Define keywords for this webpage

Adding a keyword to a webpage can be used by some platform search robots. They will use this keyword to index your website. In this way, when someone else uses a keyword to search for a website, if your webpage contains this keyword, it can be listed and defined. You can add the following code:
<Meta name = "keywords" content = "HTML, Dreamweaver, Flash, CSS">
Content contains keywords, which you can set on your own.
Here is a tip. You can repeat a word to improve the ranking position of your website, such:
<Meta name = "keywords" content = "Dreamweaver, Dreamweaver, Dreamweaver">

20. Add the e-mail link to the webpage and display the predefined topic.

<A href = mailto: cnshell@163.com? Subject = Hello>

21. Link information hidden in the status bar

When you point to a link, the link information appears in the browser status bar. To hide the information, you can set it as follows:
<A href = "http://www.yy0736.com" onmouseover = "window. Status = 'none'; return true"> test </a>
If you want to point to a link with specific information in the browser status bar, change none to the text you need.

22. submit the form to your email address on the webpage.

Form submission requires the support of the CGI program, but you can also use e-mail to submit the form. After designing the form, add the action content to the email address, as shown below:
<Form method = "Post" Action = "mailto: cnshell@163.com" enctype = "text/plain">

23. Hide the free counter icon

Many netizens use the free counter, which helps you analyze website traffic. If you want to hide the Service icon, you can change the width = 88 Height = 31 in the service code to 1.

24. Add the last modification date to the webpage

Add the following code to the body:
<Script language = "JavaScript">
Document. Write
("Last modified Date" + document. lastmodified );
</SCRIPT>

25. Open a new browser window and set window properties

If you need to open another new window while loading the site, add the following code:

<Script language = "JavaScript">
<! --
VaR GT = Unescape ('% 3E ');
VaR popup = NULL;
VaR over = "launch pop-up Navigator ";
Popup = Window. Open ('', 'popupnav', 'width = 160, Height = 160, resizable = 1,
Status = Yes, menubar = No, scrollbars = Yes ');
If (popup! = NULL ){
If (Popup. Opener = NULL ){
Popup. Opener = self;
}
Popup. Location. href = 'pop.htm ';}
// -->
</SCRIPT>

You can set pop.htm to your HTM file. For setting properties of the new window, follow these settings:

Popup = Window. Open ('', 'popupnav', 'width = 200, Height = 170, resizable = 1, scrollbars = auto ');

Width: width, height: height, resizable: whether to allow a visitor to zoom in a new window. scrollbars: if the text exceeds one screen, whether to generate a scroll bar. Status: whether to display the status bar, menubar: whether to display the menu, Location: whether to display the address bar.

The preceding attributes are in the format of yes or no. and width and height are: width = # pixels, Height = # pixels.

26. How can I determine the operating system used by the server?

In the address bar of the browser, enter the server address to be viewed. Make sure to include the Directory and document name. Then press enter to display the request page. Try to change the document name to uppercase. If the returned page does not exist, the operating system of the server may be Unix or Macintosh. If the page content is returned, the server may be a windwos operating system because windows is not case sensitive.

27. How can I improve the chances of a site being searched in a search engine?

When you register your site to a search engine, it does not mean that your site will be frequently searched. How to increase the probability is very simple, your home page usually has a title, it is usually set in the middle of <title> </title>. At this time, you can set the keyword here after setting the title, for example:
<Title> Yufeng multimedia-China, love, DHTML, yufeng21, Yahoo </title>. because the search engine first looks at the title of the site and uses the title as the keyword of your site. When you set the keyword in the title, the search engine also adds these keywords, this is better than all other methods. The only drawback is that your site title is getting longer.

28. How can I test the download speed of a website?

Prepare a table that can read seconds, such as a running table, which is more accurate. Of course, you can also use a common table.

First, we test the download time of plain text, open the browser, disable the image download function, connect to the Internet, enter the site address in the address bar, and press enter to start timing, when all text content is downloaded, the timer is stopped.

If you want to test the download speed of the entire site and enable the image download function, if your site contains JavaScript, you also need to select the support in the browser, as shown above, enter the address, press enter, and start timing, when all content is downloaded, the timer is stopped.

After the above two tests, you will be aware of the connection download speed of your site.

29. How can I make the site automatically jump to another page?

Add the following code to the HTML file:
<Meta http-equiv = "refresh" content = "5; url = http://www.yufeng21.com/index.htm">
"5" in content is the number of seconds to stay, and the http://www.yufeng21.com/index.htm is the page to jump.

30. How to randomly display ads?

When you want to display a lot of ads, but the page space is not enough, you can make the ads appear randomly. You only need to add a piece of code. There is such code on the internet, search ......

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.