Sunday, 22 February 2015

Difference between the User Agent Style , User Style and Author style in CSS

The CSS cascade style sheet which is used to set the style for the element in the Webpage. It various depends upon the browser. Each individual browser have there own styles to define for the element tags.Then the person who design the website can also give the style , finally the end user.


According to the Web standard CSS declarations are applied in the order of lowest to highest priority.

1. User agent
2. User normal
3. Author normal
4. Author important
5. User Important

Difference between the user agent , user and author styles ?

User Agent is a style which is define by your own browser like IE, chrome, Firefox which has the lowest priority, Each individual browser have own set of style define for the individual tags.

Author is the creator of the webpage , who design the styles for the website in a CSS or in inline.

User is the end user who viewing the web page as  a client in  browser, i.e you,  you can override the author styles by defining your style in CSS.

In the Author and User we can see that normal and Important style, then what is difference in that ?

If we define a style for an element for two times as below as normal

1. color: blue;

2. color:black;

Now the color of the element is black because the precedence goes to the latest declarations.
By a chance if you give a importance for a color in the first declaration ,

1. color:blue !important;
2. color:black;

Then now the color of the element will be blue, because important is specified in the first color.
In the normal style it follows the top-down approach to apply the styles.

Priority:
************
There is a chance that many styles can be defined for an element in many ways by specifying with parent element, id selector, or class names path iteration to apply the styles, but if more than one style is present  in the CSS then it is prioritized based on the order which have highest priority, if the two declarations have the same priority then style which is present last in the style sheet

Let we take an example styles and there priority:
**************************************
Normally a style is defined for a element based on selectors, then the style are ordered based on priority , then applied by last declarations

Example:
*********


        /* check for the priority of Styles applying for a same element */
        h3.message{ color: green; }
        #dashboard #container h3.message{ color: red; }
        body#dashboard div#container h3.message{ color: #e06818; }
        #container h3.message{ color: darkblue; }
        * body#dashboard div#container h3.message{ color: aquamarine; }
        #container h3{ color: fuchsia; }
        h3{color:silver}


Style is priority based on number of ID's, classes , attributes and pseudo present in that style definition, and thses summation of number will give the order of priority


Selector Specificity priority
SelectorInline StyleIDsClasses, Attributes, and Pseudo-classesElement Types and Pseudo-elements
body#dashboard div#container
h3.message
0213
* body#dashboard > div#container
h3.message
0213
#dashboard #container
h3.message
0211
#dashboard h3.message0111
#container h30101
h3.message0011
h30001

From above style you can see Two styles are in same priority but one style is applied based on the style which is declared last in the stylesheet. so the style is applied to the element.

* body#dashboard div#container h3.messagecoloraquamarine; }

HTML




CSS:



Output



From this post you can see the difference between the User agent , user and Author styles


Saturday, 7 February 2015

Redmi Note 4G Link Apps to External SD Card

In this post we are going to see about the Redmi Note 4G Links Apps to External SD Card. If you already bought a redmi note 4G or hereafter you are going to buy, then after a certain time you will face a issue like space problem, Even the Redmi have External SD card supports up to 64 GB, many of app installation files is placed on internal memory. This is actually happens for my phone, so after a certain stage, i started to install many Car games, shooting games and Apps, My phone internal Memory total space is 8 GB, but available Free space is reduced to 1 GB and less, so started to search for a alternate solution.

Alternation Soultion is straight away play the Games or Apps from the External SD card instead from internal memory, so have to link the app to start from the external memory card, by changing the address to link.

But when i try it, i found some suggestions in google, i.e MI Doesnt support it, due to performance problem of loading data from the SD cards, and also Power Consuptions problems to load the external memory card.

If MI doesnt support it, then how we can do that, then i found one solution which makes my app to move and work from SD cards.

1. Rooting and UnRooting Redmi Note
2. PhilTouch CWM Recovery
3. Partition Magic for SD card - Needed for Link2SD app
4. Make SD to writable 
5. Transferring app to SD card using Link2SD app


Rooting Redmi Note:
********************************************************

  • Download the file in computer Rootonly_beta.zip
  • Rename Rootonly_beta.zip to update.zip
  • Connect the phone with computer in USB
  • Open the internal storage of phone and paste the file update.zip in the internal storage. Switch of the Phone 
  • Press the Power button + volume up button > it will boot in the recovery mode
  • Select Language > install update.zip
  • Wait for phone to Reboot
  • Go to Security application  > Permission > Root Permission > Slide Enable it.


Now you are rooted, You have to be rooted to do the following steps.

click the link to download Rootonly_beta.zip
MI Redmi Note 4G Rootonly_beta.zip


PhilTouch CWM REcovery
********************************************************

  • Download the zip here by clicking Download CMW Recovery
  • Rename to update.zip.
  • Copy that to the root of the sd or internal phone storage.
  • Enter mode recovery (turn by holding down Vol + and Power Up until the logo appears).
  • Select English.
  • Run the "Install System to update.zip" option.
  • Restart.
  • Again enter mode recovery (turn by holding down Vol + and Power Up) This time you will see CWZ
  • Reboot back to device
  • CWM recovery can be use to backup your devices. It saved me many times.



Partition Magic for SD card:
********************************************************

  1. Download MiniTool Partition Click Here download it and install it on PC.
  2. Insert your SD card to a card reader and open it on your computer.(not via USB cable)
  3. Back up all your files to the computer because partitioning will wipe your data.
  4. Open Mini Tool in your computer. Locate your SD card (be careful in choosing and make sure not to choose the drive of your computer)
  5. Right click and choose Delete
  6. Right click on it again and choose Create New. Create “FAT32″ partition (This is where all your media files will go. Be sure to make it bigger than the 2nd part)
  7. Select “Create as: PRIMARY”
  8. Next, create an ext2/ext3/ext4 partition (I suggest ext4 after experimenting with my Mi Note, it works better with ext4). This is where your apps will go. I suggest a value of 2000 MB ~ 3000 MB would be big enough but its ur choice...
  9. Select “Create As: PRIMARY” (make sure that it is both set to primary because it will not work if it is not set to primary)
  10. Click the “Apply” button on the top left corner and wait for it to finish the process. Done.
  11.  Put back your SD card to your phone and switch it on


Make SD as writable:
********************************************************
  • Open Google Play store on your phone
  • Search exact word: SDFIX
  • Select and install SDFix: Kitkat Writable (by NextApp Inc)
  • Open up the App and follow thru
  • Reboot phone, and you are done

Transffering App to SD card:
********************************************************
  • Open Google Play store on your phone
  • Search exact word: Link2SD
  • Select and install Link2SD


1. Run the app (Link2SD) on the phone. If the app is requesting the SuperUser access touch "allow"       option.

2. For the first launch, if you've been partitioned your SD card, the app will shown a popup option           Choose EXT 4 as previously formatted on your computer, and restart your device after that, and re-     launch Link2SD after restarting. If there's shown an "error mount   script" warning, you have to re-     partitioning your SD card. I suggest you to change the file system  on the SD card's 2nd partition         (if you use ext2 before, use ext3 / ext4 / FAT32 file system when re-partitioning)

3. Now it's done. choose the apps that you wants to move to SD card's 2nd partition. Touch / tapsoftkey (capacitive button or "option" key) choose multi select option, and you can touch the select all option, or you can choosing manually by tick the apps one by one. Choose actions after that.

4. There will be shown the other menu on Link2SD, then choose create link.

5. Tick all the options, then click OK.

6. Wait till Link2SD moving all the apps to SD card's 2nd partition. When it's done, you can check the memory status on your device. Touch the softkey, and then choose storage info.



Uninstalling / removing system app with Link2SD
********************************************************
That is pretty easy to use this feature. All you have to do is choosing one or more system apps that you want to remove, then choose action.

Next, choose uninstall on the option

Then Link2SD will shown a warning message, to confirming about the removal, read it carefully. If you're sure enough, simply click OK.



UnRooting Redmi Note:
********************************************************
If you need to UnRoot Redmi note then simple steps
  • Download the UnRootonly_beta.zip file from computer
  • Rename the UnRootonly_beta.zip to update.zip 
  • Open the internal storage of phone and paste the file update.zip in the internal storage. Switch of the Phone 
  • Press the Power button + volume up button > it will boot in the recovery mode
  • Select Language > install update.zip
  • Wait for phone to Reboot
click the below link to download UnRootonly_beta.zip


I hope this post will helpful for the users who are trying the Apps to move to SD card, to make more internal memory available in Redmi Note 4G.