用css样式如何调整数字之间的距离

html-css014

用css样式如何调整数字之间的距离,第1张

用letter-spacing是单个个字母或数字文字的间距。你可以尝试用添加无语意的<span>来实现如:

<span class="space" id="first">1</span><spanclass="space">2</span><span class="space">3</span><spanclass="space">31</span>

.space{

padding-left:3px

}

最后在通过对第一个span元素添加一个ID 取消他左面的填充就是了:

#first{

padding-left0

}

<style>

span.paddingright{padding-right:5px}

/* 数值随意,样式名称随意,对应好下面的HTML即可 */

</style> <div>

 <span class="paddingright">30,</span>

 <span class="paddingright">31,</span>

 <span class="paddingright">32</span>

</div>

希望能帮到你

原理就是,先定义一个元素 ,然后定义动画XYZ轴偏移。

body > div > div:after {

    content: ""

    position: absolute

    top: -5px

    box-shadow: 0 0 12px #fff

    left: 50%

    margin-left: -5px

    width: 5px

    height: 5px

    border-radius: 50%

    background-color: #fff

    -webkit-animation: particle_ 2s infinite linear

    animation: particle_ 2s infinite linear

} body > div:nth-of-type(4) > div, body > div:nth-of-type(4) > div:after {

    -webkit-animation-delay: -1.5s

    animation-delay: -1.5s

}

body > div > div {

    width: 200px

    height: 200px

    position: relative

    -webkit-transform-style: preserve-3d

    -webkit-animation: trail_ 2s infinite linear

    transform-style: preserve-3d

    animation: trail_ 2s infinite linear

}

实施步骤:

建立一个BOX

在BOX中制作一个元素。

CSS动画定义BOX旋转按照你的轨迹。

通过。

-webkit-transform:rotateY( 0deg ) rotateZ( 0deg )  rotateX( 0deg )

         -moz-transform:rotateY( 0deg ) rotateZ( 0deg ) rotateX( 0deg )

      -o-transform:rotateY( 0deg ) rotateZ( 0deg ) rotateX( 0deg )

              transform:rotateY( 0deg ) rotateZ( 0deg ) rotateX( 0deg )

来定义旋转方向,0是不旋转。0-360度是一圈。

       -webkit-transition:transform 1s

transition:transform 1s

这是设置动画时间。

一个BOX完成后,复制box,摆在统一中心点后,设置Z轴的数字。