CSS line problem?

  • skyvia
  • Novice
  • Novice
  • skyvia
  • Posts: 32

Post 3+ Months Ago

How do I fix the line height in css. i.e. I have a header, under it (with very litle space between the lines) I want a text. The header is a H1 and the text under is unspecified, but the font size differ.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

If you don't want to define the text then use
Code: [ Select ]
body {line-height:1.5px}
or whatever value you want, plus I think you can use em (not sure though I must admit I don't use line-height much) but I would add it in a span or something because you will alter the website all at once and it will mess with the site layout.
  • francisco222
  • Born
  • Born
  • francisco222
  • Posts: 1
  • Loc: Europa

Post 3+ Months Ago

Yep, it is line-height: you use px, em, percentage - usually use px, although I don't think it will take the fractions of a pixel though-
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

francisco222 wrote:
Yep, it is line-height: you use px, em, percentage - usually use px, although I don't think it will take the fractions of a pixel though-

your right it will only take whole numbers for px but just to note 1.5px will render just as 2px (but I think the new iphone 4 my allow 4.5px because it works differently to others but to be honest it makes very little difference)
  • mico
  • Beginner
  • Beginner
  • User avatar
  • Posts: 54
  • Loc: Neo Universe

Post 3+ Months Ago

yes. better you make own class for the text and use span for it, so it won't mess up the whole lines in page's content.
btw, besides line-height, you can also use padding-top for the text, or padding rule for the header..

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: matteodoors and 19 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.