css

How to position a div with css based on the order of this div in a list of divs?

烂漫一生 提交于 2021-02-11 07:57:23
问题 Okay, I want to position overlapping elements based on the order they appear in a list. So the first will not be translated, the second will be translated 60px, the third 120px, etc... This is just a simplified version of what I achieve. Also, in the example there are three elements, in real life I won't know how many elements there will be. This is variable. Below is a simple snippet that can achieve what I want, but you can easily see the problem with this: way to many lines of css... So

How to set background image in div-element in Angular Material app?

若如初见. 提交于 2021-02-11 07:43:57
问题 I know this has been asked, but none of the solutions work. I have following html and I can get the image displayed if I use the commented img-element <img src="assets/utgmap.jpg"> and comment away the following div-element. However I would like to have background image for the div instead and it's not working. CSS definition is in the end of the file and there's no 404 error for the image so it can be fetched but is is not displayed. HTML: <mat-sidenav-container class="sidenav-container">

Removing white space bootstrap

六月ゝ 毕业季﹏ 提交于 2021-02-11 07:41:51
问题 I am trying to remove the white space that is between my tiles like the picture below: This is what I currently have : Here is the mark up for the second picture which is currently what I have in place : CSS .mainbody-section { padding-top: 30px; padding-bottom: 30px; } /* Overlay text */ .module { background-color: lightgray; background-attachment: fixed; /*width: 400px;*/ height: 300px; position: relative; overflow: hidden; margin: 20px; } .module > header { position: absolute; bottom: 0;

CSS Transition item in and out of flexbox smooth animation

隐身守侯 提交于 2021-02-11 07:41:16
问题 I'm building basic navigation for a website, and the graphical/animated functionality that I would like is this: 1: When in the 'HOME' state, the site logo/icon is large and centered and above the rest of the navigation/page links. 2: When on any other page than home, the logo/icon is smaller, and sits proportionally in a horizontal flexbox with the other elements. 3: There is a smooth transition between these two states. I've implemented this already as you can see below, but the transition

Removing white space bootstrap

别等时光非礼了梦想. 提交于 2021-02-11 07:41:01
问题 I am trying to remove the white space that is between my tiles like the picture below: This is what I currently have : Here is the mark up for the second picture which is currently what I have in place : CSS .mainbody-section { padding-top: 30px; padding-bottom: 30px; } /* Overlay text */ .module { background-color: lightgray; background-attachment: fixed; /*width: 400px;*/ height: 300px; position: relative; overflow: hidden; margin: 20px; } .module > header { position: absolute; bottom: 0;

CSS slideshow with fade in/out delay

情到浓时终转凉″ 提交于 2021-02-11 07:37:22
问题 I made an CSS slideshow with 3 images animated by keyframes that makes a fade in/out effect. So far, so well. But there's a problem with the animation on the second loop of the slideshow. Im going to explain my best: the first loop animation works perfectly, but once the first image come back again there's a fade to white on all the slides that I like to avoid. I don't understand why the first loop works perfectly and then the other loops have this fade to white issue. You can see this

Adding autofocus attribute when input is hovered

北城余情 提交于 2021-02-11 07:37:16
问题 I'm trying to add autofocus to an input form when it's hovered. Using the .appentTo attribute but open to other solutions. Here's what I have: <input value=""/> $(document).ready(function(){ $("input").hover(function(){ $("autofocus").appendTo("input"); }); }); Fiddle: https://jsfiddle.net/t7yj3b4n/1/ 回答1: To focus an element use focus() method. Here you try to add the attribute autofocus with a bad method (take a look at Zakaria's answer) to all input. Use $(this) for target the hovered

Adding autofocus attribute when input is hovered

拜拜、爱过 提交于 2021-02-11 07:36:36
问题 I'm trying to add autofocus to an input form when it's hovered. Using the .appentTo attribute but open to other solutions. Here's what I have: <input value=""/> $(document).ready(function(){ $("input").hover(function(){ $("autofocus").appendTo("input"); }); }); Fiddle: https://jsfiddle.net/t7yj3b4n/1/ 回答1: To focus an element use focus() method. Here you try to add the attribute autofocus with a bad method (take a look at Zakaria's answer) to all input. Use $(this) for target the hovered

CSS Transition item in and out of flexbox smooth animation

怎甘沉沦 提交于 2021-02-11 07:34:36
问题 I'm building basic navigation for a website, and the graphical/animated functionality that I would like is this: 1: When in the 'HOME' state, the site logo/icon is large and centered and above the rest of the navigation/page links. 2: When on any other page than home, the logo/icon is smaller, and sits proportionally in a horizontal flexbox with the other elements. 3: There is a smooth transition between these two states. I've implemented this already as you can see below, but the transition

CSS slideshow with fade in/out delay

时光毁灭记忆、已成空白 提交于 2021-02-11 07:32:57
问题 I made an CSS slideshow with 3 images animated by keyframes that makes a fade in/out effect. So far, so well. But there's a problem with the animation on the second loop of the slideshow. Im going to explain my best: the first loop animation works perfectly, but once the first image come back again there's a fade to white on all the slides that I like to avoid. I don't understand why the first loop works perfectly and then the other loops have this fade to white issue. You can see this