Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自动调整除法';s高度及;html中的宽度_Html_Css - Fatal编程技术网

自动调整除法';s高度及;html中的宽度

自动调整除法';s高度及;html中的宽度,html,css,Html,Css,你好,im基本开发人员,以下是我的html代码:- <div class="col-xs-12 col-md-8 divMainContainer" style="overflow:auto;" id="divmsgPost"> // used bootstrap <div id="divContent" style="overflow:auto;"> <span class="wordwrap"> <------- User's Co

你好,im基本开发人员,以下是我的html代码:-

 <div class="col-xs-12 col-md-8 divMainContainer" style="overflow:auto;" id="divmsgPost"> // used bootstrap
   <div id="divContent" style="overflow:auto;">
   <span class="wordwrap">
 <------- User's  Content here !-->// can be anything , text or image
   </span>
    </div>
   </div>
//使用的引导

如果不使用
overflow:auto
,滚动条将消失,元素将根据输入而增长。这不是你想要的吗?它确实在增长,但用户的文本(内容)在其他div上重叠:(,如何解决?请提供完整的代码(HTML和CSS)这将允许我们重现问题。数据是不够的。如果您希望div垂直扩展,那么您的代码应该可以完美地处理文本内容。但是对于大于450px(您给定的宽度)的图像将使图像溢出。为子图像添加最大宽度:100%。或为div指定最小宽度:450px;,并使其显示:inline block&Add-in.divMainContainer,文本对齐:center。感谢@abir\u maiti的建议:)
   .divMainContainer {
      margin-left: -3px;
       width: 450px;
     height:auto;
      }

      #divContent 
       {
        height : auto;
        width : 450px;

       }

     .wordwrap {
     white-space: pre-wrap;      /* CSS3 */   
     white-space: -moz-pre-wrap; /* Firefox */    
     white-space: -pre-wrap;     /* Opera <7 */   
     white-space: -o-pre-wrap;   /* Opera 7 */    
     word-wrap: break-word;      /* IE */
      }