css3

How to triangle top and bottom border?

时间秒杀一切 提交于 2019-12-31 01:49:08
问题 As you can see in the image below, I am trying to warp or triangle my div from bottom and top, but I have no idea how to do it. I just tried a couple of times to do it, but I couldn't achieve the result. So how can I make it using after,before psuedo? It doesn't matter make with psuedo, but I wonder that how to do it? Here is my code: body{ background:lightblue;; } .block{ background-image: linear-gradient(to right, #314b56, #283b44, #1f2c32, #161e21, #0a0f11); border: 1px solid #fff; width:

Width of widest element sets width of all siblings in the row

瘦欲@ 提交于 2019-12-31 01:49:07
问题 I've read a lot of tutorials about CSS flex boxes and CSS grids, but frankly I just can't figure out how to do this simple(?) thing. All I want is for the elements in a container to all be as wide as the widest element. I don't want them to fill up the whole width of the container, just all grow to the maximum width. Can that be done with CSS? Consider this HTML: <div class="container"> <button>a normal button</button> <button>tiny</button> <button>a really, really, really wide button</button

How can I create Triangle shape clip mask using CSS

筅森魡賤 提交于 2019-12-31 01:44:30
问题 I want to create triangle as shown in image. Does someone know how to achieve the effect? 回答1: Here is a fiddle that should solve your problem. I used :before and :after on a container to place two squares over the container with borders to create the arrows. You can mess with the border colors and widths to get the arrows how you want them (just remember the inside borders have to be the same weight to make an symmetrical triangle). http://jsfiddle.net/Smzmn/ .hero { background: url(http://d

How to use CSS combination of mix-blend-mode and isolation?

岁酱吖の 提交于 2019-12-31 01:43:27
问题 I have a parent element with a red background. I want an h2 element to blend just some words with the background, and other words, inside a span tag, no. My example below is not working. How to make it work? .bg-red { background: red; } .blend { mix-blend-mode: difference; color: white; } .isolate { isolation: isolate; } <div class="bg-red"> <div class="blend"> <h2>This text should <span class="isolate">(This one shouldn't)</span> be blended </h2> </div> </div> View on JSFiddle 回答1: In order

Fitting child into parent

旧街凉风 提交于 2019-12-31 01:41:28
问题 I have nested flex elements with a text at the bottom. The top element has fixed width that is smaller than text: .list-header { display: flex; width: 150px; height: 80px; background-color: #ececec; } .list-component { display: flex; flex: 1; padding-left: 24px; padding-right: 24px; } .header-container { display: flex; flex: 1; } .header-text { display: flex; flex-direction: column; justify-content: center; overflow: hidden; } span { text-overflow: ellipsis; white-space: nowrap; overflow:

Fitting child into parent

為{幸葍}努か 提交于 2019-12-31 01:41:12
问题 I have nested flex elements with a text at the bottom. The top element has fixed width that is smaller than text: .list-header { display: flex; width: 150px; height: 80px; background-color: #ececec; } .list-component { display: flex; flex: 1; padding-left: 24px; padding-right: 24px; } .header-container { display: flex; flex: 1; } .header-text { display: flex; flex-direction: column; justify-content: center; overflow: hidden; } span { text-overflow: ellipsis; white-space: nowrap; overflow:

infinite loop slider using keyframes css3

落花浮王杯 提交于 2019-12-31 01:10:07
问题 I was making a slider using css3 keyframes. I don't want my last slide directly jump to first slide. I found some questions related to it and found that duplicating the first image trick will work. It works fine first time, but second time the first slide take double time compare to normal time which is obvious because last slide and first slide are same. So is there any way to resolve this issue? Also I found this answer , in this the last solution is too close to answer this question, but

Two css3 columns text with an image in middle

耗尽温柔 提交于 2019-12-31 00:56:07
问题 I'd like to achieve this result there are many tutorial around like this but they work with a fixed text and columns. I print a variable-length text inside my two column layout in this way #cols { column-count: 2; column-gap: 20px; } <div id="box"> <p id="cols"> Lorem Ipsum.... </p> </div> so I can't use a technique like that, how can I put an image in the middle in this scenario? 回答1: Here you are: http://jsfiddle.net/aX47K/ css: .column{ width:300px; float:left; margin-right:20px; } .column

Vertically center <span> text which is beside a much larger <span>, both inside a <div>

做~自己de王妃 提交于 2019-12-31 00:22:51
问题 I am trying to vertically center some text in a <span> element, in relation to a much larger <span> that is a sibling of the first one. Both are children of a containing parent <div> element. HTML: <div> <span class="previewLabel">Preview:</span> <span class="previewText">The quick brown fox jumps over the lazy dog.</span> </div> CSS: .previewLabel { display: inline-block; line-height: 100%; vertical-align: middle; } .previewText { font-family: Verdana, Geneva, sans-serif; font-size: 64px;

Is it possible to create this irregular quadrilateral with CSS?

半世苍凉 提交于 2019-12-30 22:54:53
问题 I've tried the perspective solution here How to transform each side of a shape separately? but can't get it to work probably due to the irregularness of the shape. Only the top and right side columns are slanted, vertical and bottom are straight. How can I do this with CSS? 回答1: Using CSS borders you can create triangles and trapezoids. You can achieve your shape joining a triangle and a trapezoid. .triangle { border: 0 solid red; border-left-width: 500px; border-top-width: 30px; border-top