2016-07-04 46 views
-1

我想是這樣的: enter image description here ,這是我所: enter image description here 這裏code JSFIDDLE對準格顯示器撓性

正如你所看到的,divdontmythshowstep應當根據divabout。 我試着添加一個<br>,我試圖改變display但沒有。 如果可能,我不會使用像素尺寸,但是可以調整大小。 我不知道還有什麼可以嘗試..

感謝

回答

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"> 
 
\t <div id="i_about"> 
 
\t \t <div class="i_title"><p class="i_title">Some info...</p></div> 
 
\t \t <div id="i_1est"> 
 
\t \t \t <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> 
 
\t \t \t <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> 
 
\t \t \t <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> 
 
\t \t \t <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> 
 
\t \t \t <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> 
 
\t \t \t <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> 
 
\t \t \t <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> 
 
\t \t </div> <!-- end i_1est --> 
 
\t </div> 
 
\t 
 
\t <div id="i_dont"> 
 
\t \t dont 
 
\t </div> <!-- end dont --> 
 
\t <div id="i_myths"> 
 
\t \t myths 
 
\t </div> <!-- end myths --> 
 
\t <div id="i_how"> 
 
\t \t how 
 
\t </div> <!-- end how --> 
 
\t <div id="i_step"> 
 
\t \t step 
 
\t </div> <!-- end step --> 
 

 
</div>

1

你需要用你的中間分子,並應用一些flexbox性質,如下圖所示:

*, 
 
*::before, 
 
*::after { 
 
    box-sizing: border-box 
 
} 
 
body { 
 
    margin: 0 auto; 
 
    margin: 0; 
 
    font-size: 10pt; 
 
    background-color: #e6e6e6; 
 
} 
 
#_container_info { 
 
    border: 1px solid #008000; 
 
    display: flex; 
 
    flex-wrap: wrap; 
 
    padding: 5px 
 
} 
 
.middle { 
 
    display: flex; 
 
    flex: 0 100%; 
 
    flex-wrap: wrap; 
 
    padding: 0 5px 
 
} 
 
.middle > div { 
 
    flex: 1; 
 
} 
 
.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; 
 
    width: 100%; 
 
    table-layout: fixed 
 
} 
 
.i_1int { 
 
    width: 14%; 
 
    border: 1px solid black; 
 
    padding: 3px; 
 
    display: table-cell; 
 
} 
 
#i_about { 
 
    background-color: #ffc0cb; 
 
    display: flex; 
 
    flex: 0 100%; 
 
    flex-direction: column; 
 
    padding: 0 5px; 
 
} 
 
#i_dont { 
 
    background-color: indigo; 
 
} 
 
#i_myths { 
 
    background-color: yellow; 
 
} 
 
#i_how { 
 
    background-color: lightblue; 
 
} 
 
#i_step { 
 
    background-color: #ffa500; 
 
    flex: 1; 
 
    margin: 0 5px; 
 
}
<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 class="middle"> 
 
    <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> 
 
    <div id="i_step"> 
 
    step 
 
    </div> 
 
    <!-- end step --> 
 

 
</div>