Small knowledge points summarize html, CSS, JavaScript (i)

Source: Internet
Author: User

1. When setting the background color and background image for the element, the background color will overwrite the background image when it is written behind the background.

such as Background:url ();
background-color:red;

2. When the demand paragraph right aligns, and the last line left to Playhead

(1) Use text-align-last:right; But this property is not fully supported by the browser

(2) set to the following structure, and set the appropriate style

<div class= "Parent" >

<p class= "Child" > A paragraph of text </p>

</div>

<style>

. parent{
width:100px;
Text-align:right;
background:red;
word-break:break-all;//here is to make a long word wrap.

}
. child{
Display:inline-block;
width:80px;
Text-align:left;
}

</style>

When the div is set to right, the P element is aligned to the right, but internally or left aligned

3. In order to prevent the site link to be used directly after the copy, generally after the verification of the URL for certain operations, using history.pushstate (); You can modify the URL without refreshing.

Window.history.pushState (null, Document.title, AppUrl)//appurl is the modified URL

4. Many tags have the title attribute, that is, the mouse hover can appear title content.

5.ES6 's new APIReflect.ownKeys(obj);可以返回对象的所有key,包括Symbol()类型的key,返回的是一个数组,在webkit和moz都是支持的,而IE都不支持。开发移动端可以使用。

Finally, I recently prepared to write some small plug-ins, for peacetime use, now only write a hidden plugin on the element display, you can use like Vue or angular, welcome all together to reference (can star best, hey), can also contribute some of their own plug-ins.

GitHub Address: Https://github.com/zzwcjj/plugs

Small knowledge points summarize html, CSS, JavaScript (i)

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.