You can use Cascading Style Sheets (CSS) is to modify the font or typography of the page. There are several ways to describe font sizes.
In the font-size property, you’ll know that there are many different measurements to use when defining the size of the font.
- xx-small through xx-large – relative to the default browser font size
- percentages – relative to the surrounding text
- em and ex – relative to the parent element
- pixels – relative to the screen resolution
- points and picas – print units
- inches, centimeters, and millimeters – length units
Continue reading “CSS Tutorial – Font Sizing”
Web sites reflect the company’s professional image. If your site renders improperly or not at all, your company’s reputation can be tarnished. If your site has browser display problems, visitors and potential customers will leave your site and not look back.
In the post Using Modernizr, Polyfills, YepNope, you learned how you can support browsers that might not have the capabilities that you need. But at some point you may not be able to support really old browsers. At that point, you may just want to recommend the user update. Even for enterprise apps, you will want to remind users to use a current browser rather than have your app fail because your app is expecting something that does not exist.>p>You can use the following code to help your users get up to date browsers. Continue reading “Snippet – What to Do About Old Browsers”
Q is a library that implements the standard and has some extra helpers. Q works in the browser and in node.js.
Q was designed to provide a robust way to provide you ways to write asynchronous code cleanly.
If a function cannot return a value or throw an exception without blocking, it can return a promise instead. A promise is an object that represents the return value or the thrown exception that the function may eventually provide. A promise can also be used as a proxy for a remote object to overcome latency.
You can read the specifications for Q at Promises A+, which aims to clarify “the behavioral clauses of the Promises/A proposal, extending it to cover de facto behaviors and omitting parts that are underspecified or problematic.”
You use deferreds and promises in ways similar to the ways you would use them in jQuery. However, Q has some important features.
Promises are a way that lets us write asynchronous code that is almost as easy to write as if it was synchronous.
You need promises as soon as you do anything that involves an asynchronous API. It also does not take very long before writing promise chains for sequential asynchronous operations becomes second nature.
A Promise is an object that basically represents a process that is or will take place at some point in time, but allows you to register callbacks to it for when the process gets terminated or completed.
Instead of blocking and waiting for the long-running computation to complete, a promise returns an object which represents the promised result.
The value of
this inside a function, effectively depends on the object which called it. The ECMAScript Language Specification says, “The this keyword evaluates to the value of the ThisBinding of the current execution context.”
The use of the “this” keyword inside a function should be familiar to the C++/C# developers among us—it refers to the object through which the method is called ( developers who use Visual Basic should find it familiar, too—it’s called “Me” in Visual Basic).