calculating width

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mpayne@qualtech-int.com.au

    #1

    calculating width

    I have a span that has a width of 25%. I want to use that span as the
    top of a dialog box that has rounded corners. So, the span itself is
    broken up into 3 smaller spans, one for the left and right corner
    images, and one that stretches in between.

    <span id="dialogTop" style="{width:2 5%;}">
    <span id="dialogTopLe ft" style="{width:6 px;}"></span>
    <span id="dialogTopMi ddle" style="{width:( 25% - 12px ???);}"></span>
    <span id="dialogTopRi ght" style="{width:6 px;}"></span>
    </span>

    I know that the left and right spans need to be 6px each. What I need
    to do is define the width of the middle bit as being 25% - 12px. Is
    this at all possible?

    Thanks
    Martin

  • RobB

    #2
    Re: calculating width

    mpa...@qualtech-int.com.au wrote:[color=blue]
    > I have a span that has a width of 25%. I want to use that span as[/color]
    the[color=blue]
    > top of a dialog box that has rounded corners. So, the span itself is
    > broken up into 3 smaller spans, one for the left and right corner
    > images, and one that stretches in between.
    >
    > <span id="dialogTop" style="{width:2 5%;}">
    > <span id="dialogTopLe ft" style="{width:6 px;}"></span>
    > <span id="dialogTopMi ddle" style="{width:( 25% - 12px[/color]
    ???);}"></span>[color=blue]
    > <span id="dialogTopRi ght" style="{width:6 px;}"></span>
    > </span>
    >
    > I know that the left and right spans need to be 6px each. What I[/color]
    need[color=blue]
    > to do is define the width of the middle bit as being 25% - 12px. Is
    > this at all possible?
    >
    > Thanks
    > Martin[/color]

    Really a CSS, not a JavaScript, question. Might want to brush up on
    inline (HTML) CSS notation first:
    [color=blue]
    > <span id="dialogTop" style="width:25 %;">[/color]

    Curly braces belong in HTML <style></style> blocks.

    http://www.w3.org/TR/REC-html40/pres....html#h-14.2.2

    A span is an inline element; you really need a box-level element for
    this.



    Comment

    Working...