Jump to content


Photo

display:inline and other stuff


  • Please log in to reply
5 replies to this topic

#1 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 02 July 2006 - 03:52 AM

I read somewhere that if you want to display an element without space above and below it (such as the h1 tag, which by default does), you should use {padding: 0px; margin: 0px} instead of {display: inline}

On the same page, they also said that you should try to avoid putting <br /> after h1-h6 tags. How would I have the next element appear on a new line without doing that?

And if you feel like it I have 2 more questions:
-In general, what's better {font-size:12px;} (or whatever px) or {font-size:100%}
-When should I use IDs instead of classes. I read that you should use IDs when there's only one occurrence, but is there actually any benefit to doing that. What's so bad about using classes for something that occurs once?
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 July 2006 - 09:38 AM

I read somewhere that if you want to display an element without space above and below it (such as the h1 tag, which by default does), you should use {padding: 0px; margin: 0px} instead of {display: inline}

On the same page, they also said that you should try to avoid putting < br />
after h1-h6 tags. How would I have the next element appear on a new line without doing that?

I usually apply a top and bottom margin for the header elements, like so:
h1, h2, h3, h4, h5, h6 {
    margin: 5px 0px 10px 0px;
}
I've nevery used display:inline on headers.

#3 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 02 July 2006 - 11:45 PM

How big (in %) is the margin created by a <.br />, or should I not use %?
In general, how big is the margin created by <.br />?
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 July 2006 - 02:36 PM

The gap between the line is depends on the size of your font.

#5 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 03 July 2006 - 05:49 PM

So say it's size 16 font, what would the gap be? Or does it not really matter how big I make the gap?
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 July 2006 - 06:27 PM

The gap will be nothing. When you use < br /> it makes the text go to a newline until you use two or more < br> tag then they'll be a gap, but the gap depends on the size of your font. So if your text was 24px each line will have a gap of 24px.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users