css3

Exclude element with fixed positioning from justify-content in flex layout [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-30 22:51:35
问题 This question already has answers here : Absolutely positioned flex item is not removed from the normal flow in IE11 (4 answers) Closed 2 years ago . I'm currently trying to build a responsive website layout with flexbox. Depending on the screen size I want an element to have position: fixed; This itself is working. But when I use justify-content: space-between; on a column that contains an element that gets moved out of the of column itself with position: fixed; the space distribution uses

CSS custom properties (variables) for box model

∥☆過路亽.° 提交于 2019-12-30 20:31:12
问题 I am trying to have CSS variables for box model properties. I want to support both setting a value for all sides as well as individual sides. I want to have default values, but be override-able either way. I tries using fallback values, but with little success. Something like: :root { --border-width-top: 0; --border-width-right: 0; --border-width-bottom: 0; --border-width-left: 0; --border-width: 0; } div { border-color: red; border-style: solid; border-width: var(--border-width, var(--border

CSS animation do not work for svg in <img>

扶醉桌前 提交于 2019-12-30 20:12:42
问题 I am trying to animate an SVG in image/object tag but it is not working svg { width: 100%; height: 200px; } .rotate-45 { transform-origin: center; transform: rotate(45deg); } .rotate { transform-origin: center; animation: rotate 1s ease-in-out infinite; } .rotate-back { transform-origin: center; animation: rotate 1s ease-in-out infinite; animation-direction: alternate; } .left { animation: move 1s ease-in-out infinite; } .right { animation: move 1s ease-in-out infinite; } @keyframes rotate {

How to calc() the number of rows in a grid template?

末鹿安然 提交于 2019-12-30 19:04:11
问题 I'd like to calculate the number of rows in a grid template using calc() , but trying to get the repeat count with division isn't working: .grid { display: grid; grid-gap: 10px; grid-template-columns: 1fr; margin-bottom: 10px; background: rgba(0, 0, 0, 0.2); } .grid>div { background: tomato; width: 20px; text-align: center; margin: auto; } .grid.no-calc { grid-template-rows: repeat(3, 30px); } .grid.addition { grid-template-rows: repeat(calc(1 + 2), 30px); } .grid.subtraction { grid-template

Is it possible to use CSS vars in CSS3 selectors?

白昼怎懂夜的黑 提交于 2019-12-30 18:55:09
问题 I’m trying some experiments with CSS vars, and I couldn’t get this to work or find any documentation about it. Does anyone know if it’s possible to use a CSS var in a CSS3 selector? I made the following example to explain what I’m trying to do. This example is Chrome only. JSFIDDLE http://jsfiddle.net/68Rrn/ CSS :root { -webkit-var-count: 5; /* define my var! */ } li { width:100px; height:100px; background-color:blue; display:inline-block; list-style:none; } ul li:nth-child(4) { background

IE 11 ignores min-width when using flex width

六眼飞鱼酱① 提交于 2019-12-30 18:49:32
问题 I'm wondering if someone can help with this problem. I spent a lot of time on it and I'm all out of ideas, I've tried various suggestions from Google results, various combinations of flex grow and shrink, and couldn't get it working. Demo: https://embed.plnkr.co/dIPh53W4DBkmTB51DCHp/ (open with IE 11) Edit the code: https://plnkr.co/edit/dIPh53W4DBkmTB51DCHp?p=preview In this case, in tablet view the <ul> flex width should be 90%, but in desktop view the <ul> flex width should only be 55%.

IE 11 ignores min-width when using flex width

£可爱£侵袭症+ 提交于 2019-12-30 18:49:01
问题 I'm wondering if someone can help with this problem. I spent a lot of time on it and I'm all out of ideas, I've tried various suggestions from Google results, various combinations of flex grow and shrink, and couldn't get it working. Demo: https://embed.plnkr.co/dIPh53W4DBkmTB51DCHp/ (open with IE 11) Edit the code: https://plnkr.co/edit/dIPh53W4DBkmTB51DCHp?p=preview In this case, in tablet view the <ul> flex width should be 90%, but in desktop view the <ul> flex width should only be 55%.

CSS transition ignores width

十年热恋 提交于 2019-12-30 18:34:50
问题 I have an tag which is displayed as a block. On page load, its width is increased by a css animation from zero to some percentage of the containing div (the fiddle contains a MWE, but there is more than one link in this div, each with a different width). On hover, I want it to change colour, change background colour, and also expand to 100% of the div, using a CSS transition . The colour and background colour bit is working, but it seems to ignore the width transition. Snippet: .home-bar {

Grouping CSS @keyframes rules

我们两清 提交于 2019-12-30 18:34:30
问题 I completely understand that you cannot group animation keyframes selectors such as @keyframes, @-moz-keyframes, @-webkit-keyframes { /*do something*/ } and that you absolutely MUST do @keyframes { /*do something*/ } @-moz-keyframes { /*do something*/ } @-webkit-keyframes { /*do something*/ } I know there are pre-processors that can do all this for me. But I am more interested in the reason behind why this is the case? My google-fu is failing me. It seems to always direct me to a

CSS transition ignores width

独自空忆成欢 提交于 2019-12-30 18:34:27
问题 I have an tag which is displayed as a block. On page load, its width is increased by a css animation from zero to some percentage of the containing div (the fiddle contains a MWE, but there is more than one link in this div, each with a different width). On hover, I want it to change colour, change background colour, and also expand to 100% of the div, using a CSS transition . The colour and background colour bit is working, but it seems to ignore the width transition. Snippet: .home-bar {