How do I vertically align text in a div?

The correct way to do this in modern browsers is to use Flexbox. See this answer for details. See below for some older ways that work in older browsers. Vertical Centering in CSShttp://www.jakpsatweb.cz/css/css-vertical-center-solution.html Article summary: For a CSS 2 browser, one can use display:table/display:table-cell to center content. A sample is also available at JSFiddle: Expand snippet … Read more

What is a clearfix?

If you don’t need to support IE9 or lower, you can use flexbox freely, and don’t need to use floated layouts. It’s worth noting that today, the use of floated elements for layout is getting more and more discouraged with the use of better alternatives. display: inline-block – Better Flexbox – Best (but limited browser … Read more

What’s the difference between HTML ‘hidden’ and ‘aria-hidden’ attributes?

ARIA (Accessible Rich Internet Applications) defines a way to make Web content and Web applications more accessible to people with disabilities. The hidden attribute is new in HTML5 and tells browsers not to display the element. The aria-hidden property tells screen-readers if they should ignore the element. Have a look at the w3 docs for … Read more

Customize icon for “Add to home screen”

I want to specify the icon that shows in the home screen. How can i do that? You can use <link rel=”apple-touch-icon” sizes=”128×128″ href=”niceicon.png”> (yes, even for Android device). Please check iOS document for detail information on Apple devices. Please note you can even define icon for the entire website. Please check Android document for … Read more