HELP! Question for those who know XHTML and CSS!?

2008-11-27 6:16 pm
Im doing a dummy site for a project. However I keep encountering this problem. Im a newbie so please bear with me. Im using the <h1></h1> tags; theres no problem with that, but my site now has all these useless space before and after the headers or paragraphs. I dont know how to elimitnate those spaces or at least minimize them. I heard there's a way to do that in CSS or something. Please advise. Can anyone help me please?

回答 (2)

2008-11-27 11:48 pm
In addition to line height, you can also use margin and padding to control the spacing.

For example, if you add “padding: 5px 0 0 5px;“ to your h1{ in your CSS file, it will add a 5px cushion on top and right of the text.

Adding “margin:0 5px 0 0;” will push your text 5px from the left.

It goes top, right, bottom, left. Here's more reading you can look at:
http://www.w3.org/TR/CSS2/box.html
2008-11-27 7:31 pm
In your CSS you can update your header tags "H1, H2, H3,..." All you have to do is add the following to your CSS.

h1
{
line-height: 14pt;
}

or you can use px(pixels) instead of pt(point).

you can also use the following if you want

font-size:12pt;
font-family: arial;
font-weight: bold;

and so forth


收錄日期: 2021-05-03 11:50:14
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20081127101605AAyOqFh

檢視 Wayback Machine 備份