简体   繁体   English

html页面中的HTML标签位置对齐问题

[英]HTML Tags placement in html page making alignment issue

I got into this weirdest problem. 我陷入了这个最奇怪的问题。 I have an unordered list with two list items as 我有一个无序列表,其中包含两个列表项

<ul>
<li><a href="#"><p>1</p></a>
</li>
<li><a href="#"><p>2</p></a>
</li>
</ul>

(end tag of 1st list item and start tag of 2nd are in different lines) This html code works fine. (第一个列表项的结束标记和第二个开始标记在不同的行中)此html代码可以正常工作。 But when I change the above code to 但是当我将上面的代码更改为

<ul>
<li><a href="#"><p>1</p></a>
</li><li>
<a href="#"><p>2</p></a>
</li>
</ul>

(end tag of 1st list item and start tag of 2nd are in same line and also there is no space in between them), the alignment breaks. (第一个列表项的结束标签和第二个开始标签在同一行,并且它们之间也没有空格),对齐会中断。 You can see the problem here 你可以在这里看到问题

http://jsfiddle.net/Venugopal/AawU2/2/ http://jsfiddle.net/Venugopal/AawU2/2/

At last found some workaround 终于找到了解决方法

click here 点击这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM