2

So I'm designing a portfolio page which will contain mostly header text with a few paragraphs and images thrown in for good measure!

My headings and one lined text will expand to fill the entire width of it's container which will be the wrapper.

<div id="wrapper">
    <h1>I'm a heading</h1>
    <p>I aim to fill just one line regardless of letter count</p>
</div>

Now, I have been searching the net for a solution which will allow me to achieve the above. I have found both bigText.js which doesn't work no matter what I do and fitText.js which doesn't automatically size text to it's parent container without editing the .js to find a font size that suits - even then it's not pixel perfect.

My question therefore is, With a wrapper that I wish to keep just 35% of the screen (centred), am I best to keep as a percentage (fluid) or use a fixed width? and with either option, what's the correct way to adjust the font-size to fill the wrapper width correctly?

Thanks in advance,

Simon

4

1 回答 1

0

如果您希望它居中,请使用百分比和“边距:自动”。阅读其他框架如何解决这个问题: Twitter Bootstrap非常适合我的工作。

于 2013-08-28T18:23:38.667 回答