Results 1 to 10 of 10

Thread: [RESOLVED] Is it possible to have header tags with no new lines??

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Resolved [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!

  2. #2
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    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!

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    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.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    Re: Is it possible to have header tags with no new lines??

    Quote Originally Posted by honeybee View Post
    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!

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    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;
    }

  6. #6
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    Re: Is it possible to have header tags with no new lines??

    Quote Originally Posted by Jigabyte View Post
    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

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Is it possible to have header tags with no new lines??

    Doh!!!!! Thank you very much Missed that one

  8. #8
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    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

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Is it possible to have header tags with no new lines??

    Quote Originally Posted by davebat View Post
    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

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    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
  •  



Click Here to Expand Forum to Full Width