[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!
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!
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.
.
Re: Is it possible to have header tags with no new lines??
Quote:
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!
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;
}
Re: Is it possible to have header tags with no new lines??
Quote:
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
Re: Is it possible to have header tags with no new lines??
Doh!!!!! Thank you very much :) :) Missed that one :)
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
Re: Is it possible to have header tags with no new lines??
Quote:
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
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 :)!