#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Posts
    19
    Rep Power
    0

    some problems with CSS across browsers


    Hello,
    I have a couple of questions I would love answers to that I've been accumulating and trying to solve myself without much luck

    1. Does anyone know how I set the BR tag in CSS for changing line heights. In IE5.5 and Opera BR seems to put a line space between, but Mozilla doesn't and I would like it to do this consistently. I need BR because my form based PHP code inserts BR automatically for each new line (which is what I want), I've tried such things as BR{line-height: 2em;} but nothing seems to work. Just to qualify this, I have put in the following in an included stylesheet that seems to make Mozilla remove the line break: BR {display: block } but cannot see how this is causing the problem.

    2. Is there a way of making background images in style sheets actually be incorporated into the element for sizing purposes. What I mean is, as an example, if I set the background of a table cell to have a background image when I resize the form to be smaller than the image, the image crops, but if the image was an image element or the actual content of a TD then it isn't cropped.

    thanks.
    Last edited by retroman; June 2nd, 2003 at 09:24 AM.
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1099
    1. <br> is an inline element and line-height needs to be applied to the containing block element.
    Code:
    <p style="line-height:2em;">foo<br>bar</p>
    2. What are you looking for it to do? Resize the image to fit the containing element so that you can always see the entire image? Don't think it's possible with stylesheets alone.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Posts
    19
    Rep Power
    0
    The problem is that applies to the whole block, all I want to do is reduce the size of the paragraph break and leave the normal wrapped text as it is. I'm sure it could be done by replacing all the <br /> elements in code with something like '<p class="smalllinebreak"> but I'd rather just take the content from the mySQL table and output it.

    There has got to be something that formats BR as in my browser BR changes to a 1em line space and so must be a way of chaning this, as I want to make this 0.5em?

    Neil.

IMN logo majestic logo threadwatch logo seochat tools logo