CSS scale from left top

I was able to “solve” my problem. This is what I tried: In the CSS shown in the question, I changed html to body: body { zoom: 1.4; /* Old IE only */ -moz-transform: scale(1.4); -webkit-transform: scale(1.4); transform: scale(1.4); transform-origin: top center; margin-top: 5px; } I changed transform-origin: top left to transform-origin: top center. I … Read more

CSS: make div width proportional to height

I’ve been wondering about a pure-css solution to this problem for a while. I finally came up with a solution using ems, which can be progressively enhanced using vws: See codepen link for full working demo and explanation: Simplified version: .parent { font-size: 250px; // height of container height: 1em; } .child { height: 100%; … Read more

Matplotlib axis with two scales shared origin

use the align_yaxis() function: import numpy as np import matplotlib.pyplot as plt def align_yaxis(ax1, v1, ax2, v2): “””adjust ax2 ylimit so that v2 in ax2 is aligned to v1 in ax1″”” _, y1 = ax1.transData.transform((0, v1)) _, y2 = ax2.transData.transform((0, v2)) inv = ax2.transData.inverted() _, dy = inv.transform((0, 0)) – inv.transform((0, y1-y2)) miny, maxy = … Read more

CSS image scaling to fit within area not distort

You should try using this: img{ width: auto; max-width: 150px; height: auto; max-height: 100px; } Edit: Looks like IE6 doesn’t support max-width and max-height properties. However, you can implement the workaround given here: max-width, max-height for IE6 Excerpt (in case linked article stops working): img { max-height: 100px; max-width: 100px; width: expression(document.body.clientWidth > 150? “150px”: … Read more

tech