使用pre标签的时候,加入第一段有空格,那么第二行会有两段空白,怎么让他们都只有一段空白

错误的格式

图片描述

我希望是下面的这种格式,请问怎么改?

    使用淘宝源安装

    MAC系统切换把npm的安装源切换成淘宝使用npm就可以了
<pre>
    <code>
    使用淘宝源安装

    MAC系统切换把npm的安装源切换成淘宝使用npm就可以了
    npm install vue-router

    Windows系统使用npm指令会有出现访问权限的问题,建议使用cnpm直接安装就好
    cnpm install vue-router -save
    cnpm install vuex --save

    npm install  --registry=https://registry.npm.taobao.org common-helper-es6
    npm install  --registry=https://registry.npm.taobao.org seneca --save-dev
    npm install -g nrm --registry=https://registry.npm.taobao.org

    </code>
    <code class="java">
        int a = 1;
    </code>
    <code class="javascript">
        let test = arg => { }
        console.log(arg);
    </code>

</pre>
阅读 4.2k
1 个回答

pre加个样式white-space:pre-line试试


ps:貌似默认就是顶格的

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题