css3

Webkit CSS Animation issue - persisting the end state of the animation? [duplicate]

故事扮演 提交于 2019-12-27 12:17:48
问题 This question already has answers here : Maintaining the final state at end of a CSS3 animation (4 answers) Closed 4 years ago . Given the following CSS3 animation.... <style type="text/css" media="screen"> .drop_box { -webkit-animation-name: drop; -webkit-animation-duration: 2s; -webkit-animation-iteration-count: 1; } @-webkit-keyframes drop { from { -webkit-transform: translateY(0px); } to { -webkit-transform: translateY(100px); } } </style> <div class="drop_box"> Hello world </div> The

Set flexbox children to have different heights to use up available space

左心房为你撑大大i 提交于 2019-12-27 12:03:13
问题 Using a two-column flexbox layout, how can different-sized children be made to fill all available space, instead of all children having the height of the tallest child of the row? I set up a demo on jsbin that illustrates the problem. I'd like for all the children to be the size of their wrapped contents. #container { width: 800px; display: flex; flex-wrap: wrap; } .cell { width: 300px; flex; 1 auto; } <div id="container"> <div class="cell"> Cells with arbitrarily long content.</div> <div

Play multiple CSS animations at the same time

◇◆丶佛笑我妖孽 提交于 2019-12-27 11:55:40
问题 How can I have two CSS animations playing at different speeds ? The image should be rotating and growing at the same time. The rotation will cycle every 2 seconds. The growth will cycle every 4 seconds. Example Code: .image { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin:-60px 0 0 -60px; -webkit-animation:spin 2s linear infinite; -webkit-animation:scale 4s linear infinite; } @-webkit-keyframes spin { 100% { transform: rotate(180deg); } } @-webkit-keyframes scale

How to use CSS (and JavaScript?) to create a blurred, “frosted” background?

99封情书 提交于 2019-12-27 11:02:09
问题 I'm trying to create an iOS 7 style frosted look with HTML5, CSS3 and JavaScript which can work on webkit browsers. Technically, given the following HTML: <style> #partial-overlay { width: 100%; height: 20px; background: rgba(255, 255, 255, .2); /* TODO frost */ position: fixed; top: 0; left: 0; } </style> <div id="main-view"> <div style="width: 50px; height: 50px; background: #f00"></div> To my left is a red box<br> Now there is just text<br> Text that goes on for a few pixels <br> or even

How to use CSS (and JavaScript?) to create a blurred, “frosted” background?

强颜欢笑 提交于 2019-12-27 11:02:07
问题 I'm trying to create an iOS 7 style frosted look with HTML5, CSS3 and JavaScript which can work on webkit browsers. Technically, given the following HTML: <style> #partial-overlay { width: 100%; height: 20px; background: rgba(255, 255, 255, .2); /* TODO frost */ position: fixed; top: 0; left: 0; } </style> <div id="main-view"> <div style="width: 50px; height: 50px; background: #f00"></div> To my left is a red box<br> Now there is just text<br> Text that goes on for a few pixels <br> or even

Is there any “font smoothing” in Google Chrome?

六月ゝ 毕业季﹏ 提交于 2019-12-27 10:29:09
问题 I'm using google webfonts and they fine at super large font sizes, but at 18px, they look awful. I've read here and there that there are solutions for font smoothing, but I haven't found any where that explains it clearly and the few snippets I have found don't work at all. My h4 looks awful in pretty much every browser, but Chrome is the worst. In Chrome, pretty much all of my fonts look terrible. Can anyone point me in the right direction? Perhaps you know of a resource that explains this

Aligning grid items across the entire row/column (like flex items can)

北慕城南 提交于 2019-12-27 09:00:11
问题 With a flex container and flex-wrap: wrap set you can align overflowing items to the center using justify-content: center . Is there a way to achieve the same behaviour for overflowing grid items using CSS grid? I've created a pen showing the desired flex behavior .container-flex { display: flex; flex-wrap: wrap; justify-content: center; } .container-flex .item { width: 33.33%; background: green; border: 1px solid; } .container-grid { display: grid; grid-template-columns: repeat(3, 1fr); }

How to select a range of elements in repeated pattern

守給你的承諾、 提交于 2019-12-27 08:59:12
问题 Let's say there are 12 items in 4 rows. | 1 || 2 || 3 | | 4 || 5 || 6 | | 7 || 8 || 9 | | 10 || 11 || 12 | I want to select and style 2nd row and 4th row, How do I do that? Note that rows are not in different HTML elements, in fact they are all an ul li element. Desired Result: | 1 || 2 || 3 | |--4---||--5---||--6---| | 7 || 8 || 9 | |--10--||--11--||--12--| I have tried playing with this: li:nth-child(n+4) It selects all the elements after first three. Then I tried this: li:nth-child(n+4)

How to select a range of elements in repeated pattern

余生长醉 提交于 2019-12-27 08:58:44
问题 Let's say there are 12 items in 4 rows. | 1 || 2 || 3 | | 4 || 5 || 6 | | 7 || 8 || 9 | | 10 || 11 || 12 | I want to select and style 2nd row and 4th row, How do I do that? Note that rows are not in different HTML elements, in fact they are all an ul li element. Desired Result: | 1 || 2 || 3 | |--4---||--5---||--6---| | 7 || 8 || 9 | |--10--||--11--||--12--| I have tried playing with this: li:nth-child(n+4) It selects all the elements after first three. Then I tried this: li:nth-child(n+4)

CSS3 selector :first-of-type with class name?

懵懂的女人 提交于 2019-12-27 08:19:57
问题 Is it possible to use the CSS3 selector :first-of-type to select the first element with a given class name? I haven't been successful with my test so I'm thinking it's not? The Code (http://jsfiddle.net/YWY4L/): p:first-of-type {color:blue} p.myclass1:first-of-type {color:red} .myclass2:first-of-type {color:green} <div> <div>This text should appear as normal</div> <p>This text should be blue.</p> <p class="myclass1">This text should appear red.</p> <p class="myclass2">This text should appear