A space can also make the HTML format display very different

Source: Internet
Author: User

There was a bug in writing HTML today, with two tags always close to the display, but the two pieces of code are exactly the same as the previous one.

The error code is as follows

1                     <DivID= "Tool1"style= "width:80px;float:right;margin-top:30px;margin-right:40px;" >2                             3                                 <Divstyle= "width:65;height:25px;font-size:18px">4                                     <ahref= "<{$app}>/shopcar/">5                                     <spanclass= "Label label-success" >Shopping Cart</span> </a>6                                 </Div>7                             8                                 <Divstyle= "width:65;height:25px;font-size:18px">9                                     <ahref= "<{$app}>/user/">Ten                                     <spanclass= "Label Label-info">User Center</span></a> One                                 </Div> A                      </Div> -                     <DivID= "Tool2"style= "width:80px;float:right;margin-top:30px;margin-right:40px;" > -                            the                               <Divstyle= "width:65;height:25px;font-size:18px"><ahref= "<{$app}>/good/add"> -                                   <spanclass= "Label label-warning">Add Item</span></a> -                               </Div> -                            +                               <Divstyle= "width:65;height:25px;font-size:18px"><ahref= "<{$app}>/indent/"> -                                   <spanclass= "Label Label-danger"> +My order</span></a> A                               </Div> at                     </Div>

At first glance, the two ends of the code exactly the same, careful study, shopping cart after the </span> and </a> a space between, resulting in the format is not displayed correctly, deleted after the display is correct.

Similarly, if there is indentation or carriage return, there will also be different situations.

Prompt yourself to use line wrapping and indentation when coding.

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.