SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: H Tags question

  1. #1
    SitePoint Member richardfrank's Avatar
    Join Date
    Jun 2004
    Location
    Northern Ireland
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question H Tags question

    I've searched back through the forum and found (I thought) the answer to what follows, but it doesn't seem to work - any further thoughts..?

    Here's the issue:

    I validated the website and realised I'd used a non-valid markup:
    Code:
    <p><h3>Also on this site....</h3>
      <br />A selection of <a href="./clinical.php">clinical cases</a> are shown, with owner permission, mostly in a question and answer format, particularly for the benefit of students.</p>
    ...the problem being, of course, that by trying to prevent the gap under the <h3> tag, I'd nested it within a <p></p> - invalid.

    The answer, I assumed, was to somehow switch off the automatic space given below an <h3>, so I used the following CSS:
    Code:
    h3 {font-size:large;font-weight:500;color:#711724;margin-bottom:0px;}
    ...and the following xhtml:
    Code:
    <h3>Research, Clinical Practice and Teaching</h3>
    <p>After gaining his PhD David stayed at the RVC, as resident in clinical pharmacology with a particular interest, perhaps not surprisingly, in ocular pharmacology. After two years... etc</p>
    That didn't help (see the developing website online), so I also tried creating a class for <p> that made it {display:inline; margin-top:0;}, but still no help...

    I look forward to your (no doubt instantly correct ) advice!

    Thanks guys...

    Richard
    Frank Web Design

  2. #2
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've removed the bottom margin from the <h3>, but what about the top margin on the following <p>?

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,376
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    To follow on from what blufive said above the largest margin on successive elements will always be in effect.

    Therefore reducing the h1's bottom margin to zero will make no difference when the top margin on the p is still in effect. (As an aside note that only the largest margins are applied at all times and are not added together).

    Paul

  4. #4
    SitePoint Member richardfrank's Avatar
    Join Date
    Jun 2004
    Location
    Northern Ireland
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bingo! Works perfectly...

    Thanks - as ever

    Richard


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •