css排版—— 一篇优雅的文章(中英文) vs 聊天框的特别排版

文章

css排版—— 一篇优雅的文章(中英文) vs 聊天框的特别排版_第1张图片

    <div class="contentBox">
      <p>这是一篇范文——仅供测试使用p>
      <p>
        With the coming of national day, I have a one week holiday. I really
        expect to it, because it want to have a short trip during these days. I
        will travel to Jiuzhai Valley with my parents for three days. I have
        heard that the scenery of Jiuzhai Valley is very beautiful in autumn
        that it’s the best time to travel there. Autumn is my most favorite
        season so I want to enjoy the beauty of such a wonderful place. I do
        some preparations for this trip. For example, I search the Internet to
        see the travel raiders and I have known where the most attracting place
        is and where to live in. I am sure it will be a wonderful journey. There
        are only several days for the coming trip, but I have been too excited
        to wait.
      p>
      <p>
        当站在长城之上,不经意间触及烽火的余温,偶然间听到长城内外的风声,你,想起了什么?当伫立江南渡口,看着来往的孤帆,望着秦淮河上的潋滟波光,我们丢失了什么?
      p>
      <p>
        人说和平是狼烟不再,河清海晏的盛世景象,可在我看来,一个民族的血气和潇洒、自信与魄力比任何一种外在的繁华都要可贵。当民族血气与时代的变换相得益彰时,才是真正的“和”。
      p>
      <p>
        在函谷关与崤山之间流传着的《秦风》,那只是阵前助威的战歌吗?那只是秦人日常生活的写照吗?从来都不是。一个让六国震颤的国家,一支令魏武卒都汗颜的虎狼之师,总有他的不屈和不朽。“岂曰无衣,与子同袍。赳赳老秦,共赴国难。”这种国家血气和自信,在西陲的雁鸣声里,怎么渐行渐远了?石敬瑭将燕云十六州拱手相让,赵构偏安江南,自毁长城,国力不支是理由吗?没有了勇气和血气的国家,只能成为历史的附庸。他们无力拨回秦时明月的历史轮盘,又如何能够激活静默了近千年的“和”?
      p>
      <p>
        时势造英雄,乱世演绎不朽,金戈铁马中的每一个燃烧的灵魂,每一颗跳动的心脏,都被以姓名的方式刻入史笺,浩气长存。可为什么在当下物欲横流、灯红酒绿的深处,血脉涌动的声音如此微弱?天命星相从来不会垂怜弱者,只有强者才能演绎历史的天空最耀眼的血色光芒,才能让古今之“和”融会成一曲长歌,弱者只能在旷地里仰望星辰,却找不到自己的归属。可灯火辉煌醉中生梦死,逐渐麻木了的人们却让铜臭酒气掩盖了所剩无几的血气。失去民族阳刚的人们恍若失去了栋梁的楼阁,仿佛一阵清风也能让其轰然崩塌。
      p>
    div>
.contentBox {
  width: 400px;
  height: 500px;
  overflow-y: scroll;
  border: 1px solid gray;
  padding: 10px;
  margin: 10px;
  line-height: 1.5;
  font-family: "Times New Roman", "Microsoft YaHei", "宋体";
  word-wrap: break-word;
  /* 分散对齐 */
  text-align: justify;
  /* 最后一行左对齐*/
  text-align-last: left;
  /*兼容所有浏览器,inter-ideograph的字面意思是“国际象形文字” */
  text-justify: inter-ideograph;
}
p {
  text-indent: 2em;
  margin-bottom: 10px;
}

聊天框

css排版—— 一篇优雅的文章(中英文) vs 聊天框的特别排版_第2张图片

    <div class="contentBox">
      <p>你说啥????????????p>
      <p>ni haop>
    div>
.contentBox {
  width: 200px;
  border: 1px solid gray;
  padding: 10px;
  margin: 10px;
  line-height: 1.5;
  font-family: "Times New Roman", "Microsoft YaHei", "宋体";
  line-break: anywhere;
  /* 分散对齐 */
  text-align: justify;
  /* 最后一行左对齐*/
  text-align-last: left;
  /*兼容所有浏览器,inter-ideograph的字面意思是“国际象形文字” */
  text-justify: inter-ideograph;
}

你可能感兴趣的:(#,CSS,css,前端)