Introduction to the JavaScript Web

Source: Internet
Author: User

This is my first blog, starting from today to record what I learned, I hope I can learn more and more.

JavaScript output: document.write () Four ways:

1. Direct output double quotation mark content document.write ("");

2. Output variable name, such as: Var mychar= "Hello";d ocument.write (MyChar);

3. Use the Plus "+": document.write (mychar+ "Hello");

4. Output HTML tags, tagged with double quotes "": document.write (mychar+ "<br/>"); I just didn't think of this, and went back to see it again, really slag orz!

Add the width of the CSS layout or the height of the adaptive, can be set by a percentage.

What do you mean by self-adaptation? is when you drag the browser window, zoom in or out, it will still be the same as the browser window before the layout.

Using Position:absolute to achieve the adaptive width three column layout:

Design a three-column layout, left fixed width 200px,height:400px, fixed width:300px,height:400px on the right, and adaptive (with margin) in the middle. If you set left,right with float it will not achieve the desired effect.

. left{width:200px;height:400px;background-color:red;position:absolute;top:0;left:0;}

. mid{height:400px;background-color:blue;margin:0 310px 0 210px;}

. right{width:300px;height:400px;background-color:orange;position:absolute;right:0;top:0;}

Introduction to the JavaScript Web

Related Article

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.