Text wrapping around a div

You just need to work with float property. HTML: CSS: Play with this on jsFiddle. Update With pure CSS, the most that you will get is manually spacing the sides of image with absolute positioning. The HTML: The CSS: Play with this on jsFiddle. More information You can find more information in this topic, on … Read more

Create a simple 10 second countdown

JavaScript has built in to it a function called setInterval, which takes two arguments – a function, callback and an integer, timeout. When called, setInterval will call the function you give it every timeout milliseconds. For example, if you wanted to make an alert window every 500 milliseconds, you could do something like this. However, … Read more

jQuery sort elements using data id

I have an HTML structure as follows: I would like to sort them as: I am using the following function: It is not working as expected. It is working well for the first run but after adding new element or changing the data-sid attributes it no longer works. Demo: http://jsfiddle.net/f5mC9/1/ Not working?

anchor jumping by using javascript

You can get the coordinate of the target element and set the scroll position to it. But this is so complicated. Here is a lazier way to do that: This uses replaceState to manipulate the url. If you also want support for IE, then you will have to do it the complicated way: Demo: http://jsfiddle.net/DerekL/rEpPA/Another … Read more

SVG drop shadow using css3

Here’s an example of applying dropshadow to some svg using the ‘filter’ property. If you want to control the opacity of the dropshadow have a look at this example. The slope attribute controls how much opacity to give to the dropshadow. Relevant bits from the example: Box-shadow is defined to work on CSS boxes (read: … Read more

Add stroke around text – on the outside – with css?

The -webkit-text-stroke doesn’t support placing the stroke on the outside of the text as this CSS-Tricks atricle explains: The stroke drawn by text-stroke is aligned to the center of the text shape (as is the default in Adobe Illustrator), and there is currently no option to set the alignment to the inside or outside of … Read more