Tips for making web pages

黄舟
Release: 2016-12-16 14:17:10
Original
915 people have browsed it

1. Add video animation to the homepage
Just add the following code to your webpage, you can add Windows video animation or other RralMedia format video animation to the homepage.
test.avi (40M bytes)In this code, the value of dynsrc is the name of your animation file, which should be a file with the suffix avi, ra, or ram; the value of start is generally "fileopen", so that the animation can be played automatically ; The values ​​of width and height are respectively the width and height of the picture when the animation is played (in pixels or expressed as a percentage); the value of alt is the non-display description of the animation file; hspace is the distance of the picture from the left side of the page ( (in pixels); vspace is the distance between the picture and the top of the page (in pixels). Here you can change the test.avi file into the video file you need.

2. Let the hyperlink change color automatically
As we all know, if you want to make a web page have dynamic effects, you generally need to insert animated images into the web page or use java to design a dynamic effect; but because animation takes up too many bytes, Using Java to design dynamic effects requires a certain design foundation. The author below will provide a method to make the hyperlinks on the page change color continuously, so that your web page looks dynamic. To achieve this effect, we only need to paste the following source code between the

and in the web page. The specific source code is as follows:
<script Language="Javascript"> 
<! - - Begin 
function initArray( ) { 
for ( var i = 0 ; i < initArray.arguments.length; i + + ) 
{this[i] = initArray.arguments[i];} 
this.length = initArray.arguments.length; 
} 
var colors = new initArray ("red","blue","green","black","purple","blue","tan","red");delay = .5; // seconds
link = 0 ; 
vlink = 0 ; 
function linkDance ( ) { 
link= (link + 1)%colors.length; 
vlink=(vlink+1)%colors.length; 
document.linkColor = colors[link]; 
document.vlinkColor = colors[vlink]; 
setTimeout("linkDance( )",delay*1000);} 
linkDance( ); 
// End - -> 
</script>
Copy after login

3. Change the online background image of the webpage at any time
The background images of webpages we usually see are generally static. Ordinary visitors do not have the right to change the background pattern of the webpage by themselves. I wonder if you have ever thought of making one. Can a web page allow visitors to change the background image themselves? If you have this idea, the following code can help us easily implement such a function. All we have to do is copy the source code provided below and paste it into the appropriate position of the HTML code in our own web page. I dare not say that it is very useful, but if used well, it will definitely be the icing on the cake. Okay, let’s take a look at the code first.
<form>
<select onChange="document.body.style.background=this.options[this.selectedIndex].value">
<option value="url('Address of background one')" selected>First One background
<option value="url('The address of background two')"> The second background
<option value="url('The address of background three')"> The third background
.... ..Other selection formats are as above...
</selected>
</form>
When using this code, we can first select or create the required background ourselves, and then replace the URL of each background image The background address in the above code allows us to easily change the background image randomly.

4. Seamless connection between the image and the browser window
When we insert an image into the web page, we sometimes find that it is difficult to achieve a seamless connection between the image and the browser window border, which is always a little bit The distance seems unnatural. So how can we achieve a seamless connection between the image and the browsing window, so that the image can naturally blend into the window background? In fact, the reason why the inserted image has a gap with the browser border is because we have not set the page margin. The way to solve the seamless connection is to add the following source code to the

tag of the page source code: topmargin = "0" leftmargin = "0" where topmargin represents the distance from the top of the browser window. At this time, it is set to 0, and the image is seamlessly connected to the browser window. leftmargin="0" means that the distance from the left side of the browser window is 0.

5. Use thumbnails to display images
If we really need to place a larger-sized image on the web page, considering that the image transmission speed is relatively slow, in order to enable visitors to know what the image represents as soon as possible For the content, we might as well use the thumbnail display method. That is, before displaying the original image, first provide an image with a lower resolution and smaller size as a "low source" so that the browser can display it quickly, and then gradually display the original image with high quality or large size. replace. If the user sees that the content displayed in the thumbnail is not what he wants, he can directly access other content without waiting, thus improving browsing efficiency. The specific method to achieve thumbnail display is to add the following code to the html source file of the web page:
<img src="view.gif" lowsrc="PReview.gif" width="x" height="y">
where view.gif is the original image, preview.gif is the thumbnail, width is the width of the original image, and height is the height of the original image.

6. Establish an on-site search engine
As the content of the page continues to increase, it becomes increasingly difficult to quickly and accurately obtain certain content within the site. In order to enable visitors to quickly find the information they want, a search engine needs to be established within the site. To build a site search engine, we can directly link to the website network zone http://netzone.swatou.com/personal/, click "Apply for site engine" and fill out the application form, and then build the site page database as required .

7. Let the background music continue to play
We know that when we open a page with background music, we can hear a melodious music, but when we use the mouse to click a link in the page or visit another When the page is opened, the background music playing will suddenly stop. So is there any way for us to make the background music of a certain page continue to play? The answer is yes. In fact, we only need to create a web page with an upper and lower frame structure, include the sound file in the lower frame page content, and set the width of the lower frame to 0 pixels, while the upper frame contains normal page content. Since the lower frame does not occupy the space of the window, this is equivalent to us putting the page containing the sound file. When we leave the web page containing background music, since the content of the lower frame page has not changed, the sound can continue to play.

Due to editing reasons, the angle brackets of all codes are full-width characters. Please change them to half-width characters when applying.

The above is the content of the tips in web page production. For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template