1

I've got a small issue with a website I'm currently working on, that doesn't bother me too much, but would be nice to fix. We've designed the site (along with the rest of the advertising for this event) to be based on a strict square grid. Everything is working just fine, except for one little problem:

At the bottom of the page, we have a few paragraphs of body copy that are throwing off the page by a third of a grid square. (We have the line-height of the text to be a third of a grid square) Short of Javascript calculations, is there any way we can add some sort of "smart" padding to the bottom of these paragraphs to re-align the next elements to the grid?

4

1 回答 1

3

有什么办法可以在这些段落的底部添加某种“智能”填充以将下一个元素重新对齐到网格?

我不认为有一个纯粹的 CSS 修复,特别是当您考虑到不同的浏览器/操作系统可能会以稍微不同的高度呈现文本时。

我可以添加到我的答案中的唯一另一件事是您不想要的 JavaScript 修复:

document.body.style.height = Math.round(document.body.offsetHeight/72)*72 + "px";

至少它很短。

于 2012-05-11T23:39:24.093 回答