SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Heading and non-heading text on same line?

    How can I style an <h3> tag so that I can have heading text and non-heading text on the same line?

    I tried:

    h3{magin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; page-break-before: always; font-family: verdana; font-size: 12px;}

    but then if I use <h3>test</h3>test2

    it prints on two seperate lines...any ideas?
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  2. #2
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about something like

    css
    Code:
      h3 {
        font-family: verdana;
        font-size: 12px;
      }
      
      h3 span {
        font-size: 10px;
      }
    html
    Code:
      <h3>Heading <span>non-heading</span></h3>

    maybe not the best way to do it?!

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    h3 {display:inline}
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo
    Code:
    h3 {display:inline}
    Using this nullified my pagebreaks...is there a way to use my h3 tags as a pagebreak AND be able to have other text on the same line? The pagebreaks only apply when the document is printed...
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,821
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    you could float the h3 tag.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    h3 {float:left;margin:0;padding:0}
    </style>
    </head>
    <body>
    <h3>Hello this is heading text :</h3>
    <p>: this is a paragraph</p>
    </body>
    </html>
    You may need to add a width for iemac.

    Or you could use the display:inline method and change it to display:block in the print stylesheet.

    Paul

  6. #6
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help - I actually found a way around the issue in the program I'm writing so I didn't get to try your solution.
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation


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
  •