A small problem on css, I wonder if it has something to do with the html tag?

A simple piece of code, but without the result I imagined

    <style>
        *{
            margin: 0;
            padding: 0            
        }
        p {
            width: 200px;
            height:200px;
            background:skyblue;
            white-space: normal;
        }
        span{
            
        }
    </style>
  ------------------------  
    

<span>cccccccccccccccccccccccccccccccccccccccccccccccccccc aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa </span>

clipboard.png

Excuse me, how did this magical phenomenon come from?

Mar.23,2021

to make an analogy, there is only one Chinese character in your span, which is 20px wide, while your span is only 10px wide. Will this text be divided into two halves to wrap?

The

browser has its own word segmentation strategy. For Chinese, a single Chinese character is always inseparable. For English and numbers, the browser will use a certain strategy to treat a series of characters, such as ccccccccc, as an indivisible word.. You can use word-break: break-word; to instruct the browser to separate word at the container boundary. In addition, there is a tag < wbr > that indicates the boundary of the browser word.

  

the white-space: nowrap; text does not wrap, and the text continues on the same line until the
tag is encountered.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ca4-34470.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ca4-34470.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?