left edge

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Block

    left edge

    Hello,

    CSS21 Spec points the following out (9.4.1):

    <citation>
    In a block formatting context, each box's left outer edge touches the left
    edge of the containing block (for right-to-left formatting, right edges
    touch).
    </citation>

    I understand that if there are nested div-elements they will have the same
    left edge.

    But what, if I want the inner div to be right shifted 10 px?

    - padding (outer div)
    - margin-left (inner div)
    - position:relati v in combination with left (innder div)

    all that does not work.

    Any ideas?

    Best regards,

    Oliver

  • Oliver Block

    #2
    Re: left edge

    Oliver Block wrote:[color=blue]
    > Any ideas?[/color]

    I inserted a spacer div before inner div with the following css properties:

    #spacer {
    float:left;
    height:100%;
    width: 10px;
    }

    But I'd really like to know how you would have solved that problem.:)

    Comment

    • Spartanicus

      #3
      Re: left edge

      Oliver Block <news200605@blo ck-online.eu> wrote:
      [color=blue]
      >CSS21 Spec points the following out (9.4.1):
      >
      ><citation>
      >In a block formatting context, each box's left outer edge touches the left
      >edge of the containing block (for right-to-left formatting, right edges
      >touch).
      ></citation>
      >
      >I understand that if there are nested div-elements they will have the same
      >left edge.
      >
      >But what, if I want the inner div to be right shifted 10 px?
      >
      >- padding (outer div)
      >- margin-left (inner div)
      >- position:relati v in combination with left (innder div)
      >
      >all that does not work.[/color]

      Sure it does:


      Although using relative positioning would likely not be what you want.

      --
      Spartanicus

      Comment

      • Oliver Block

        #4
        Re: left edge

        Spartanicus wrote:[color=blue][color=green]
        >>all that does not work.[/color]
        >
        > Sure it does:
        > http://homepage.ntlworld.com/spartanicus/temp.htm[/color]

        You are right. On your site it does. I mine, it didn't.
        I rewrote the page with a different box model and now it works, too.

        --Oliver

        Comment

        Working...