Popular recipes tagged "css" but not "macro"http://code.activestate.com/recipes/tags/css-macro/2011-11-16T15:23:03-08:00ActiveState Code RecipesAuto Insert CSS Image Width/Height Macro: (JavaScript) 2011-11-16T15:23:03-08:00Skye Giordanohttp://code.activestate.com/recipes/users/4179718/http://code.activestate.com/recipes/577948-auto-insert-css-image-widthheight-macro/ <p style="color: grey"> JavaScript recipe 577948 by <a href="/recipes/users/4179718/">Skye Giordano</a> (<a href="/recipes/tags/css/">css</a>, <a href="/recipes/tags/height/">height</a>, <a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/width/">width</a>). </p> <p>Based on the macro at <a href="http://community.activestate.com/forum/html-editing-img-tag-expansion-etc" rel="nofollow">http://community.activestate.com/forum/html-editing-img-tag-expansion-etc</a> I hacked together this alternate version that will auto insert the width: and height: of an image background in a CSS rule turning this:</p> <p>background: url(http://server.com/myImg.jpg) 0 0 no-repeat;</p> <p>...into this:</p> <p>background: url(http://server.com/myImg.jpg) 0 0 no-repeat; height: 252px; width: 200px;</p> hexadecimal CSS colors, convert the six-digit to the three-digit notation (Bash) 2010-10-02T14:07:23-07:00Romain Dartigueshttp://code.activestate.com/recipes/users/4167472/http://code.activestate.com/recipes/577416-hexadecimal-css-colors-convert-the-six-digit-to-th/ <p style="color: grey"> Bash recipe 577416 by <a href="/recipes/users/4167472/">Romain Dartigues</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/css/">css</a>, <a href="/recipes/tags/regex/">regex</a>, <a href="/recipes/tags/rgb/">rgb</a>, <a href="/recipes/tags/sed/">sed</a>, <a href="/recipes/tags/shortening/">shortening</a>). </p> <p>Want to replace all six-digit RGB notation (#rrggbb) to the short (three-digit #rgb) form? Or the opposite?</p>