Friday, 12 June 2015

Pseudo-classes

A CSS pseudo-class is a keyword added to selectors that specifies a special state of the element to be selected. For example :hover will apply a style when the user hovers over the element specified by the selector.

Pseudo-classes, together with pseudo-elements, let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on some form elements), or the position of the mouse (like :hover which lets you know if the mouse is over an element or not).

selector:pseudo-class {
  property: value;



Pseudo-classes

:active
:checked
:default
:dir()
:disabled
:empty
:enabled
:first
:first-child
:first-of-type
:fullscreen
:focus
:hover
:indeterminate
:in-range
:invalid
:lang()
:last-child
:last-of-type
:left
:link
:not()
:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type
:optional
:out-of-range
:read-only
:read-write
:required
:right
:root
:scope
:target
:valid

:visited



Friday, 29 May 2015

Ten ways to build a brand for your small business

Branding is just as important for small businesses as it is for big names. Indeed, many corporate brands try to look more like small firms in order to appeal to consumers that prefer to support independent brands. Dan Einzg of agency Mystery explains how to develop your own brand identity

1.   Start by defining your brand.

Review the product or service your business offers, pinpoint the space in the market it occupies and research the emotive and rational needs and concerns of your customers. Your brand character should promote your business, connect with your customer base and differentiate you in the market.

2.   When building your brand, think of it as a person.

Every one of us is an individual whose character is made up of beliefs, values and purposes that define who we are and who we connect with. Our personality determines how we behave in different situations, how we dress and what we say. Of course for people it's intuitive and it's rare that you even consider what your own character is, but when you're building a brand it's vital to have that understanding.

3.   Consider what is driving your business.

What does it believe in, what is its purpose and who are its brand heroes. These things can help establish your emotive brand positioning and inform the identity and character for brand communications.

4.   Aim to build long-term relationships with your customers.

Don’t dress up your offering and raise expectations that result in broken promises, create trust with honest branding — be clear who your company is and be true to the values that drive it every day.

5.   Speak to your customers with a consistent tone of voice.

It will help reinforce the business’ character and clarify its offering so customers are aware exactly what to expect from the product or service.

6.   Don't repeat the same message in the same way over and over again. 

Alternatively, aim to make your key messages work together to build a coherent identity. 

7.   Don’t try to mimic the look of chains or big brands.

Try and carve out your own distinctive identity. There is a big consumer trend towards independent establishments, and several chains are in fact trying to mimic an independent feel to capture some of that market. Truly independent operators can leverage their status to attract customers who are looking for something more original and authentic, that aligns with how feel about themselves.

8.   Be innovative, bold and daring – stand for something you believe in.

Big brands are encumbered by large layers of bureaucracy, preventing them from being flexible and reacting to the ever-changing needs of their customers. Those layers of decision-makers can make it hard for them to be daring with their branding.

9.   Always consider your branding when communicating with customers.

Don't lose your pride or dilute your brand positioning with indiscriminate discounting. Try offering more, rather than slashing prices. Promotions are an opportunity to reinforce your brand mission.

10.  The old way of stamping your logo on everything won't cut it.

The future of branding is fluid and engaging — respect your customers' intelligence by not giving everything away up front. Generate some intrigue and allow them to unearth more about your brand for themselves. This is the way to foster ambassadors who revel in telling other people what they have discovered.

Friday, 8 May 2015

Google's New Interface: Just Tell It What To Do

Google used to tell you how to do something. Now, it’ll just do it for you.

In the last week, the company has added two small but important features to their famous search bar. You can type "find my phone" and Google will locate it on a map (and offer to call it); you can also type "send directions" and an interface will appear to beam directions to your phone.

No, neither of these functions is going to change the world overnight—especially as you’ll need an Android phone connected to your Google account for them to appear. But when you place them next to previously added mobile features—like being able to ID a song, set an alarm, or create a reminder using the search bar—and look at them in the context of the last 16 years of Google search, it feels a lot more like the evolution of search interface than a pair of random features.



For more...

Friday, 24 April 2015

Microsoft Invents A Better Way To Sense Hand Gestures

HANDPOSE PROMISES THE HOLY GRAIL OF MOTION DETECTION: FAST, ACCURATE HAND RECOGNITION.

Imagine strapping on a virtual reality headset, then using your hands to pick up a sword and swing it around your head. Imagine a hazard team able to defuse a complicated bomb from a mile away, just by controlling a robot's hand as effortlessly as your own. Imagine painting a picture on your computer just by waving a brush in front of your screen. Or, if you prefer, imagine using a computer like in Minority Report, whisking away pages and files just by grabbing them with your hands. 



Using the Handpose software, the first thing a user does is scan his or her hand by holding it up in front of the Kinect to create a 3-D model. In the lab, the process currently takes about a second, which is less than it takes an iPhone Touch ID sensor to accurately measure your fingerprint. Once the system has created a 3-D model of your hand, Handpose allows you to control it on the screen in real-time, at around 30 frames per second. From there, you can use the on-screen hand as if it was a doppelganger of your own.

Friday, 17 April 2015

More Control over Text Decoration

Text can have multiple decorations

a {
  text-decoration: underline overline;
}


See the text-decoration entry in the Almanac. More specifically, this is adding multiple values to the text-decoration-line subproperty.

You can change the color of the decoration

The default for the color of the decoration lines is the same as the color of the text. But you can change that:

a {
  text-decoration-color: #f06d06;
}


Check out the text-decoration-color entry in the Almanac.

a {
  text-decoration-style: wavy;
}


Friday, 27 March 2015

Left Half and Right Half Layout

Imagine a scenario where you need to split a layout in half. Content on the left and content on the right. Basically two equal height columns are needed inside of a container. Each side takes up exactly half of the container, creating a distinct break between one. Like many things in CSS, there are a number of ways to go about this and we're going to go over many of them right now!

Using Background Gradient


.container {
  background: linear-gradient(
    to right, 
    #ff9e2c 0%, 
    #ff9e2c 50%, 
    #b6701e 50%, 
    #b6701e 100%
  );
}


Using Absolute Positioning


Another route might be to set up two containers inside of a parent container, position them absolutely, split them up in halves using percentages, then apply the backgrounds. The benefit here is that now we have two separate containers that can hold their own content.


Absolute positioning is sometimes a perfectl solution, and sometimes untenable. The parent container here will need to have a set height, and setting heights is often bad news for content (content changes!). Not to mention absolute positioned elements are out of the document flow. So it would be hard to get this to work while, say, pushing down other content below it.

Using (fake) Tables


Yeah, yeah, tables are so old school (not to mention fraught with accessibility issues and layout inflexibility). Well, using the display: table-cell;property can actually be a handy way to create this layout without writing table markup in HTML. In short, we turn our semantic parent container into a table, then the child containers into cells inside the table — all in CSS!


You could even change the display properties at breakpoints pretty easily here, making the sides stack on smaller screens. display: table; (and friends) is supported as far back as IE 8 and even old Android, so it's pretty safe!

Using Floats

We can use our good friend the float to arrange the containers beside each other. The benefit here is that it avoids absolute positioning (which as we noted, can be messy).

Using Inline-Block

If clearing elements after floats seems like a burden, then using display: inline-block is another option. The trick here is to make sure that the elements for the individual sides have no breaks or whitespace in between them in the HTML. Otherwise, that space will be rendered as a literal space and the second half will break and fall down.

Using Flexbox



Friday, 13 March 2015

em-based media queries use

It’s not a disadvantage. EM units at the media-query level are not affected by html-scale because they refer to the medium: i.e. device-scale (outside the html). You can set html font-size in EMs too, which is logically consistent. User-set device-scale just means you can’t assume a PX value for anything in your design unless you specifically size it in PX (and even then often not); and that best policy is to set html font-size in EM or %, which is relative to device-scale, and then set anything inside the html scope in REMs, which is relative to html-scale. This forms a relative-size chain: nothing breaks, user/device-scale can be anything, and HTML font-size can be anything, media queries always trigger where they should.

If we’re going to be proportional…


A core tenet of Responsive Web Design (RWD) is fluidity and proportion. Instead of using fixed-width layouts, we enlightened web devs and designers use percentages in our CSS. Font units aren’t pixels or points anymore, they’re percentages (typically for top-level baseline reset) or, more often, ems. And yet the vast majority of us still write width-based media queries in pixels, e.g.:

@media all and (min-width: 500px) {}

@media screen and (max-width: 800px) {}

It’s a natural thought process: for windows or screens of particular width ranges, we want to flow our content in a particular way. This naturally seems like a pixel dimension. But, once again, to bring out my big hammer, what about when we look at things from a content perspective?

Folks who design for traditional reading media—where the content really is king—don’t center design decisions around the absolute width of content-holding elements so much as around the optimal line lengths for the content they’re flowing. There are some tried-and-true numbers one can shoot for that make for the “right” number of letters (and thus words) per line for comfortable human reading.

Thus actual column width is a function of font size and ems-per-line.

Baseline expectations...

You may have seen the rule of thumb (useful, admittedly!) that makes the following general equation in terms of baseline font sizes in CSS:

100% = 1 em ~= 16px ~= 14pt

This means that, at your baseline, that is, before you’ve adjust font sizes in any child elements, the default font size in the browser is usually approximately 16px and usually approximately 14pt but always 100% and 1em.

If we start from a baseline of 16px, you may well wonder what the difference (beyond academic) is between a media query like:

@media all and (min-width: 400px)

and one like this, that uses ems multiplied against the 16px baseline approximation:

@media all and (min-width: 25em)