CSS line problem?

  • skyvia
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 24, 2011
  • Posts: 32
  • Status: Offline

Post March 6th, 2011, 11:44 pm

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.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 6th, 2011, 11:44 pm

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post March 7th, 2011, 2:14 pm

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
  • No Avatar
  • Joined: Mar 14, 2011
  • Posts: 1
  • Loc: Europa
  • Status: Offline

Post March 14th, 2011, 9:58 am

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
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post March 14th, 2011, 12:55 pm

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
  • Joined: Aug 14, 2007
  • Posts: 54
  • Loc: Neo Universe
  • Status: Offline

Post March 19th, 2011, 10:54 am

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: No registered users and 114 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.