Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] 第115天 怎样去除html标签之间换行产生的空格? #1041

Open
haizhilin2013 opened this issue Aug 8, 2019 · 6 comments
Open
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第115天 怎样去除html标签之间换行产生的空格?

@haizhilin2013 haizhilin2013 added the html html label Aug 8, 2019
@bailuochen
Copy link

1.不换行
2.设置父级font-size为 0
3.设置换行的标签否定边距margin-left;
4.选用浮动属性float
5.利用注释排版

6.使用返回标签

@nowherebutup
Copy link

  • 写在一行
  • 弹性布局
  • 浮动布局

@LinStan
Copy link

LinStan commented Aug 9, 2019

父级元素font-size设为0
不换行
子元素设置负的margin-left
设置浮动:父 display:float 子 float:left
父级元素 设置flex

@tiny-wenwen
Copy link

5.利用注释排版
6.使用返回标签

这两个是怎么个使用方法呢?

@forever-z-133
Copy link

html = html.replace(/[\n\t]\s*/g, '');

开始还以为是道正则题,原来是道 CSS,那和 inline-block 空隙是一个类型的问题了。
https://foreverz133.github.io/demo-preview/#/./pages/inline-block-spacing

@tao7544
Copy link

tao7544 commented Sep 29, 2019

@tiny-wenwen

<div><!--
    -->内容<!--
--></div>

注释排版应该是这样,返回标签还不清楚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html html
Projects
None yet
Development

No branches or pull requests

7 participants