SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: css

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2000
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a really silly question. But I have a css file, works great. my html file is set up like a glossary.
    -------------------------------------
    <!-- Out put -->
    Accident:
    An unforeseen and unavoidable event resulting in an injury.

    Actively At Work (Active Employment):
    You are considered to be actively at work when performing in the customary manner all of the regular duties of your .....
    --------------------
    <!-- Code -->
    <DIV CLASS="smheadertext"><i>
    Accident:
    </i></div>

    <DIV CLASS="normaltext">
    An unforeseen and unavoidable event resulting in an injury.<BR><BR>
    </div>

    <DIV CLASS="smheadertext"><i>
    Actively At Work (Active Employment):
    </i></DIV>

    <DIV CLASS="normaltext">
    You are considered to be actively at work when
    performing in the customary manner all of the regular duties of your occupation with the
    employer either at one of the employer's regular ..
    </div>
    ----------------------------------------------

    But I want to have the output to be

    Accident: An unforeseen and unavoidable event resulting in an injury.

    Actively At Work (Active Employment): You are considered to be actively
    ------------------------------------------------
    (I want the definition to be right after the type of word)

    I hope someone can help me out.


  2. #2
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi.
    One thing I don't understand is why you are using <div>s
    If the divs are only meant to change the style of the text, try using <p class="smheadertext"> instead of <div>

    Also, since you're using stylesheets, instead of using <i>, add a "font-style: italic;" to the smheadertext class.

    Hope this helps.

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2000
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <p class="smheadertext"> doesn't do the same as <div class>

    What is the difference between the two.

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ifabbric...the reason why the definition is not appearing RIGHT after the word is that a DIV tag implies a break, meaning that the next thing after the DIV will be on a new line. The same goes for the P tag. It also implies a break after the closing tag

    Use SPAN instead and you will have no problems.

    <span CLASS="smheadertext"><i>Accident/i></span>

    Also, why are you putting an italic tag around the word? Why don't you just put that in your style?

    BTW, I will ALWAYS recommend using SPAN as the element that you style because it is one of the only tags that has no inherent properties of it's own. Meaning that it does nothing unless you style it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Zealot
    Join Date
    Nov 2000
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you sooo much.

    <span > works perfectly.

  6. #6
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <div> is a frontpage tag if I recall correctly, automated into it by way of MS

    Gotta love MS, try to write your own CSS code, or you're going to have one hell of a time doing it using frontpage, or any other WYSIWYG editor.

    DynamixPro - Revolutionize Your Future
    http://www.dynamixpro.com
    Affordable Web & Print Design

  7. #7
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, <div>, <span> and the like are DHTML tags introduced in HTML 4.0; you're right, it's hard to code this by hand, but I hate Frontpage . They're useful when you're doing crazy stuff like JS animation or dynamic showing/hiding of information.
    Brad Ediger
    Chief Programmer
    DynamixPro - Revolutionize Your Future
    http://www.dynamixpro.com/


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
  •