CSS lighten child elements on parent mouseover

Like this? Live Demo Relevant CSS: #container:hover .inner { opacity: 0.8 } HTML: <div id=”container”> <div id=”left” class=”inner”></div> <div id=”right” class=”inner”></div> </div> Irrelevant CSS: #container { width: 300px; padding: 30px; overflow: hidden } .inner { width: 40%; height: 250px; background: #ccc } #left { float: left } #right { float: right } Truly Irrelevant CSS: …

Read more

How to create a semi transparent window in WPF that allows mouse events to pass through

I’ve had similar problem and found a solution: public static class WindowsServices { const int WS_EX_TRANSPARENT = 0x00000020; const int GWL_EXSTYLE = (-20); [DllImport(“user32.dll”)] static extern int GetWindowLong(IntPtr hwnd, int index); [DllImport(“user32.dll”)] static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle); public static void SetWindowExTransparent(IntPtr hwnd) { var extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE); SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle …

Read more

How to CREATE a transparent gif (or png) with PIL (python-imaging)

The following script creates a transparent GIF with a red circle drawn in the middle: from PIL import Image, ImageDraw img = Image.new(‘RGBA’, (100, 100), (255, 0, 0, 0)) draw = ImageDraw.Draw(img) draw.ellipse((25, 25, 75, 75), fill=(255, 0, 0)) img.save(‘test.gif’, ‘GIF’, transparency=0) and for PNG format: img.save(‘test.png’, ‘PNG’)

Adjusting Text background transparency

The alpha passed to plt.text() will change the transparency of the text font. To change the background you have to change the alpha using Text.set_bbox(): t = plt.text(0.5, 0.5, ‘text’, transform=ax.transAxes, fontsize=30) t.set_bbox(dict(facecolor=”red”, alpha=0.5, edgecolor=”red”)) #changed first dict arg from “color=”red”” to “facecolor=”red”” to work on python 3.6 To remove the border of the text …

Read more