鍍金池/ 問答/HTML/ 我想讓文字可以填滿一個div,設(shè)置高度之后,應(yīng)該如何設(shè)置字體大小,

我想讓文字可以填滿一個div,設(shè)置高度之后,應(yīng)該如何設(shè)置字體大小,

每次設(shè)置字體大小的時候,div都會隨著字體大小變化
我想讓字體填滿這個高度為30的div,字體大小怎么設(shè)置?

<Texts
                    styleSet={{
                        height: '30px',
                        lineHeight: '30px',
                        position: 'absolute',
                        fontSize: '36px',
                        left: '589px',
                        color:'#FFFFFF',
                        top: '215px',
                        width: '150px',
                        //backgroundColor: 'red'
                    }}
                    text={'16:30前'}
                />

問題補充 11:45

圖片描述

高度70 字體70 依然不能填滿

<Texts
                    styleSet={{
                        left: 164,
                        top: 210,
                        height: 70,
                        lineHeight: 1,
                        position: 'absolute',
                        fontSize: 70,
                        color:'#FFFFFF',
                        backgroundColor:'red',
                        width: 120
                    }}
                    text={totalOrderAccount}
                />
回答
編輯回答
膽怯

lineHeight設(shè)置為1,不要加px

<Texts
    styleSet={{
        height: '30px',
        lineHeight: 1,
        position: 'absolute',
        fontSize: '36px',
        left: '589px',
        color:'#FFFFFF',
        top: '215px',
        width: '150px',
        //backgroundColor: 'red'
    }}
    text={'16:30前'}
/>
2017年7月18日 21:24