2 holes in JS about line breaks

Source: Internet
Author: User

The first place to pay attention to the use of Li in Ul/ol

1, <ul id= "Banner_indicator" ><li></li><li></li><li></li><li>< /li></ul>

2, <ul id= "Banner_indicator" >

<li></li>

<li></li>

<li></li>

<li></li>

</ul>

When using the following calling method

var Indicatortag = document.getElementById ("Banner_indicator");
var linodes = indicatortag.childnodes;

Summary: call 1 o'clock to get all the Li members, but the call Method 2 o'clock can only get the first row of Li.

The second one is about the details of the div wrapping, which I believe many people have encountered

1. <div id= "Parent" >

<div></div>

<div></div>

<div></div>

</div>

2.

<div>

<div></div><div></div><div></div>

</div>

When there is always a gap between the first inner Div, even if the following CSS parameters are set in the main div style

#parent {

margin=0;

padding=0;

border=0;

}

The result is no change, or there is a gap, but the gap disappears after using the second style, summary: The default is to add a space when using div wrapping.

2 holes in JS about line breaks

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.