18 Tips for making code on a Web page

Source: Internet
Author: User
Tags html tags relative
Using CSS benefits is a change in all changes, which can be well used in the application of skin change.

1, the XML file as far as possible to utf-8 encoding, gb2312 some words are not stored, such as, even if can save also need conversion, more trouble, Utf-8 also conform to international norms.

2, CSS: hover this pseudo class, if placed in: visited before will be invalidated.

3,

4, JS file with Document.wirte ("

For example: a.htm references x\b.js,b.js reference x\c.js, file should be x\c.js instead of direct path b.js relative c.js, and @import,url () references in CSS do not have this problem

5, in the page, sometimes talbe width set to 100% right will also leave a scroll bar blank, please set

6, for commonly used pictures do not use IMG tags, using

7, @font-face {font-family:comic;src:url (HTTP://VALID_URL/SOME_FONT_FILE.EOT);}
Defines a font name that is not locally called

8, a few CSS
div {overflow:hidden;text-overflow:ellipsis;}
td {Vertical-align:middle;}
  to force an overflow to occur and to apply the ellipsis value, the author must set the White-space property value of the object to nowrap. If there is no line-breaking opportunity (for example, the width of the object container is narrow and there are long lines of text without reasonable breaks), nowrap may overflow without application.
In order for the ellipsis value to be applied, this property must be set to an object with an unreachable region. The best option is to set the overflow property to hidden.

9, Firefox document.createelement does not support the content of HTML tags, also does not support innertext, but support innerHTML, you can use innerHTML to specify its content.

10, in the. NET control DropDownList under the Firefox width does not color, need to directly define style= ' width:10px;

11, Firefox in the CSS cursor does not support hand, using pointer instead.

12, the IFRAME in the scroll bar in the IFRAME need to set the style= ' Overflow:hidden ', can not only be set in the body, Firefox will have problems.

13, in the Onpropertychange event, note that the use of event.propertyname to change the event filter, in the setting of this event, in fact, has changed the Onpropertychange this property, so will be automatically executed once.

14, js5.6 Support version of the XSL is low, such as the document function does not support.

15, the slice function is slower than the direct loop to get an array fragment.

16, nextsibling to get the next object, you need to note that the two nodes do not have spaces between, otherwise it is easy to get the right object.

17, CreateTextFile in the Chinese must specify a third parameter is true, otherwise can not be written in Chinese, the performance of write times wrong

18, save Chinese text use ADODB.stream, do not use FSO, because the FSO does not support utf-8 format.

-->

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.