Web Dev
Loop through all elements of a class
Looping through all elements of a class (.element-class) — and in the example below, restricting this so that it only hits elements within a container element. So if we have a div with an id of ‘container-div’, which has 6 divs with classes named ‘element-class’, this will loop through each and do whatever we want […]
Read MoreSetting the Default Fill and Strok Style in Inkscape
For the longest time, I would just adjust the fill and stroke styles after drawing something with the pen tool, which certainly wasn’t ideal. Sometimes I couldn’t see the effect that I was going for, so I would change the styles right after drawing each shape. How moronic — especially since it\’s super easy to […]
Read MoreVertical Center an Image Within a Link (or Div)
How to vertically center an image within a div: <style> .valign-helper{ display: inline-block; height: 90px; } a img{ display: inline-block; vertical-align: middle; } </style> <a title=”my title” href=”#”> <span class=”valign-helper”></span> <img src=”image-path” /> </a>
Read MoreGet the Next Element of a Class with jQuery
I\’ve been looking for a good way of finding the next element with a given class name. For example, given a user clicking on the link of \’click here 1\’, I would love to be able to target the next div that has a div class of \’result-here\’. Note, I don\’t want jQuery to return […]
Read MoreCreating Radial Arrays in Inkscape
Radial Array in Inkscape: 1. Create a Shape 2. Click on the shape, and then click on it again to bring up the ‘rotational handles’ 3. Drag the + sign, currently in the middle of the shape to the center point of the circle that you would like to rotate the shape around. 4. Go […]
Read MoreSetting up SASS with Ruby and Compass on Your Computer
I don’t know if I just didn’t do enough digging, but the process for setting up SASS using Ruby took several sources online and some trial and error to really get things running. I did attempt to go with the simple method of just using one of the precompiling apps (prepros), but it seems like […]
Read Morewhy is 100% width body or div wider than the screen on mobile?
I’d been struggling with this one for quite a bit. I figured it was something stupid, but no matter what I did, whenever I set the width of my body, html, and/or div tag to 100% (I’d totally stripped down my testing page to the simplest of elements to see why it wasn’t working), the […]
Read MoreAn updated 2 Column (Fluid Fixed) Layout
An alternate method for 2 columns, with a fixed column on the right and fluid on the left. The main goal here was to be able to have the secondary column (\’.col-right\’) appear above the main column (\’.col-main’) when the screen width was decreased. This wan\’t possible with the other method for achieving the column […]
Read MoreNamespacing in Javascript
So the other night I was working on some fancy script. It didn’t work. After a bit of investigation, it turns out that one of the function names was already being used by a different function. Bummer. Of course this is why people use namespacing, to avoid problems such as this. So, here’s how to […]
Read MoreIncluding Border and Padding In Box Dimensions
Generally when I’m assigning a width or height to a div, I want it to be that width or height. Yet some genius, whoever came up with the CSS box model, decided that the width of the box wouldn’t actually include the padding or border as part of the width. Fortunately, we can now include […]
Read More