June 2016

PHP Mail Special Characters in Subject Field

Let’s say you’d like to insert special characters in the subject of HTML e-mails sent with the PHP mail() function. You have an email subject which when extracted from my database looks like this.. Coffee &amp; Laptop Sample code.. $to = ‘me@example.com’; $subject = ‘Coffee &amp; Laptop’; $message = ‘HTML message…’; $headers = ‘MIME-Version: 1.0’ . “\r\n”; $headers .= ‘Content-type: text/html; charset=utf-8’ . “\r\n”; $headers .= ‘From: Me <me@example.com>’ .

CSS Media Queries for Mobile Devices

Writing CSS for different devices can be a pain in the ass. With Media Queries it’s easier, if you know how to pin point a specific device. This can help you pin point a specific mobile device from within your CSS. Copy the code and paste it into you CSS file and get crackin’! /* Smartphones (portrait and landscape) ———– */ @media only screen and (min-device-width : 320px) and (max-device-width

Your Desktop Site Will Look the Same!

I often receive requests from potential customers on making their website ‘mobile friendly’ or ‘mobile responsive. ‘Mobile responsive’ means the webpage reacts to the size of the device its being displayed on. In other words, a mobile responsive web page viewed from a tablet will look differently when viewed from a mobile phone. That’s because the two devices are extremely variant in size, and as a result, your web page

Vertically Align Anything with Just 3 Lines of CSS Code

Have you to vertically align an element and it just won’t work. vertical-align: middle; claims to do the trick but it won’t apply to every situation. .element { position: relative; top: 50%; transform: translateY(-50%); } That’s all you need! It works straight out of the box, even in Internet Explorer 9.