JavaScript How to center vertically an absolutely positioned scaled element? center vertically absolute div,center vertically absolute positioned element,center

Without scale code works fine, but I need to center vertically an already scaled element. I am looking for solution using CSS or JS approaches. Also I can not use transform-origin CSS property because it's unsupported in some browsers that I need to support...

https://jsfiddle.net/o62ja9r6/17/

.container {
  position: fixed;
  border: 2px dashed blue;
  width: 400px;
  height: 300px;
}

.slide {
  position: absolute;
  width: 76px;
  height: 169px;
  background-color: red;
}

.vertical-center {
  top: 50%;
  transform: scale(0.4) translateY(-50%);
  /* transform: translateY(-50%);  // <--- it works */
}
<div class="container">
  <div class="slide vertical-center">
  </div>
</div>
Answer:1

Order matters, swap translateY with scale.

.container {
  position: fixed;
  border: 2px dashed blue;
  width: 400px;
  height: 300px;
}

.slide {
  position: absolute;
  width: 76px;
  height: 169px;
  background-color: red;
}

.vertical-center {
  position: relative;
  top: 50%;
  transform: translateY(-50%) scale(0.4);
}
<div class="container">
  <div class="slide vertical-center">
  </div>  
</div>
Answer:2

enter code hereI am trying to extract content out of a website for learning purposes. I used YQL for that and it gave me JSON back(https://developer.yahoo.com/yql/). I thought I was making progress ...

enter code hereI am trying to extract content out of a website for learning purposes. I used YQL for that and it gave me JSON back(https://developer.yahoo.com/yql/). I thought I was making progress ...

  1. using nodemon
  2. using nodemailer
  3. using node with react
  4. using node red
  5. using node on windows
  6. using nodemailer with gmail
  7. using node in japanese
  8. using node red with home assistant
  9. using node fs
  10. using node.js to execute scripts
  11. using nodemcu
  12. using node debugger
  13. using nodemon with typescript
  14. using node js with mysql
  15. using node in visual studio code
  16. using node to run javascript
  17. using nodemon in production
  18. using node modules in html
  19. using node fetch
  20. using node modules in browser

is there a way of case-insensitive filter with lodash? I tried this (see below), but this works only partly (when the user input is also lowercase). Another problem is here after one search all the ...

is there a way of case-insensitive filter with lodash? I tried this (see below), but this works only partly (when the user input is also lowercase). Another problem is here after one search all the ...

  1. lodash filter ignore case
  2. lodash filter exclude

I cannot seem to get the imagetools plugin to load with TinyMCE 4.2.5. I have downloaded TinyMCE 4.2.5 and installed it in my root site /tinymce. Here's my code: <script src="~/tinymce/tinymce....

I cannot seem to get the imagetools plugin to load with TinyMCE 4.2.5. I have downloaded TinyMCE 4.2.5 and installed it in my root site /tinymce. Here's my code: <script src="~/tinymce/tinymce....

  1. tinymce image tools
  2. tinymce image tools plugin
  3. tinymce image tools not working
  4. tinymce image tools plugin download

Im using cheerio to do some scraping and want to access the head js element on a page (notably instructables). I can access it but it comes back as function. So using this: console.log($('script')...

Im using cheerio to do some scraping and want to access the head js element on a page (notably instructables). I can access it but it comes back as function. So using this: console.log($('script')...