親divのサイズが変更されてもテキストを変更したいと考えています。親divのサイズが変更されると、テキストは自動的に調整されます。div内でテキストを柔軟にするには?
私がしたいのは、ウィジェットのサイズが増減したときにウィジェット内のテキストを調整することです。
今私は@mediaクエリでこれを処理しています:
@media (min-width: 768px) and (max-width: 1440px) {
.widget-header-title{
background-color:white;
border-bottom:1px solid #F0EEF0 !important;
font-weight:200;
font-size:22px;
color:black;
text-align:center;
}
/*For time widget Only*/
.ticketSummaryTime {
font-weight: bold !important;
font-size: 165px !important;
text-align: center !important;
}
/*For time widget Only*/
.ticketSummary {
font-weight: bold;
font-size: 180px;
text-align: center;
margin-top: 75px;
}
.widget-bottom-status{
font-weight:200;
padding:5px;
margin-top:30px;
font-size:12px;
color:grey;
text-align:center;
border-top:1px solid #F0EEF0 ;
}
}
メディアクエリを使用すると何が問題になりますか? – igorshmigor
メディアクエリ以外では、これはCSSでは不可能です。これにはJSプラグインがあります。 –
メディア照会の問題は、そのメディア画面に対してのみ機能することを照会します。ユーザーが異なる画面のウィジェットの幅を変更するだけの場合はどうでしょうか?私はいくつかのJSプラグインが必要です。 –