开发者社区 问答 正文

css怎样解决文字左右参差不齐的效果?

像这样左右文字不对等看起来很不美观,用css方法可以解决吗?
screenshot

展开
收起
杨冬芳 2016-06-12 13:34:43 2734 分享 版权
2 条回答
写回答
取消 提交回答
  • 阿里云ping https://ping.gaomeluo.com/aliyun/

    是不是可以采取换行啊?

    2019-07-17 19:33:46
    赞同 展开评论
  • IT从业

    01CSS代码:/

    /*左对齐*/
    03
    .left {
    04
        text-align: left;
    05
        border: 1px dotted black;
    06
        width: 50%;
    07
    }
    08
    /*右对齐*/
    09
    .right {
    10
        text-align: right;
    11
        border: 1px dotted black;
    12
        width: 50%;
    13
    }
    14
    /*居中对齐*/
    15
    .center {
    16
        text-align: center;
    17
        border: 1px dotted black;
    18
        width: 50%;
    19
    }
    20
    /*两端对齐*/
    21
    .justify {
    22
        text-align: justify;
    23
        border: 1px dotted black;
    24
        width: 50%;
    25
    }

    但这个移动端效果不太好

    2019-07-17 19:33:46
    赞同 展开评论
问答分类:
问答标签:
问答地址: