css arithmetic??

Discussion in 'CSS' started by kisamesama, Sep 12, 2007.

  1. #1
    how to make this work?

    
    .layout{
    left:inherit + 12;
    }
    
    Code (markup):
    can u add 12px to the inherited position of the parent tag...
     
    kisamesama, Sep 12, 2007 IP
  2. islack

    islack Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try using

    position: relative;
    left: 12px;
     
    islack, Sep 12, 2007 IP
  3. Jasonb

    Jasonb Well-Known Member

    Messages:
    4,486
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    195
    #3
    yeah
    position: relative;
    left: 12px;

    like the dude said
     
    Jasonb, Sep 12, 2007 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Though I'd make DAMNED certain that's actually what you want to do... position:relative with left/right/top/bottom is usually a bad idea unless you are 100% certain you want to move the content without changing flow.

    Which is why I'd suggest margin-left:12px; instead.
     
    deathshadow, Sep 12, 2007 IP
  5. kisamesama

    kisamesama Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i need to use absolute value as it need to be a floating div... will try the margin-left

    edit: not working :9 with margin-left
     
    kisamesama, Sep 13, 2007 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    could we see what you are trying to do then? URL? Code sample? .jpg or .psd?

    You show us WHAT, we can probably tell you HOW... hell, being HTML/CSS we can probably tell you ten different ways of doing what you are attempting...

    Though if you want it absolute positioned relative to it's parent container, just make the parent container position:relative... again though, that's guessing in the dark.
     
    deathshadow, Sep 13, 2007 IP
  7. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #7
    margin-left:12px; is the way to go
     
    le007, Sep 13, 2007 IP