Html 为什么即使为容器定义了宽度,文本仍在容器外运行

Html 为什么即使为容器定义了宽度,文本仍在容器外运行,html,css,css-float,Html,Css,Css Float,我有一个父容器,其中又放置了一个容器。子容器的P标记中有一个文本。即使宽度是为容器定义的。下面是HTML行 <div class="textareaPopupWrapper" style="background-color: black;"> <div class="popupControl"> <p>This is the text to be display on Popup opens.</p> </div

我有一个父容器,其中又放置了一个容器。子容器的P标记中有一个文本。即使宽度是为容器定义的。下面是HTML行

<div class="textareaPopupWrapper" style="background-color: black;">
  <div class="popupControl">
           <p>This is the text to be display on Popup opens.</p>
  </div>

您忘记关闭主分区。请检查,可能是它导致了问题。

请检查?我已将您的代码添加到小提琴中,它没有问题。您可能在其他地方继承了一些css?提琴:试着检查你的代码,看看你是否继承了其他样式。你的观点是什么?你想做什么。还有一种风格与路线冲突。空白:nowrap;现在,此样式已删除,并且工作正常。如何从这里删除此帖子?
.textareaPopupWrapper {
color: white;
display: block;
height: 100px;
left: 103%;
position: relative;
width: 100px;}

.popupControl {
color: red;
float: left;
height: auto;
position: absolute;
width: 90px;}