flexbox

2020年你不应该错过的CSS新特性

空扰寡人 提交于 2021-02-02 14:40:05
@argyleink在第四次的伦敦(LondonCSS 2020)CSS活动中分享了一个有关于CSS特性相关的话题。看了一下这个主题的PPT,里面有些新东西还是蛮有意思的。基于该PPT,我稍微整理近24个CSS方面的新特性,感兴趣的同学可以继续往下阅读。 接下来的内容我将分为: Web动效 、 Web排版 、 Web性能 、 Web可访问性 、 Web美化 和 其他 等六个部分。 下面聊的CSS新特性当中,有部分还处于实验阶段,如果您感兴趣的话,并不会影响你阅读。你也可以选择你感兴趣的部分阅读。(^_^) NO.1 伦敦CSS 2020 伦敦CSS 2020 (https://www.londoncss.dev/) 并不是一次性的活动,到我写这篇文章为止已经是第四届 (https://www.londoncss.dev/events/event4) 了,每届的话题都不同。在这次活动中主要有三个话题: @argyleink的WHAT'S NEW WITH CSS? @Stephanie Eckles的STYLE STAGE AND MODERN CSS:Style Stage堪比现代版的CSS禅意花园(CSS Zen Garden),允许任何级别的CSS从业者重新设计基于相同HTML的样式,同时提高他们地现代CSS特性的熟悉程度 @Cassie Evans的PAINTING WITH

2020 年你不应该错过的 CSS 新特性

妖精的绣舞 提交于 2021-02-02 13:59:56
@argyleink在第四次的伦敦(LondonCSS 2020)CSS活动中分享了一个有关于CSS特性相关的话题。看了一下这个主题的PPT,里面有些新东西还是蛮有意思的。基于该PPT,我稍微整理近24个CSS方面的新特性,感兴趣的同学可以继续往下阅读。 接下来的内容我将分为: Web动效 、 Web排版 、 Web性能 、 Web可访问性 、 Web美化 和 其他 等六个部分。 下面聊的CSS新特性当中,有部分还处于实验阶段,如果您感兴趣的话,并不会影响你阅读。你也可以选择你感兴趣的部分阅读。(^_^) NO.1 伦敦CSS 2020 伦敦CSS 2020 (https://www.londoncss.dev/) 并不是一次性的活动,到我写这篇文章为止已经是第四届 (https://www.londoncss.dev/events/event4) 了,每届的话题都不同。在这次活动中主要有三个话题: @argyleink的WHAT'S NEW WITH CSS? @Stephanie Eckles的STYLE STAGE AND MODERN CSS:Style Stage堪比现代版的CSS禅意花园(CSS Zen Garden),允许任何级别的CSS从业者重新设计基于相同HTML的样式,同时提高他们地现代CSS特性的熟悉程度 @Cassie Evans的PAINTING WITH

is there any possibility to know if the View is wrapped

北城余情 提交于 2021-01-29 22:21:13
问题 I have a View as below <View style={{width: '60%', flexDirection: 'row', flexWrap: 'wrap'}}> { .....} { .....} <View> if the items in the View are able to be rendered in the single line other wise View will be expanded to second line accordingly. Here my doubt is , Is there any way to know programatically that View is wrapped? 回答1: You can create reference to View and check its styles in its properties. Check here for how to create element reference https://reactjs.org/docs/refs-and-the-dom

Why doesn't this form stick to “justify-content: center” set by its parent container?

删除回忆录丶 提交于 2021-01-29 16:50:39
问题 As I shrink the screen the contact form ditches the properties that I set in its parent container. Everything is fine up until a certain point then suddenly the form jumps to the left with lots of right margin. I can't get my head around why this is happening as the h2 and p tag is doing what it's supposed to do and the form is a child. /* Section 6 */ .container6-heading { margin: 60px auto; max-width: 1170px; text-align: center; display: flex; justify-content: center; flex: 0 0 calc(50% -

Fixing the keyboard navigation order of radio buttons reversed by flex-direction

情到浓时终转凉″ 提交于 2021-01-29 09:34:31
问题 Context: We have some cards that are radio buttons in a radio group, that we want to display in a different order for small and large breakpoints. I want to know if there is a way to do this nicely that doesn't involve duplicating the html for the different breakpoints, and doesn't break accessibility. Desired large breakpoint: |Large|Medium|Small| Desired small breakpoint: |Small| |Medium| |Large| Desired accessibility behaviour: With a radio group, you'd normally expect to hit tab to get to

Hover underlining only text within a flexbox

拈花ヽ惹草 提交于 2021-01-29 07:52:52
问题 I'm trying to get an underline to work on hover on a vertical nav made with flexbox . On a horizontal nav without flexbox the hover underline works fine, but as soon as flexbox is added the underline spans the entire box rather than just under the text. See how in the first snippet below it works as intended but as soon as I make main_nav vertical with flexbox in the second snippet the underline breaks. How can I fix this so it underlines correctly while keeping the nav vertical? #wrapper {

Setting “width: auto” inside a <div> with “display: flex; flex-direction: row” doesn't work

柔情痞子 提交于 2021-01-29 04:11:52
问题 I'm trying to place bunch of divs side by side, left to right. So I'm using a flexbox with direction set to row . I want each of those divs to derive their height and width from the content inside, hence I have left their height and width to default. Lastly, I want to use an svg as the background. For that, I'm using a grid container and placing both the svg and the div in the same column and row as suggested in this stackoverflow post. Im setting the height and width of the svg to 100% to

Without media queries how to achieve 3 column desktop to 1 column mobile layout

被刻印的时光 ゝ 提交于 2021-01-29 03:56:40
问题 Looked into a few questions here but they don't quite solve what I'm looking for. Say I have a website and I want. On desktop I want this: This is easy. grid-template-columns: repeat(3, 33%) (basically) On mobile, however, I want this What I'm running into is happens before it flips to a single column: I'm trying clamp() , minmax() , and all sorts of things but nothing ever works as I want. Yes, I can totally use a media query but I was hoping to create a truly fluid grid/flex layout using

Why don't flex items shrink past content size?

China☆狼群 提交于 2021-01-29 03:34:01
问题 I have 4 flexbox columns and everything works fine, but when I add some text to a column and set it to a big font size, it is making the column wider than it should be due to the flex property. I tried to use word-break: break-word and it helped, but still when I resize the column to a very small width, letters in the text are broken into multiple lines (one letter per line), and yet the column does not get smaller width than one letter size. Watch this video (at the start, the first column

Flexbox children overflow parent

假装没事ソ 提交于 2021-01-29 02:38:56
问题 I'm playing around with flexbox, and my flex-item seems to overflow its parent container. What can I do to make sure it will stay inside its confines? .content { position: absolute; top: 5%; left: 25%; width: 50%; height: 80%; } .flex-container { position: relative; top: 20%; left: 15%; flex-wrap: wrap; display: -moz-box; display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: -moz-flex; display: flex; flex-direction: column; } .flex-item { -ms-box-orient: horizontal;