|
-
Aug 11th, 2011, 07:46 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Is it possible to have header tags with no new lines??
Hi,
When I add a header tag to a title like:-
<h1>Header</h1>
It shows on the browser like this:-
Header
This is my text.
I want it to show like this:-
Header
This is my text.
Is this possible or is it just the way a browser renders a header tag?
Thanks for any help,
Jiggy!
-
Aug 11th, 2011, 10:32 AM
#2
Fanatic Member
Re: Is it possible to have header tags with no new lines??
Use css to change the padding and margin properties of the header
Code:
<h1 style="margin-bottom:0;padding-bottom:0;">Header</h1>
Also read a tutorial about html/css!
-
Aug 11th, 2011, 10:33 AM
#3
Re: Is it possible to have header tags with no new lines??
Methinks it's a rendering thingy. If you do want to eliminate the space you could use font attributes to make your "Header" appear as if it was in h1 tags, and then try to write the other part of text after a <br> tag. But then since your text wouldn't have the h1 tag, it would not strictly be a header.
.
-
Aug 11th, 2011, 10:48 AM
#4
Fanatic Member
Re: Is it possible to have header tags with no new lines??
 Originally Posted by honeybee
Methinks it's a rendering thingy. If you do want to eliminate the space you could use font attributes to make your "Header" appear as if it was in h1 tags, and then try to write the other part of text after a <br> tag. But then since your text wouldn't have the h1 tag, it would not strictly be a header.
.
Forget about font attributes, depreceated and not used anymore. CSS is definetly the way to go and as your header will still be a header its good for accessibility.
I actually double checked to make sure I hadnt replied to a post ten years ago by mistake!
-
Aug 11th, 2011, 10:54 AM
#5
Thread Starter
Frenzied Member
Re: Is it possible to have header tags with no new lines??
lol; I tried it inline and it works great thank you very much. But when I added it in my css it didn't. Here is my css:-
Code:
.h2
{
margin-bottom: 0px;
padding-bottom: 0px;
}
-
Aug 11th, 2011, 10:57 AM
#6
Fanatic Member
Re: Is it possible to have header tags with no new lines??
 Originally Posted by Jigabyte
lol; I tried it inline and it works great thank you very much. But when I added it in my css it didn't. Here is my css:-
Code:
.h2
{
margin-bottom: 0px;
padding-bottom: 0px;
}
Thats because you have set this up as a class, by using the .
So you would need to write the header like
<h1 class="h2">
in your style sheet try
h1{
margin-bottom: 0px;
padding-bottom: 0px;
}
Then every h1 will be the same.
I would suggest
.HeaderNoBottomSpacing
and then
<h1 class="HeaderNoBottomSpacing">
Prob better than the selector of h1 as you will not affect all headers, and its a beter anming convention than yours.
Hope this helps
-
Aug 11th, 2011, 11:02 AM
#7
Thread Starter
Frenzied Member
-
Aug 11th, 2011, 11:11 AM
#8
Fanatic Member
Re: [RESOLVED] Is it possible to have header tags with no new lines??
No problem, its nice to be able to help someone here for once and return the favour
-
Aug 12th, 2011, 01:59 AM
#9
Re: Is it possible to have header tags with no new lines??
 Originally Posted by davebat
I would suggest
.HeaderNoBottomSpacing
and then
<h1 class="HeaderNoBottomSpacing">
Prob better than the selector of h1 as you will not affect all headers, and its a beter anming convention than yours.
Hope this helps
I definitely agree that this would be the best approach, there will be times when you will want the padding/margin to either be the default, or different, so segregate out your styles.
Gary
-
Aug 12th, 2011, 03:04 AM
#10
Thread Starter
Frenzied Member
Re: [RESOLVED] Is it possible to have header tags with no new lines??
Okay thanks. For this site I want it for all header 1's etc because my site is dynamic and only has 3 content pages. But I do understand your point !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|