A strange file

F

fuli open

The following file used to be neat one, containing some mistakes
though. Then I renamed it, and the appearance became very messy.
There are some errors on the html validator, but none of which can
account for the crowded situation. I've never encountered such a
problem.

http://www.pinyinology.com/wheel/fortune.html

I hope some expert knows what's wrong with the code. Thanks.
 
J

Jonathan N. Little

fuli said:
The following file used to be neat one, containing some mistakes
though. Then I renamed it, and the appearance became very messy.
There are some errors on the html validator, but none of which can
account for the crowded situation. I've never encountered such a
problem.

http://www.pinyinology.com/wheel/fortune.html

I hope some expert knows what's wrong with the code. Thanks.
body {margin:4%; line-height:1.5px; ...
^^^^^
1.5 pixels is *very* small, think your want

"line-height: 1.5;" or "line-height: 1.5em;"
 
F

fuli open

body {margin:4%; line-height:1.5px; ...
^^^^^
1.5 pixels is *very* small, think your want

"line-height: 1.5;" or "line-height: 1.5em;"

Thanks for pointing out. It was originally '1.5'. I then ran CSS
validator on it, and was told to put an unit after it. So I put 'px'
there. That's why.

Thanks again.
 
T

Toby A Inkster

fuli said:
Thanks for pointing out. It was originally '1.5'. I then ran CSS
validator on it, and was told to put an unit after it. So I put 'px'
there. That's why.

The W3C CSS validator is riddled with bugs such as this. 'line-height'
does not need a unit, and although a unit *can* be applied, it is
generally more useful to not specify any unit.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 
D

dorayme

Toby A Inkster said:
'line-height'
does not need a unit, and although a unit *can* be applied, it is
generally more useful to not specify any unit.

.... because with a unit, browsers use the specified line height
and pass it on exactly to the children and this is often
inappropriate (the kids may be smaller in font size and look odd
with the actual spacing intended for the bigger parents). Using
just a unit, the proportion is noted and applied intelligently to
fit children according to their size.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,371
Latest member
TroyHursey

Latest Threads

Top