WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Added CSS element to style.css doesn't work in IE (6 posts)

  1. mwrmwr
    Member
    Posted 3 years ago #

    I added the following line to the style.css file, then specified it on a page with <small_txt>..text...</small_txt> . It works in Firefox but not in IE8 (has no effect).

    small_txt { font-size: 10px; line-height: 14px; }

    The text is at the bottom of the following page and starts with "California bankruptcy attorney ...".

    http://ca-bankruptcylaw.com

    Any ideas?

  2. stvwlf
    Member
    Posted 3 years ago #

    <small_txt> is not a valid HTML tag

    I think what you are trying to do is this:
    <span class="small_txt">..text...</span>

    Then your css in style.css would be
    .small_txt { font-size: 10px; line-height: 14px; }
    with a period (meaning a class) in front of small_txt

    if that doesn't work try
    span.small_txt { font-size: 10px; line-height: 14px; }

  3. mwrmwr
    Member
    Posted 3 years ago #

    Wow, thanks so much. Now it works with both Firefox and IE.

    One more question if I may. The line-height spec only seems to work down to some minimum line height (more than I want). I reduced the line-height from 14px to 10px as an experiment and the displayed line height didn't change. Any ideas about that?

    Thanks again...

  4. stvwlf
    Member
    Posted 3 years ago #

    Hi

    I didn't look at your actual page earlier. I suggest you change the code to this (remove the span)
    <p class="small_txt">California bankruptcy attorney ... </p>

    change the CSS to this
    p.small_txt { font-size: 10px; line-height: 14px; }

    now you should be able to change the line height to whatever you want.

  5. mwrmwr
    Member
    Posted 3 years ago #

    That worked like a charm. Thanks so much for the CSS tutorial for this monkey-see/monkey-do html and CSS coder!

  6. stvwlf
    Member
    Posted 3 years ago #

    The reason it didn't work with the span is because the P had a line height set for it in the stylesheet. P is a block tag. Block tag settings override any settings assigned to inline tags contained within a block tag. (In a P tag examples of inline tags are SPAN, IMG, A)

Topic Closed

This topic has been closed to new replies.

About this Topic