请教一个CSS的问题,文字无法在某个DIV内显示_html/css_WEB-ITnose

WBOY
풀어 주다: 2016-06-21 09:35:22
원래의
1155명이 탐색했습니다.

div	{overflow:hidden;word-wrap:break-word;border:2px solid green;	 }	.total	{width:1000px;height:1000px;		}		.header	{height:20%;		 }	 	 .header_1	 {	 	 height:30%;		  }	  	  	  .header_1 div div	  {	  width:100%;	  height:50%;	  	   }	   	   .header_1 div div div	   	   { 	   width:50%;	   height:100%;	   text-align:center;	   	   	   }	  	  .header_1 div	  	  {	  	  width:19%;	  height:100%;	  float:left;	  	 	  	   }	  .header_2	  	  {	  height:30%;	  	   }	   	   .header_3	   	   { 	   	   height:30%;	   	   }	   	.header,.header_1,.header_2,.header_3	{ width:inherit;		}		.header_2 div,.header_3 div		{	width:32%;	height:100%;float:left;overflow:auto;			 }
로그인 후 복사


<body>  <div class="total">      	  <div class="header">	    <div class="header_1">		   <div>		   		      <div>			  <div>			  			  I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 			  			  </div>			  <div>			  dddddddddddddddddddddddd 			  			  </div>  			  			  </div>		   	  <div>			  			  <div>			  			  I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 			  			  </div>			  <div>			  			  I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 			  			  			  </div>			  </div>		   		   		   </div>		   <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 2</div>		   <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 3</div>		   <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 4</div>		   <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 5</div>				</div>							  <div>		<div class="header_2">			 <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 1</div>			 <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 2</div>			 <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 3</div>				</div>				<div class="header_3">			 <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 1</div>			 <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 2</div>			 <div>I have a div tag, and the text wraps well when you have spaces, everything is good, but when I do a long word or something, it will stick outside the div, is there anyway to fix this. I've looked at several things but they aren't all compatible with all browsers.Right now this is my css that the text is going into: 3</div>				</div>					 </div>			  </div>	 	 	 </div>      </div>        </body>
로그인 후 복사


问题截图:


回复讨论(解决方案)

因为你设置的宽度是50%所以只显示一半。。
 .header_1 div div div
        {
            width: 50%;
            
            text-align: center;
        }
把这里的height:100%去掉。。你就可以看到dddd了

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿