我工作的一個移動響應式設計和我被困在那裏我需要顯示在一個圓圈中間的文本。文本將從數據庫中提取,因此文本有時可能很短或很長。我需要這個文本在內圈的中間開始,如果有文本的多條線路,讓文字去向上。爲了您的方便,我製作了JSFille。我在CSS中的#child似乎沒有影響它應用於的div。如果有Javascript解決方案,它也將不勝感激。謝謝。垂直文本對齊,並填補其容器
*{
box-sizing:border-box;
}
.theCircle{
width:84vw;
height:84vw;
border:0.5vw solid black;
margin:auto;
border-radius:42vw;
position:relative;
}
.innerCircle{
width:62vw;
height:62vw;
border:0.5vw solid black;
margin:auto;
border-radius:31vw;
position:absolute;
top:10.5vw;
left:10.5vw;
}
.bubble {
position: absolute;
width: 30vw;
height: 10vw;
left: 25vw;
border: 1px solid gray;
border-radius: 20vw;
background-color: #e0e0eb;
}
#bName{
position: relative;
top:2vw ;
left: auto;
font-size: 6vw;
border: 1px solid black;
text-align: center;
word-wrap:break-word
}
#child {position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 50%;
height: 30%;
margin: auto;}
<div class="theCircle">
<div class="bubble"> text inside the bubble</div>
<div class="innerCircle">
<div id="bName"><div id="child">I need this to start in the middle of the circle, and to go upwards when there is a lot of text like this </div></div>
你所說的「向上走」是什麼意思? – guest271314