【问题标题】:Alignment div display flex对齐 div 显示 flex
【发布时间】:2016-07-05 03:57:20
【问题描述】:

我想要类似的东西: 这就是我所拥有的: 这里是code JSFIDDLE

如您所见,divdontmythshowstep 应该在 divabout 之下。 我尝试添加 <br> 并尝试更改 display 但没有。 如果可能的话,我不会使用像素尺寸,而是使用 % 以便它可以调整大小。 我不知道还能尝试什么..

谢谢

【问题讨论】:

    标签: html css flexbox


    【解决方案1】:

    这里是解决方案。检查下面的代码:

    body {
      margin: 0 auto;
      margin: 0;
      font-size: 10pt;
      background-color: #e6e6e6;
    }
    
    #_container_info {
      display: flex;
      flex-wrap: wrap;
      padding: 10px;
      border: 1px solid green;
    }
    
    .i_title {
      font-size: 16pt;
      font-weight: bold;
      margin-bottom: 5px;
      margin-top: 5px;
    }
    
    #i_1est {
      background-color: lightgreen;
      border: 1px darkgreen solid;
      display:table;
      margin-top: 0px;
      padding-top: 0px;
    }
    
    .i_1int {
      width: 14%;
      border: 1px solid black;
      padding: 3px;
      display: table-cell;
    }
    
    #i_about {
      background-color: pink;
      width: 100%;
      padding: 5px;
    }
    #i_dont {
      background-color: indigo;
      flex: 1;
    }
    #i_myths {
      background-color: yellow;
      flex: 1;
    }
    #i_how {
      background-color: lightblue;
      flex: 1;
    }
    #i_step {
      background-color: orange;
      width: 100%;
    }
    <div id="_container_info">
    	<div id="i_about">
    		<div class="i_title"><p class="i_title">Some info...</p></div>
    		<div id="i_1est">
    			<div class="i_1int">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries</div>
    			<div class="i_1int">but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum</div>
    			<div class="i_1int">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</div>
    			<div class="i_1int">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text.</div>
    			<div class="i_1int">The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32</div>
    			<div class="i_1int">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source</div>
    			<div class="i_1int">Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)</div>
    		</div> <!-- end i_1est -->
    	</div>
    	
    	<div id="i_dont">
    		dont
    	</div> <!-- end dont -->
    	<div id="i_myths">
    		myths
    	</div> <!-- end myths -->
    	<div id="i_how">
    		how
    	</div> <!-- end how -->
    	<div id="i_step">
    		step
    	</div> <!-- end step -->
    
    </div>

    【讨论】:

      猜你喜欢
      • 2016-10-19
      • 2019-06-15
      • 2023-01-19
      • 2021-10-29
      • 2022-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-10
      相关资源
      最近更新 更多