Question:
Can I use CSS or other method to change line height of a
?
Jamie P
2007-09-12 13:09:12 UTC
Please help, I'm teaching myself CSS. I am an experienced search engine optimizer, but actually coding a Web site can be shaky. Have a space between a heading and some text that I need to make about half as small. But, all I can get it to do is stay the same or disappear completely. I know this is probably basic, but my college degree is in business (not computer science!) and this is all copmletely self taught through w3schools.com.
Five answers:
J P
2007-09-12 13:36:07 UTC
A better solution would be to set either the margin of the header, or the margin of the text area.
is not really a layout tool its a line break. If you really want to become proficient in CSS learn to use margins and padding to position elements relative to each other. If you want a 10px gap below a header just add style="margin-bottom:10px;" to the tag the encloses your header.
2007-09-13 04:54:42 UTC
This is how you can change line height of a


Value: normal | | |

Initial: normal

Applies to: all elements

Inherited: yes

Percentage values: relative to the font size of the element itself



The property sets the distance between two adjacent lines' baselines.



When a numerical value is specified, the line height is given by the font size of the current element multiplied with the numerical value. This differs from a percentage value in the way it inherits: when a numerical value is specified, child elements will inherit the factor itself, not the resultant value (as is the case with percentage and other units).



Negative values are not allowed.



The three rules in the example below have the same resultant line height:



DIV { line-height: 1.2; font-size: 10pt } /* number */

DIV { line-height: 1.2em; font-size: 10pt } /* length */

DIV { line-height: 120%; font-size: 10pt } /* percentage */



A value of 'normal' sets the 'line-height' to a reasonable value for the element's font. It is suggested that UAs set the 'normal' value to be a number in the range of 1.0 to 1.2.
2007-09-12 13:56:27 UTC
Trying to do use
as a layout item, rather than a line break might cause problems in some browsers. You're best doing as suggests and modifying the characteristics of your heading tag.



There's a good CSS1 reference here:

http://www.zvon.org/xxl/css1Reference/Output/index.html



However, I would just like to say that we lowly web designers have enough competition without you highly valued SEO gurus muscling in on the act! ;}
meghann
2016-05-18 03:51:17 UTC
i looked at the source code in your website, and the footer use class="smfont" ? but here it's between the smfont or the #content :D I'm too lazy right now to look deep down any code... by the way, i guess you didn't plan your website very well :D since the algorithm overlapping.. it's hard to debug you know :D
2007-09-12 13:29:19 UTC
Hey, you can use 'class' property of
tag:



use this structure:



In HTML:






In your style .CSS file:



.MyClassName

{

.height: 1px;

}



Also you can set the height of your
tag without using .Css by write css codes straightly in your tag:








If you have any other questions just keep me posted.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...