Responsive Images Made Easy with ResponsifyJS

The modern web should be 100% responsive and newer libraries are making this increasingly possible.

With free plugins, such as ResponsifyJS, it’s even easier to get your websites working on all devices. This free jQuery plugin takes a container of images and dynamically rearranges them based on varying screen sizes.

How To Use HTML5 <picture> Element To Achieve Responsive Image

.no-js #ref-block-post-21610 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/html5-picture.jpg&#8221;); }

How To Use HTML5 <picture> Element To Achieve Responsive Image

Responsive Design may be here to stay but there are many issues that need to be addressed when…Read more

Since different containers hold images differently, they can resize in very strange ways. Sometimes, you’ll have photos of people and their faces can get cut off when resized on mobile.

The Responsify plugin was created to solve this exact problem. It can work automatically but the true magic lies in defining your own focus area on the picture.

It uses an internal system of decimal descriptions to find where the focus of the image should be. For example, you can define positions such as data-focus-top which “blocks in” a certain segment of the image.

This data needs to be passed in the form of decimals, for instance a .5 decimal targets 50% of the image (left/right or top/bottom). Naturally, this is pretty confusing to do by yourself. But, there’s a free Responsify app that lets you calculate the positions dynamically in your browser.

Just upload a picture, define the focus area, then copy/paste the image code into your website. The Responsify plugin will have all the data it needs to properly resize the image on smaller screens.

Responsify appResponsify app

You can find quite a few live demo links in the GitHub repo, including code snippets to copy/paste into your site.

This plugin is not the perfect solution for every project. Sometimes, you’ll want images to resize without fixed focus areas. But, if you’re using masonry grids with jQuery it doesn’t hurt to add ResponsifyJS to your stack.

To learn more, visit the plugin homepage for a live demo, a download link, and a full setup guide.

Source: http://www.hongkiat.com/blog/build-responsive-images-responsifyjs/

Generate Social Meta Tags Easily with This App

The largest social media sites have practically taken over the world, with Facebook currently pushing towards 2 billion users worldwide.

One of their many advancements in technology is the Open Graph or OG protocol. These OG tags have become the norm on other social networks such as Pinterest and LinkedIn, so having them on your site can be tremendously beneficial.

And now, with the Mega Tags web app, the entire process can be automated, without writing a single line of code.

Mega Tags web appMega Tags web app

By default, there are two different “types” of social meta tags: Open Graph covers most networks but Twitter has their own called Twitter Cards.

These extra tags share information with social networks, so you can customize how your links appear when shared on these sites.

Networks, such as Facebook, have their own algorithms for pulling a page’s title, description, and thumbnail. This is useful when people share links on FB and other social networks.

With these meta tags in your header, you can tell Facebook, Pinterest, Google+, and others exactly how to display your content.

Some websites might even have a Facebook page which can be included in the Open Graph content. This offers even more control where Facebook can pick & choose which data they want to present.

This free web app can do it all for you by default. Just enter your page URL, the title/description, and include a thumbnail image if needed. You might also dig into the optional settings if you want.

Meta OG code generatorMeta OG code generator

From there, you can copy/paste the meta tags into your header and voila! A fully compatible Open Graph page ready for sharing.

The site even has validators with which you can check to make sure your page is being validated properly on all your chosen networks.

And, you have access to a full reference page with a table of all OG properties and expected values. Some of these properties may change over time or new features may be added to the Open Graph protocol.

But, so many sites already use these features, so you’d be crazy not to! To get started, just visit the web app, add your site info, and copy/paste the code into your page header. You’ll notice an immediate difference whenever people share your links on social sites around the web.

Source: http://www.hongkiat.com/blog/generate-social-meta-tags/

Get the Firefox Focus Experience Now on Android Smartphones

Remember Firefox Focus, Mozilla’s privacy-based web browser? Well, it has finally made the jump over to the Android operating system after making its debut on iOS devices.

Firefox 54 Could Very Well be Mozilla’s Best Browser

.no-js #ref-block-post-30471 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/mozilla-firefox-54-updates.jpg&#8221;); }

Firefox 54 Could Very Well be Mozilla’s Best Browser

There was a time when Mozilla’s Firefox browser was the browser of choice for those who refused to…Read more

For the most part, the Firefox Focus experience on Android is very much the same as the one that can be found on iOS devices. Firefox Focus for Android retains all of the features that makes the browser a great alternative such as the ability to block ads, analytics and social trackers.

settingssettings

Also, in the Android version of Firefox Focus is the ability to disable the custom web fonts on a website to make web browsing even faster, as well as an Erase button that lets you wipe your browser clean on-demand.

Unfortunately, some of the browser’s demerits are also present on the Android version as Firefox Focus has yet to implement a tab browsing.

disable custom webdisable custom web

While the Firefox Focus experience is largely the same as the iOS version, the Android version of the browser did receive some new tricks. Android users are given the option to set Firefox Focus as their main browser, a feature that isn’t available to iOS users.

In addition, Firefox Focus for Android now comes with a reminder notification that lets its users erase their browsing history without even needing to be on the browser.

erase browsing historyerase browsing history
10 Firefox Plugins For A Safer Browsing Experience

.no-js #ref-block-post-15177 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/firefox-security-plugins.jpg&#8221;); }

10 Firefox Plugins For A Safer Browsing Experience

Mozilla’s Firefox browser is a user-friendly and feature-rich browser, with around 35% of all web users using it…Read more

Source: http://www.hongkiat.com/blog/firefox-focus-android-smartphones/

Search Emojis in Gboard Using Doodles

Gboard for Android users will no longer need to scroll through the entire emoji library to find that specific one they need as an update Google has enabled the keyboard to make emoji search a lot easier.

Gboard now comes with Google’s search app for iOS

.no-js #ref-block-post-28862 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/gboard-search-app-ios.jpg&#8221;); }

Gboard now comes with Google’s search app for iOS

Gboard has been available for iOS devices since August as a third-party app, giving iOS users access to…Read more

So how did Google improve upon the emoji search? By using the power of doodles! Now, when you access Gboard’s emoji tab, you’ll be able to see a handwriting icon located inside the emoji search box.

type a messagetype a message

Tapping on it will open up a blank space in which you’ll be able to draw an image of the emoji you’re looking for. As you doodle on the space, Gboard will publish a list of emojis that may fit the image that you’re currently doodling. Once the emoji you want appears, all you need to do is tap on it to add it to your message.

doodledoodle

Doodle-powered emoji search aside, Gboard for Android has also received improvements in other areas as well. For those who frequently text messages to others, Google has implemented a feature called phrase suggestions to Gboard.

Powered by machine learning, this system will allow Gboard to suggest phrases that would connect naturally with the sentence that is currently being constructed.

suggest phrasesuggest phrase

Finally, Google has made the keyboard’s search functionality a lot more useful as it can now showcase multiple results. In addition to that, Gboard can now launch the necessary app or service depending on the search result that you’ve selected. For example, if you were to select a YouTube video, Gboard would automatically boot up the YouTube app.

keyboard search functionkeyboard search function
10 Alternative Android Keyboard Apps

.no-js #ref-block-post-18364 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/android-keyboard-apps.jpg&#8221;); }

10 Alternative Android Keyboard Apps

For most users, their device’s built-in keyboard app is good enough but aside from autocorrection, stock keyboards have…Read more

Source: http://www.hongkiat.com/blog/gboard-search-emoji-doodles-android/

5 HTML Features You Might Not Know About

For a language so simple and easy to learn, HTML surely offers an unexpected amount of useful features, many of which most of us don’t even know about. It’s hard to keep up with times and you may think that all “you might not know” articles must be about the most recent tags, HTML also has some quite helpful features that are already around for a while.

From checking spelling to adding keyboard shortcuts, in this article, I’ll show you five less-widely known HTML features.

10 New Features of HTML 5.1 & How to Use Them IRL

.no-js #ref-block-post-28751 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/html-5-1-new-features.jpg&#8221;); }

10 New Features of HTML 5.1 & How to Use Them IRL

The HTML specification got a major overhaul a couple of weeks ago when W3C published its new HTML…Read more

1. Check spelling as you type

The spellcheck attribute prompts browsers to check spellings while a user is typing an element. This attribute is global, meaning, you can add it to any HTML tag.

However, it only works on elements that can take text input. Having it global is useful because it can be inherited by child elements. For instance, add it to a <div> tag and all of its child elements that take text input will inherit this attribute.

Spell checking works on all text <input> types: text, search, url, and email. It also works on <textarea>, and editable elements (elements with contenteditable attribute).

Its value can be an empty string, true, or false. The empty string and true will enable the spell checker.

<input type="text" spellcheck="true"
placeholder="Type something here">
<p contenteditable="true" spellcheck="true">
  Type something here
</p>

In the above code, both the <div> and <p> tags will check spellings when a user is typing into them.

If the user has disabled spell checking in the browser settings the spelling won’t be checked, even if spellcheck was added.

2. Be safe from compromised CDN resources

It is pretty common to host resources, such as scripts and stylesheet files, through CDNs. But, if the CDN gets compromised, so do those hosted files, and if any fetched resource is compromised on your website, so does your site!

See what Mozilla Developer Network says about the problem:

… using CDNs also comes with a risk, in that if an attacker gains control of a CDN, the attacker can inject arbitrary malicious content into files on the CDN (or replace the files completely) and thus can also potentially attack all sites that fetch files from that CDN.

To prevent this, Subresource Integrity (SRI) was introduced in early 2014 by W3C. This scheme compares the hash value (the result of applying a hash function to an input) of a resource to validate it.

Say, there’s a JavaScript file at https://example.com/example.js. First, you apply a hash function to that file, then add the produced hash value to the integrity attribute of the <script> tag that imports example.js to your website.

<script src="https://example.com/example.js"
integrity="sha384-Li9vy3DqF8tnTXuiaAJuML3ky+er10rcgNR/VqsVpcw+ThHmYcwiB1pbOxEbzJr7"
crossorigin="anonymous"></script>

Now, whenever a web page of your site with the above code has to load example.js, the browser first applies the hash function, and loads and runs example.js only when its hash value matches the integrity value.

If example.com was compromised and example.js was interfered with then the hash value of example.js won’t match the integrity value.

Most common CDNs already provide SRI integrity values, but you can also generate one here.

3. Override form targets in submit buttons

You’re most likely familiar with the target attribute, the one that decides where a hyperlinked resource opens, for instance on the same page or in a new tab. You might also know that the same target attribute used in the <form> tag decides where the response from the form submission is shown.

In one of the early drafts of HTML5, formtarget was defined along with four other form submission attributes: formaction, formenctype, formmethod, and formnovalidate.

These attributes can be used with submit buttons, and they override their respective attributes in the <form> tag to which the buttons belong to.

So, when a form is submitted using a button that has a formtarget attribute, the response is shown according to the formtarget value, instead of the target value of <form>.

<form action="/save" target="_self" >
  <input type="submit" name="save"  />
  <input type="submit" name="print" formaction="/print"
  formtarget="_blank" />
</form>

In the above code, when the form is submitted using the second submit button (print ), the response will appear in a new browsing context, like in a new tab.

4. Hide elements semantically

When it comes to hiding elements, we all went through different phases of hiding elements: using opacity:0, visibility:hidden, height:0; width:0, display:none, text-indent:-999px in our CSS file.

Each method has its purpose, none of them are redundant, and so isn’t this one: the hidden HTML attribute. If an element has hidden specified on it, it’ll be hidden.

<div hidden>...</div>

It works the same way as the display:none; CSS rule; the element with the hidden attribute doesn’t get rendered on the page. Any script inside the element will be executed, and if it’s a form control it’ll be submitted along with other form controls during form submission.

However, the benefit of hidden is that it’s semantically appropriate, after all, HTML5 is all about semantics and hidden is part of the HTML5 entourage!

Moreover, when an element is hidden, it’s to be hidden in all platforms, not just in web browsers but in screenreaders, TV, projectors, etc.

It’s also not style-dependent, even if you strip away the author CSS from a page, the element will remain hidden. Whereas in the case of display:none; that won’t happen. So, think of hidden as the ironclad version of display:none;.

5. Add keyboard shortcuts

The accesskey global attribute was already defined in HTML4 and it creates a keyboard shortcut with which the user can operate an element on the page.

The key combination for a shortcut will depend on two things:

  1. the accesskey value that we give to an element
  2. the pre-assigned keys used by a browser for the same element
Accesskey tableAccesskey table
IMAGE: Mozilla Developer Network

Take this example:

<button accesskey="v" onclick="alert('View Click')">
  View
</button>

In Firefox, if you press the key combination Alt + Shift + V (or Alt + Control + V in macOS) you’ll get the alert “View Clicked”.

Since the predefined browser keys varies with each browser and OS, it is recommended you let the users know of the key combinations used for the shortcuts.

10 Cool Things HTML Tags Can Do

.no-js #ref-block-post-23967 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/cool-useful-html-tags.jpg&#8221;); }

10 Cool Things HTML Tags Can Do

At the moment there are a total of 142 HTML elements standardized by W3C excluding the ones in…Read more

Source: http://www.hongkiat.com/blog/new-html-features/

Run & Share Snippets With Glot.io

There are dozens of browser-based IDEs but most of them focus on frontend languages: HTML, CSS, and JavaScript.

Glot.io is a new contender, focusing on dozens of programming languages that usually require runtime software. These languages go far beyond the web, including C#, Java, Swift, Haskell and a whole lot more.

Glot is a coder’s web-based paradise and it works like an open-source playground with executable code. Granted, there are some limitations on what you can run, especially with GUI programs and 3rd party libraries. But, you can save pretty much anything in this site and share it with the whole world. For free!

Cloud IDEs For Web Developers – Best Of

.no-js #ref-block-post-15223 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/cloud-ide-developers.jpg&#8221;); }

Cloud IDEs For Web Developers – Best Of

With so much of the traditional, desktop-based productivity software we know and love moving to the Cloud, it’s…Read more

If you’re looking for sample snippets you can browse the Glot snippets page with whatever language you prefer. For instance, if you’re building an iOS app you can search snippets by Swift code to see what’s out there.

Most snippets are pretty old and they’re all very simple. However, Glot isn’t just a free code library. You can also use it to test new ideas by writing code and testing it on the fly without a compiler. No other web app offers this kind of functionality with so many languages for free.

Glot.io snippetsGlot.io snippets

So, who would get the most value from using Glot?

Newer coders might find some gems in the snippet archives but, truthfully, there aren’t many archives to sift through. I think Glot is most useful to practicing coders who want an online environment for testing their ideas.

It can be tough when you’re starting to learn Python or C# or any detailed programming language. These online code environments let you practice from any computer with Internet access, no software required.

The site’s code and many tools are also freely available on GitHub. You can find them all listed in this index repo linking to all the Glot.io open-source projects.

Glot.io is a really cool web app and quite valuable to newer developers. If you’re looking for a cheap way to hone your programming skills Glot offers everything you need to get started.

Why All Developers Should Learn Command Line

.no-js #ref-block-post-25480 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/developers-command-line.jpg&#8221;); }

Why All Developers Should Learn Command Line

Some developers cringe at the mere thought of opening a terminal window. For the uninitiated it can be…Read more

Source: http://www.hongkiat.com/blog/glotio-open-source-pastebin/

Facebook now lets you Co-edit Your Albums with Friends

Are you the type of person who likes to keep track of their activities over the course of a trip? If so, Facebook’s latest update to its Albums feature will make it so much easier to keep a log of your tours or trips as it now lets you store photos, posts and more in it.

How to View Facebook Photos, Pinterest Style [Quicktip]

.no-js #ref-block-post-13333 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/view-facebook-photos-pinterest-style.jpg&#8221;); }

How to View Facebook Photos, Pinterest Style [Quicktip]

Imagine if you can categorize your Facebook feed to have a photo-only section, and change the display setting…Read more

Add videos, check-ins & posts

Available on both the desktop and Android version of Facebook, with iOS support coming soon, the new Albums feature now lets you add videos, check-ins and text posts into the album, alongside the usual photos of course.

sample albumsample album
Co-edit albums with friends

In the event that you would like your friends to edit the album with you, Facebook has also made it easier by enabling your friends to collaborate with you on an album.

create albumcreate album

Simply toggle “Add Contributors” option on, tap on the “Choose Friends” option, and select the people that you want to be collaborating with you. Once that’s done, your selected friends will be granted permission to modify the album.

edit contributorsedit contributors
Featured Albums

To make your album standout even more, Facebook has also introduced a “Featured Albums” tab on your Facebook page. Much like the Featured Photos option, the Featured Albums tab lets you place a number of your available albums directly to your main Facebook page, making it easier for friends to view it.

featuring albumfeaturing album
Follow a friend’s album

Finally, Facebook has also added an option that allows you to follow a friend’s album, making it easier to keep track of your friend’s activities. All updates that are posted in the followed album will appear on your News Feed, much like a regular Facebook post.

How To Create Cool Puzzle-view Facebook Photo Album

.no-js #ref-block-post-13864 .ref-block__thumbnail { background-image: url(“http://media02.hongkiat.com/thumbs/250×160/puzzle-view-facebook-photo-album.jpg&#8221;); }

How To Create Cool Puzzle-view Facebook Photo Album

Have you ever wondered if you can populate your Facebook photo album with a combination of photos that…Read more

Source: http://www.hongkiat.com/blog/facebook-photo-albums-new-features/