Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
removing extra line after heading tag
Old 06-15-2008, 05:08 PM removing extra line after heading tag
Skilled Talker

Posts: 56
Trades: 0
hi there. I'm sure this is something that I should have know a long time ago, but I rarely would use heading tags, and now that I do want to use them I keep getting an extra line space after the closing </h3> tag, or h whatever. I googled about this for a while, but all the advice didn't work. I tried styling the heading tags like this:

h3 {margin: 0px; padding: 0px;} also just margin-top or bottom and padding.

or

h3{line-height: 0pt;} and a combination of that with the margin and padding.

neither of those worked. I still have an empty line after my h3 tag, as if it is a <p> tag or something. anyway, I'd love to know if there is another trick to this.

you can see an example here: http://portfoliosfriend.com/pfblog/

on the most recent post there you can see that I used an h3 tag on the word "computerlove" but on all the other bolded words I just used the strong tag, that is why there is no space, and that is how I want them to look. thank!
__________________

Please login or register to view this content. Registration is FREE
- follow
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
tronicscribe is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-15-2008, 07:32 PM Re: removing extra line after heading tag
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
h3{display:inline;}
Headers a block level elements which means they use a newline before and after.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-15-2008, 11:17 PM Re: removing extra line after heading tag
Skilled Talker

Posts: 56
Trades: 0
hmm, that didn't seem to work either. I wonder if something else is causing this to happen. here is the code for me css.

Code:
h1 {font-size: 18pt; display: inline;}
h2 {font-size: 14pt; display: inline;}
h3 {font-size: 10pt; display: inline;}
h4 {font-size: 9pt; display: inline;}
and here is my html in the post.

HTML Code:
<h3>Computerlove</h3> - <a href="http://www.cpluv.com" target="_blank">http://www.cpluv.com</a>
This is one of the first art communities I...
but there is still an extra line space after the h3 text.
http://portfoliosfriend.com/pfblog/
__________________

Please login or register to view this content. Registration is FREE
- follow
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
tronicscribe is offline
Reply With Quote
View Public Profile
 
Old 06-16-2008, 01:30 AM Re: removing extra line after heading tag
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
It's actually
</h3>
<p>
The p is also block which is what's causing this. I'm guessing you want your a link surrounded by a tag to validate. Try:
HTML Code:
<div class="header_wrapper"><h3>Computerlove</h3> - <a href="blah">blah</a></div>
<p>Blah blah blah</p>
I removed the target because you should let the user decide instead of forcing them to open in a new window. I also open in new tab for example, unless I want to leave the page I'm on, your link would open a new window, so I'd close that AND your site and NEVER come back. Also target doesn't exist anymore (deprecated). I'm guessing you have a reason for using h3? Also validate, for you it's not much, missing an alt or two, and forgot to close some tags since you're using XHTML. http://validator.w3.org/check?uri=ht...up=0&outline=1
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-16-2008, 03:57 PM Re: removing extra line after heading tag
Skilled Talker

Posts: 56
Trades: 0
Quote:
Originally Posted by Arenlor View Post
I removed the target because you should let the user decide instead of forcing them to open in a new window. I also open in new tab for example, unless I want to leave the page I'm on, your link would open a new window, so I'd close that AND your site and NEVER come back. Also target doesn't exist anymore (deprecated).
I thought I was doing a good thing by setting the target to _blank. my thought was that if I let them open it in the same window (because I have a feeling that most people don't know that they can middle mouse click or ctrl click to open a new tab or window) they will open the new url and browse that page and never click the back button to get back to my url. that is why I force links in a new window, so my url is never lost. but now I'm not so sure... lol. also, I personally have firefox set to open all new windows in a tab instead, so it just does it by itself when there is a target=_blank. now I can't figure if your method is better. I'm just worried people will not open a new tab or window, and my url will get lost in the history and they won't return after that one click.

also, I didn't know target was done with. how come it still works then? oh, and I'm not using a <p> tag after the h3, so I don't think p is causing the line space. I just decided to change it so the link is also enclosed in the h3 tag. it looks fine this way and it does what I want it to do now, lol. now it reads:
Code:
<h3>computerlove - <a href="http://cpluv.com">http://cpluv.com</a></h3>
one last thing though, why were you wondering if I had a reason for using h3? I just chose it for the size, I didn't want a huge h1 or h2. is there a reason I should choose other h sizes? thanks
__________________

Please login or register to view this content. Registration is FREE
- follow
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Last edited by tronicscribe; 06-16-2008 at 04:08 PM..
tronicscribe is offline
Reply With Quote
View Public Profile
 
Old 06-16-2008, 07:39 PM Re: removing extra line after heading tag
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
It still works it's just deprecated, they don't want you using it. It'll be supported by all browsers because it's allowed in 4.01 transitional and earlier. Your source code showed a p tag after the h3.
You should NEVER use h tags for styling. They are for organizing your code only. Structure, which is what HTML is for, not style, which is what CSS is for.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-16-2008, 08:32 PM Re: removing extra line after heading tag
Skilled Talker

Posts: 56
Trades: 0
that is interesting, because even though the source code shows a <p> it does not use one in the wordpress admin page where I wrote the post, even in the html view.

also, I didn't mean to say that I used the h3 tag to style the text. I meant I chose h3 as apposed to h1 because of the size. I wanted to use a heading so it would be picked up by google and improve my seo, since those words I wrapped in h3 are good keywords for my article.

also, would is your opinion about my reason for using target=_blank? I now need to figure out if I really show remove that. and for the future, what would we be using to force a new window if target is going to be gone? thanks again, I appreciate all your help.
__________________

Please login or register to view this content. Registration is FREE
- follow
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
tronicscribe is offline
Reply With Quote
View Public Profile
 
Old 06-16-2008, 09:13 PM Re: removing extra line after heading tag
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
It'll only improve your SEO if you have it done correctly, nesting h3 in h2 in h1
HTML Code:
<h1>Main Section 1</h1>
<h2>Sub section 1-1</h2>
<h3>Sub Sub Section 1-1-1</h3>
<h3>Sub Sub Section 1-1-2</h3>
I suggest javascript for new windows http://webdesign.about.com/od/javasc.../aa030600c.htm
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to removing extra line after heading tag
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.21132 seconds with 12 queries