2016-05-05 18 views
0

こんにちは私はいくつかのテキスト '基本的な詳細'でdivを持っています。私は、DetailsがBasicより下になるようにしたい。HTML div内にテキストを収める方法

これをどのように達成できますか?

は、ここに私のjsbin Iくぼみは、ここで任意のコードが含まれ https://jsbin.com/dudine/edit?html,css,output

申し訳ありませんがみんなあります。

HTML

.textStyle { 
 
    color: white; 
 
    font-weight: bold; 
 
    text-align: center; 
 
    vertical-align: middle; 
 
    font-size: 90%; 
 
    white-space: normal; 
 
} 
 
.left-rounded-corner { 
 
    width: 100px; 
 
    height: 50px; 
 
    background: red; 
 
    line-height: 16px; 
 
    box-sizing: border-box; 
 
    padding-top: 10px; 
 
    border-top-left-radius: 50px; 
 
    border-bottom-left-radius: 50px; 
 
} 
 
/*Allign elements in horizontally*/ 
 
.element_align_horizontally { 
 
    display: inline-block; 
 
}
<div id='statusContainer' class='scrollable'> 
 
    <div class="left-rounded-corner element_align_horizontally textStyle">Basic Details</div> 
 
    <div class="rectangle-shape element_align_horizontally textStyle">two</div> 
 
    <div class="rectangle-shape element_align_horizontally textStyle">three</div> 
 
    <div class="rectangle-shape element_align_horizontally textStyle">Four</div> 
 
    <div class="right-rounded-corner element_align_horizontally textStyle">Five</div> 
 
</div>

あなたの助け ラオ

+1

質問コードの助けを求めるには、ショーを含める必要がありますそれを再現するのに必要なrtestコード**。あなたは[**サンプルまたはサイトへのリンク**]を提供していますが(http://meta.stackoverflow.com/questions/254428/something-in-my-web-site-or-project-doesnt-work-リンクが無効になる場合、あなたの質問は同じ問題を持つ他の将来のSOユーザには価値がないでしょう。 –

+3

'基本
詳細' – amphetamachine

+0

あなたの質問は意味がありません。数行のコードでさえ、謎を解決するためのあなたの疑わしい旅への良いスタートでいいでしょう。 :D –

答えて

0

のおかげであなたは、これは余分なマークアップなしに実現するためにいくつかのことを必要とする...

.left-rounded-corner { 
    ... 
    line-height: 16px; 
    box-sizing: border-box; /* include padding and margin in height */ 
    padding-top: 10px; /* move text down a bit */ 
} 
.textStyle { 
    ... 
    font-size: 90%; /* something big enough to force wrap without extra markup */ 
    white-space: normal; /* allow wrapping */ 
} 
+0

ありがとうございました – BRDroid

関連する問題