Common HTML code for website creation

Source: Internet
Author: User

Common HTML code for website creation

If you want to use a certain color, you can obtain its color value. For example, if you want to change the color of some text, you can use the following code:
<Font color = # ffc060 size = 3 face = ""> change # the color of the signed code. </font>
Color Code web recommendations: http://eyz.nease.net/tflash/jm/02/tiaoseban.swf

2. Code with bold and skewed text
◆ The code for bold text is: <B> Hello </B> ◆ the code for text skew is: <I> hello! </I> ◆ Bottom Line: <u> </u>

3. Text Link code
If you want to click a text field to connect to another webpage, This is a hyperlink and the code is as follows:
<A href = "website address"> shared space </A> if you click this text and open a window again, the code is: <a href = "website address" target = "_ blank"> shared space </a>

4. Code for placing images on the website
The Code is as follows:

Adjust the size of the Image Based on the number.

5. Image link code
The link code for opening a website is as follows:
<A href = "http://www.163.com"> </a>
You can open a link to a website and open a new window. The Code is as follows:
<A href = "http://www.163.com" target = "_ blank"> </a> the numbers above can all be adjust the image size.

6. Code such as text Center

<Div align = center> center </div>

<Div align = left> left </div>

<Div align = right> right </div>

7. Text moving code
<Marquee> write text here </marquee>

8. Mobile Image Code
<Marquee> <marquee>
Replace the image address in it with yours. If you want to put another image, insert it in the middle of the format:

Set the image address.

9. Background Music code
If you want to put a nice background music on your website, the code is: <bgsound src = "http://xxxxx.com/xxx.mid" loop = 10>
<Bgsound src = "http://www.midifan.com/midi/music.asp? You can replace the background music address in ID = 3073 "loop = 30>.
The front is the music address. Generally, the number after the end is in the form of mid or mp3 is the number of playback times.
Http://www.midifan.com/midi/
This website has good background music.

10. Insert a Flash Animation code into the website
<Embed width = 200 Height = 200
Src = "http://flash.shangdu.com/view/2/fff.swf"> the animation address in your. animation address must end with SWF. Note This.

Add transparent flash code:
<Embed src = "flash Address"; width = "400" Height = "300" Quality = "high" wmode = "Transparent" align = "right" style = "; left: 0; top: 0 ">

This code inserts transparent flash code, where width = "" is the flash width, height = "" is the height of flas, left: Is the position shifted from left to right, top: from top down

11. Welcome word code displayed when opening the website
<Body Hello, welcome to visit this website! ">

12. When the website is closed
<Body Thank you for coming, invite to join. Please remember this site Domain Name: http://www.yz126.com/Webmaster mailbox: *** @ yahoo.com.cn welcome to consult ') ">

13. Pop-up advertisement when opening the website

<SCRIPT> window. Open ('HTTP: // target URL ',', 'width = 400, Height = 200 ') </SCRIPT>

The http: // target URL in it is a pre-prepared web page. The following numbers are used to adjust the size and position. You can test it several times by yourself.

14. Code for changing the font to red

<Style type = text/CSS> TD {
Font-size: 12px
}
Body {
Font-size: 12px
}
Input {
Font-size: 12px
}
A: link {
Color: #000000; text-Decoration: None
}
A: visited {
Color: #000000; text-Decoration: None
}
A: active {
Color: Blue; text-Decoration: None
}
A: hover {
Color: red; text-Decoration: underline
}. So {
Border-Right: 1px Ridge; border-top: # ffffff 1px Ridge; font-size: 12px; border-left: # ffffff 1px Ridge; border-bottom: 1px Ridge; background-color: # cccccc
}
</Style>

15. prohibit others from copying your webpage code:

<Body bgcolor = "# ffffff" oncontextmenu = "Return false" onselectstart = "Return false">

16. How can I automatically redirect a site 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.

17. Email hyperlink

<A href = mailto: 168@163.com> 168 (AT) 163.com</A>

18. How to 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>

19. How do I jump to the top of the page?
When a visitor browses the bottom of the page, you need to provide a click to allow the visitor to easily jump to the top of the page and add the following code:
<A href = "# Top"> Back to Top </a>

20. How do I delete the blue border of an image link?
If we set an image as a link, we will find a blue border around the image. To delete a border, add border = "0" to the Image Tag ". For example:

21. How to provide a button for the link?
<Form action = "cnshell.htm" method = "get">

<P> <input type = "Submit" value = "Click here"> </P>

</Form>

22. How to display visitor system information on the webpage?
Add the following code to <body> </body>:
<Script language = "JavaScript"> document. Write (navigator. appversion) </SCRIPT>

23. Image background

<Body background = image address>

24. Color background

<Body bgcolor = "color">

The "color" indicates different colors.

25. Photo background

<Style type = "text/CSS">
<! --
Body {background-image: url(myphoto.jpg );
Background-repeat: No-Repeat;
Background-Attachment: fixed;
Background-50%}
-->
</Style>

On the webpage page, you can see that your photo is in the middle of the page, and when pulling the scroll bar of the browser window, the photo is still in the middle of the page and does not scroll along with the page content. If you feel that the photo is not satisfactory in the middle of the page, you can adjust its position on the page at will. You only need to adjust the value of "background-position.

26. Place the text in the code shown in the figure

<Table background = "image address" width = 100% Height = 100%>
<Tr>
<TD>
Content
</TD>
</Tr>
</Table>

27. stereoscopic special effects text code

<Font style = "font-size: 30pt; filter: blur (add = 1, direction = 30, strength = 5); width: 100%; color: # 9900ff; line-Height: 150%; font-family: 文 "> <B> I love Zibo entertainment! </B> </font>

28. Text code with special color shadow effects

<Font style = "font-size: 30pt; filter: dropshadow (color = lightgreen, offx = 5, offy = 3, positive = 1); width: 100%; color: red; line-Height: 150%; font-family: 文 "> <B> special color shadow text </B> </font>

29. Raised three-dimensional effect text code

<Font style = "font-size: 30pt; filter: Shadow (color = Black, direction = 180); width: 100%; color: red; line-Height: 150%; font-family: 文 "> <B> raised three-dimensional text </B> </font>

30. Set the text code of side-to-side stereoscopic effects

<Font style = "font-size: 30pt; filter: glow (color = #00cc00, strength = 4); width: 100%; color: red; line-Height: 150%; font-family: 文 "> <B> comprehensive text </B> </font>

31. 3D shadow text code

<Style type = "text/CSS">
. 3 dfont {filter: glow (color = ffffff, strength = 0) shadow (color = cccccc, direction: 135); width: 100%}
</Style>
<Table border = "0" width = "100%">
<Tr>
<TD width = "100%"> <font color = "#008040"> "3D text of dynamic DJ music network" </font> </TD>
</Tr>
</Table>

32. ad code Scrolling up and down on both sides of the webpage

<! -- Left -->
<Script language = 'javascript '>
VaR ad_float_left_src = "your image address ";
VaR ad_float_left_url = "click the webpage to open the image ";
VaR ad_float_left_type = "";
</SCRIPT>
<SCRIPT> </SCRIPT>
<! -- Right -->
<Script language = 'javascript '>
VaR ad_float_right_src = "your image address ";
VaR ad_float_right_url = "click the webpage to open the image ";
VaR ad_float_right_type = "";
</SCRIPT>
<SCRIPT> </SCRIPT>

33. Code for Scrolling up text and images

<Marquee direction = up truespeed scrollamount = 1 scrolldelay = 40 Height = 100 width = 150 border = "0"> Insert the text and image you want here </marquee>

 

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.