Monday, April 10, 2017

Priority on CSS styles

When we have multiple styles(ex: color) for a single element the style will apply in following manner or order.

Thing 1:
The first thing is style will apply in what order they have rendered in browser. The last one will be applied.

There are three ways to define styles there, 1. External Style, 2. Internal Style 3. Inline Style

One thing you have to understand clearly, always inline style will be loaded at last(Even you have loaded style sheets at the end of page). So inline style always having the highest priority than all two others.

With respect to other two styles the priority will be decide as per the order they have loaded.

Ex:
<head>
.my_color{
color: red;
}
<link rel="stylesheet" type="text/css" href="external_style.css" /> /* Imagine this will having the style color as "blue" for the same class.
</head>
In above example blue color will be applied for element which having the class my_color, since external style will be loaded after the internal style.
If we have loaded external style before the internal style, the color red will be applied.

In case if you have multiple styles for element in same level style(Which may inline style or external style. Cannot be inline style). What will happen?
Fid it on, below section "Thing 2".

Thing 2:
The style will be applied with respect to the selector priority, if browser meet multiple styles for a same element in same level of style sheet. The below are the priority levels of selectors.

Selector Priority Levels:
1. ID
2. Class
3. Tag name

Friday, July 8, 2016

Different between UI and UX

UI: This is an acronym for ‘User Interface’. It deals with how a website or an application looks. It covers the entire look of the application including the colors, fonts, icons and images used. The user interface is entirely about the visual and interface design.

UX: It deals with how easily a user can, well, use the app and how easily the app would serve to satisfy his requirements.
Consider this example: Say, you’re making a mobile app. When designing the interface (UI) of your app, you should not only consider how great your app will look, but also how easy it will be to use, i.e. how great the User Experience (UX) will be.


Learn JavaScript - String and its methods - 16

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>String and it's methods - JS...