calc

Is it possible to get a negative value with CSS calc()?

拟墨画扇 提交于 2019-12-03 07:27:15
问题 Let's say we have a container that is centered in the viewport ... .centered{margin: 0 auto; width:960px;} ... and inside that container I have another that needs to have a width of 100% the viewport width. I could set the margin to ... .widest{margin: 0 -480px} ... for example. The thing is that the value won't be -480px, but actually the viewport width (960px) - the .centered width / 2 ... all good and easy with calc(), only I need a result that is a negative value. .widest{ margin: 0 calc(

what language do I need to write macros in LIbre Office Calc? [closed]

我与影子孤独终老i 提交于 2019-12-03 05:39:04
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . I've written a bunch of VBA code for various things in Excel. I'm looking at migrating to libreOffice. Under Tool->Macros->Organize Macros: the two choices are LibreOffice Basic and Python. Should I learn one of those, both, or something else. Am I wasting my time altogether? Any suggestions appreciated. Python is the way to go. Start here: http://wiki.python.org/moin/BeginnersGuide

display: flex; vs calc(); performance

白昼怎懂夜的黑 提交于 2019-12-03 05:33:06
I came up today in a discussion where I'm wondering what is the most performant way of having two div's beside each other. On one side, i love using display:flex; , on the other side there is the option to use calc() , the reason is our div has padding and we need to reduce the width by the padding. Case: <div class='container'> <div class='inner'></div> <div class='inner'></div> </div> Both should be on 50% width. The default css is: * { -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /* Opera/IE

ch_6801 棋盘覆盖

喜欢而已 提交于 2019-12-03 03:00:50
http://noi-test.zzstep.com/contest/0x60%E3%80%8C%E5%9B%BE%E8%AE%BA%E3%80%8D%E4%BE%8B%E9%A2%98/6801%20%E6%A3%8B%E7%9B%98%E8%A6%86%E7%9B%96 6801 棋盘覆盖 0x60「图论」例题 描述 给定一个N行N列的棋盘,已知某些格子禁止放置。求最多能往棋盘上放多少块的长度为2、宽度为1的骨牌,骨牌的边界与格线重合(骨牌占用两个格子),并且任意两张骨牌都不重叠。N≤100。 输入格式 第一行为n,t(表示有t个删除的格子) 第二行到t+1行为x,y,分别表示删除格子所在的位置 x为第x行,y为第y列,行列编号从1开始。 输出格式 一个数,即最多能放的骨牌数 样例输入 8 0 样例输出 32 二分图最大匹配版题 #include<iostream> #include<cstdio> #define ri register int #define u int namespace opt { inline u in() { u x(0),f(1); char s(getchar()); while(s<'0'||s>'9') { if(s=='-') f=-1; s=getchar(); } while(s>='0'&&s<='9') { x=(x<<1)+(x<

CSS Calc Viewport Units Workaround?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: From what I've seen in other answers , CSS viewport units can't be used in calc() statements yet. What I would like to achieve is the following statement: height : calc ( 100vh - 75vw ) Is there some workaround way I can achieve this using purely CSS even though the viewport units can't be used in the calc() statement? Or just CSS and HTML? I know I can do it dynamically using javascript, but I'd prefer CSS. 回答1: Before I answer this, I'd like to point out that Chrome and IE 10+ actually supports calc with viewport units. FIDDLE

CSS3 calc() not working in latest chrome

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I noticed that my usage of the CSS3 calc() function as the unit for width is not working in the latest version of Chrome. In the Chrome Developer tools, the rule with calc() has a strikethrough through it and an exclamation mark in a yellow triangle to the left of it. This is signaling that the property or value is not recognized. How do I get it to work in modern browsers? Because it is a value and not a property, where do the vendor prefixes go? Update: When I say it doesn't work, I mean that Chrome Dev Tools is saying that it is not

CSS3 height: calc(100%) not working

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a div that I want to fill the whole height of the body less a set number in pixels. But I can't get height: calc(100% - 50px) to work. (The reason I want to do this is I have elements that have dynamic heights based on some varying criteria, e.g. height of the header changes based on different elements it can contain. A content div then needs to stretch to fill the rest of the available space available.) The div element however stays the height of the content - it doesn't seem as if it interprets 100% to be the height of the body

Sass Variable in CSS calc() function

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use the calc() function in a Sass stylesheet, but I'm having some issues. Here's my code: $body_padding: 50px body padding-top: $body_padding height: calc(100% - $body_padding) If I use the literal 50px instead of my body_padding variable, I get exactly what I want. However, when I switch to the variable, this is the output: body { padding-top: 50px; height: calc(100% - $body_padding); } How can I get Sass to recognize that it needs to replace the variable within the calc function? 回答1: Interpolate: body height: calc(100% - #{

css width: calc(100% -100px); alternative using jquery

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to use width: calc(100% -100px); which does the job perfectly for what I need it for, the only problem is its compatibility. At the moment it only works in the latest browsers and not at all in Safari. Could I make an alternative using jQuery? ie. get the 100% width of an object -100px and then dynamically set the result as the CSS width (so it would be responsive) 回答1: If you have a browser that doesn't support the calc expression, it's not hard to mimic with jQuery: $('#yourEl').css('width', '100%').css('width', '-=100px'); It's

How can I create a calc mixin to pass as an expression to generate tags?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on a sass stylesheet in which I wish to use the calc element to dynamically size some content. As the calc element has not been standardized, I need to target calc() , -moz-calc() , and -webkit-calc() . Is there a way for me to create a mixin or function that I can pass an expression to so that it will generate the required tags that can then be set as a width or height ? 回答1: It would be a basic mixin with an argument , thankfully the expressions are not browser-specific within the supported scope: @mixin calc($property,