开发者

Width of a divider 100% minus a few pixels

the image below will explain what I mean

click here for image

pretending that the red area is not a divider since I just want it to be empty with a fluid-like divider

position:absolute; left:0px; right:100px;

the above thing wont work because im trying to do this with a table inside a divider that开发者_如何学C is already using the position:absolute.... and it's actually for height but to make explaining simpler im just asking for the width


Your specific question is rather confusing, but, no, CSS has no concept of math. You can't do 100% - 50px, for instance, even though that would be really handy.

However, you can give elements margins of specific measurements, and if you don't give the element a defined width, it is, by default, 'auto' so will take up the remaining space.

So the left DIV could be set with a 100px right-margin.

That would answer your question if it were about CSS and horizontal spacing of a fluid layout.

As for your vertical spacing issues and a table, that's really an entirely different thing, so would suggest you revise your question with the specific markup you are looking for help on.


You could have a loot to less css framework (it deals with js)

you can use operators, check the Functions & Operations in less official website, very interesting, you can do things like:

@base-color: #000000;
    #footer { 
      color: @base-color + #003300;     
}


You can use width: calc(100% -100px); but it's not supported by all browsers unfortunately.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜