老师为什么我的这个中文能自动换行英文就不行?如果要英文换行是只能手动吗?

来源:2-7 编程练习

wsc6016922

2020-04-04 16:21:33

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8">  

    <title>CSS布局</title>

    <style type="text/css">

        *{

            margin: 0;

            padding:0;

        }

        .topic{

            text-align: center;

            font-size: 18px;

            font-weight: bold;

        }

        .main{

            width: 80%;

            height: 1000px;

            margin: 0 auto;


        }

        .main .left{

            width: 50%;

            float: left;

            

        }

        .main .right{

            width: 50%;

            float: left;

            

        }

        .left img{

            width: 80%;

            text-align: center;

            padding: 10px;

        }

        .right img{

            width: 80%;

            text-align: center;

            padding:10px;

        }

        .word{

            width: 324px;

            height: 100px;

            text-align: center;

            


        }



        

    </style>

</head>

<body>

    <div class="topic">

        ENJOY THE LIFE

    </div>

    <div class="main">

        <div class="left">

            <img src="http://climg.mukewang.com/58f829090001a4b504260240.jpg">

            <div class="word">sdhfsfjsdhfjshdgfjshgbjshfdhjfjghkjfhsdjfhsfgdguhfusfsyfs</div>

        </div>

        <div class="right">

            <img src="http://climg.mukewang.com/58f8290f0001558804260240.jpg">

            <div class="word">啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</div>

        </div>

    </div>

</body>

</html>


写回答

1回答

好帮手慕糖

2020-04-04

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

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

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.

如果我的回答帮助了你,欢迎采纳,祝学习愉快!

1

0 学习 · 40143 问题

查看课程