三种方法处理文字中的空格

在我们制作网页布局的时候,可能会遇到上面图片的文字效果。这时需要我们对字与字、词与词之间的距离认为设置。下面介绍三种常用的方法:

文字间距(word-spacing)、外边距(margin)、内边距(padding)

<style>
    #div1{word-spacing: 100px;}
</style>

<body>
    <div id="div1">
        梦幻西游2 新大话2 新大话3 藏地传奇
    </div>

    <div class="aBox">
        <a href="">梦幻西游2</a>
        <a href="" style="margin-left: 100px;">新大话2</a>
        <a href="" style="padding-left: 100px;margin-right: 100px;">新大话3</a>
        <a href="">藏地传奇</a>
    </div>
</body>

  代码运行效果如下图:

三种方法处理文字中的空格

相关文章:

  • 2021-11-17
  • 2021-08-03
  • 2021-10-26
猜你喜欢
  • 2021-06-08
  • 2021-11-03
  • 2021-05-24
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2023-03-20
相关资源
相似解决方案