johnnyk Posted July 2, 2006 Share Posted July 2, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/13425-displayinline-and-other-stuff/ Share on other sites More sharing options...
wildteen88 Posted July 2, 2006 Share Posted July 2, 2006 [quote]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?[/quote]I usually apply a top and bottom margin for the header elements, like so:[code]h1, h2, h3, h4, h5, h6 { margin: 5px 0px 10px 0px;}[/code]I've nevery used display:inline on headers. Quote Link to comment https://forums.phpfreaks.com/topic/13425-displayinline-and-other-stuff/#findComment-51931 Share on other sites More sharing options...
johnnyk Posted July 2, 2006 Author Share Posted July 2, 2006 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 />? Quote Link to comment https://forums.phpfreaks.com/topic/13425-displayinline-and-other-stuff/#findComment-52254 Share on other sites More sharing options...
wildteen88 Posted July 3, 2006 Share Posted July 3, 2006 The gap between the line is depends on the size of your font. Quote Link to comment https://forums.phpfreaks.com/topic/13425-displayinline-and-other-stuff/#findComment-52440 Share on other sites More sharing options...
johnnyk Posted July 3, 2006 Author Share Posted July 3, 2006 So say it's size 16 font, what would the gap be? Or does it not really matter how big I make the gap? Quote Link to comment https://forums.phpfreaks.com/topic/13425-displayinline-and-other-stuff/#findComment-52549 Share on other sites More sharing options...
wildteen88 Posted July 3, 2006 Share Posted July 3, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/13425-displayinline-and-other-stuff/#findComment-52569 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.