老师,关于不换行的问题,为什么中文换行,英文不换行?

来源:2-7 编程练习

秋之树

2019-09-20 22:19:41

<html>

<head>
    <meta charset="utf-8">
    <title>CSS布局</title>
    <style type="text/css">
        /*此处写代码*/
        
        * {
            padding: 0;
            margin: 0;
        }
        
        .container {
            width: 1000px;
            height: 600px;
            margin: 0 auto;
        }
        
        .title {
            text-align: center;
            padding-top: 15px;
            padding-bottom: 15px;
        }
        
        .container .pic {
            width: 450px;
            float: left;
        }
        
        .write1 {
            font-weight: bolder;
        }
    </style>
</head>

<body>
    <!-- 此处写代码 -->
    <div class="container">
        <div class="title">
            <h3>ENJOY THE LIFE</h1>
        </div>

        <div class="pic">
            <img src="http://climg.mukewang.com/58f829090001a4b504260240.jpg">
            <div class="write1">
                weareyoungweareyoungweareyoungweareyoungweareyoungweareyoungweareyoungweareyoung
            </div>
        </div>
        <div class="pic">
            <img src="http://climg.mukewang.com/58f8290f0001558804260240.jpg">
            <div class="write1">我是标题1我是标题1我是标题1我是标题1我是标题1我是标题1我是标题1我是标题1我是标题1我是标题1
            </div>
        </div>
    </div>
</body>

</html>


写回答

1回答

好帮手慕糖

2019-09-23

同学你好,1、因为这里使用的英文字母,英文的话,是按照单词划分的,一个单词一个单词的,而单词之间是靠空格分隔的,当存放以下下一个单词的时候,会自动换行,但是这里是连续的英文字母,会导致是一个很长的单词,所以无法自动换行。

建议:可以使用分隔好的单词哦,例:

Everybody believes that attractive faces must be popular,no matter what they do, special attention will be paid to them. But according to the new research, the attractive persons will meet troubles and get unfair.

2、中文就像正常的英语单词一样,是可以换行的哦。

希望能帮助到你,欢迎采纳。

祝学习愉快!

0

0 学习 · 40143 问题

查看课程