What is the difference between em and rem units?

Both em and rem units are based on the font-size CSS property. The only difference is where they inherit their values from. em units inherit their value from the font-size of the parent element rem units inherit their value from the font-size of the root element (html) In most browsers, the font-size of the Continue reading What is the difference between em and rem units?

What are the advantages of using CSS sprites and how are they utilized?

CSS sprites combine multiple images into one image, limiting the number of HTTP requests a browser has to make, thus improving load times. Even under the new HTTP/2 protocol, this remains true. Under HTTP/1.1, at most one request is allowed Continue reading What are the advantages of using CSS sprites and how are they utilized?

Eloquent ORM – Increments and Decrements

Eloquent ORM seems like a simple mechanism, but under the hood, there’s a lot of semi-hidden functions and less-known ways to achieve more with it. First example :: Increments and Decrements Instead of this: $article = Article::find($article_id);
$article->read_count++;
$article->save();
 You can do Continue reading Eloquent ORM – Increments and Decrements

What are defer and async attributes on a Script tag?

If neither attribute is present, the script is downloaded and executed synchronously, and will halt parsing of the document until it has finished executing (default behavior). Scripts are downloaded and executed in the order they are encountered. The defer attribute downloads the Continue reading What are defer and async attributes on a Script tag?

What does ‘use strict’ do and what are some of the key benefits to using it?

Including ‘use strict’ at the beginning of your JavaScript source file enables strict mode, which enforces more strict parsing and error handling of JavaScript code. It is considered a good practice and offers a lot of benefits, such as: Easier debugging due Continue reading What does ‘use strict’ do and what are some of the key benefits to using it?