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.

Menu