Thursday 26 December 2013

zindex-basics

Z-Index-Basics

I'm sure you're familiar with three-dimensional coordinate space. We have an x-axis which is typically used to represent the horizontal, a y-axis to represent the vertical, and a z-axis used to represent what happens into and out of the page, or the screen in our case.


We don't literally see the z-axis, as the screen is a two-dimensional plane. We see it in the form of perspective and of some elements appearing in front of or behind other elements when they share the same two-dimensional space.

To determine where along this third axis an element is located, CSS allows us to set
three values on the z-index property.
  • auto ( default )
  • integer
  • inherit
For the moment let's focus on the integer value. This can be positive, negative, or 0. The greater the value, the closer to the viewer the element appears. The lower the value, the further away it appears.

If two elements are positioned so they both occupy a shared area of two-dimensional space, the element with the greater z-index will obscure or occlude the element with the lower z-index in the areas where they share the space.

HTML

<div class="one">
  <div class="two"></div>
  <div class="three"></div>
</div>

<div class="four"></div>

CSS
div {
  width: 200px;
  height: 200px;
  padding: 20px;
}

.one, .two, .three, .four {
  position: absolute;
}
  
.one {
  background: #f00;
  outline: 5px solid #000;
  top: 100px;
  left: 200px;
  z-index: 10;
}
  
.two {
  background: #0f0;
  outline: 5px solid #000;
  top: 50px;
  left: 75px;
  z-index: 100;
}

.three {
  background: #0ff;
  outline: 5px solid #000;
  top: 125px;
  left: 25px;
  z-index: 150;
}

.four {
  background: #00f;
  outline: 5px solid #ff0;
  top: 200px;
  left: 350px;
  z-index: 50;

}

jsfiddle link

http://jsfiddle.net/K7J35/

Even though div.two has the greater z-index (100), it actually sits below div.four (z-index = 50) on the page. You can see the result of the code above in the image below. The black and yellow borders show the different stacking contexts each element is in.



Since div.two is contained within div.one, its z-index is relative to div.one's stack. In effect what we really have is the following:
  • .one — z-index = 10
  • .two — z-index = 10.100
  • .three — z-index = 10.150
  • .four — z-index = 5
What we've done is moved div.one and everything it contains below div.four. No matter what values we set on the z-index property of elements inside div.onethey will always display below div.four.

If you're like me, this has probably tripped you up once or twice when working with z-index. Hopefully these examples help clear up why an element with a greater z-index sometimes ends up displaying behind another element with a lower z-index.

Conclusion

When you first encounter it, the z-index property seems like a very simple property to understand. Values represent a location on an axis into and out of the screen, and that's all.


Thursday 19 December 2013

hover styling in inline css

IN CSS a:hover style in inline

<a href="#" style="background-color:white;"

onMouseOver="this.style.backgroundColor='#999999'"
onMouseOut="this.style.backgroundColor='#ffffff'">
YOUR BLOCK YOUR BLOCK YOUR BLOCK 
</a>

Jsfiddle link

http://jsfiddle.net/fsx3L/

Thursday 12 December 2013

Exploring canvas drawing techniques

Free Drawing in <canvas>

In html
<canvas id="c" width="500" height="300"></canvas>

In CSS
canvas{ border: 1px solid #ccc; }

In JS

var el = document.getElementById('c');
var ctx = el.getContext('2d');
var isDrawing;
el.onmousedown = function(e) {
  isDrawing = true;
  ctx.moveTo(e.clientX, e.clientY);
};
el.onmousemove = function(e) {
  if (isDrawing) {
    ctx.lineTo(e.clientX, e.clientY);
    ctx.stroke();
  }
};
el.onmouseup = function() {
  isDrawing = false;
};

BASIC

Editor link

For all drawing techniques 

Monday 9 December 2013

Stop Cooking Live Animals In China

Putting a live dog, or any animal, in boiling water, or a hot oven, or using a blow torch on cats, is not only blatantly wrong, without further explanation---but if one is necessary it is TORTURE. 

The 'reason' that is given for cooking animals alive is that they simply "taste better" after their bodies are adrenaline-soaked with fear and pain. 'Taste' is never an excuse for unspeakable cruelty, nor is 'culture' an excuse. 

China is making so many strides to become a first world country, but with all due respect, with this kind of accepted culinary method, China AND Korea will be looked upon as backward nations by the rest of the civilized world (one foot in the 21st century and one foot in a primitive age). 

Any animal placed in boiling water or cooked, while still alive, in any manner is obviously terrified, in unimaginable pain, despair and doomed to a slow and lingering death. Animals in the food chain should, at the very least, be given the most humane death possible.


Save Animals

The Shocking Truth Behind Snakeskin Fashions


Snakes are remarkable animals, but they have an unearned negative reputation. Some people have even come to fear these stunning animals, but in reality, 
snakes have more reasons to fear us.

Every year, at least 440,000 pythons are slaughtered in Indonesia, Malaysia, and Vietnam—just to be made into shoes and handbags! The real number is probably way higher because this number doesn’t include the thousands of illegally traded pythons who are exported annually.
Most are torn from their own homes deep in the jungles of Indonesia and Malaysia.


Once they are captured, their heads are often forced down and cut off with a machete. Others have their heads nailed to a tree and their skins slowly peeled off. Because of their slow metabolisms, snakes remain conscious and are able to feel pain and fear even after they have their heads cut off.


If they aren’t beheaded or nailed to a tree, they are beaten to death. Their jaws are forced open so that a tube can be jammed down their throats, then their bodies are pumped full of water to make their skins easier to remove. Ropes are tied tightly around their necks to prevent any fluid from escaping their bodies.



It can take up to 10 minutes for snakes to die.



Their bodies are slit open from end to end to loosen their once strong and protective skin.



Once the skin is limp, it is ripped from the snakes’ bodies. The snakes’ skins are no longer their own and are now the prized possessions of their captors. The skins are shipped off to tanneries to be treated with chemicals and sold to the fashion industry.




Many snakes are still alive as they are tossed into a pile of other snakes and left to die slowly. They often suffer for several days before dying from dehydration.

Snakes are not the only animals who suffer for fashion. Millions of lizards, alligators, crocodiles, and other reptiles are violently killed every year so that their skins can be torn from their bodies to make wallets, belts, boots, and handbags. Reptiles may be cold-blooded, but wearing their skins is cold-hearted.

Thursday 5 December 2013

Thursday 28 November 2013

HTML5 Element Index

Double-Colon for Pseudo-Elements


To differentiate between pseudo-elements and pseudo-classes, in CSS3 all pseudo-elements have a double-colon syntax. So instead of: :before, you do ::before.

All browsers are going to support the single-colon syntax, pretty much indefinitely, to abide by good design principles.

So that means we won’t be using the double-colon syntax until all browsers that don’t support it (including IE8, the current browser leader) are completely gone — which might not be for at least 2 or 3 years, and probably more.



( :root ) in css

The :root selector allow  you to target the highest-level 'Parent' element in the dom, or document.


We can take advantage of being able to apply CSS to the  <html> element to skip the wrapper div and keep our markup clean!



Browser Support for CSS3 Selectors


The Status of the ::selection Pseudo-element?

HTML5 Boilerplate put the ::selection pseudo-element on the map, so to speak, most CSS developers now a days have been including this selector as part of their universal styles.



HTML5 Element Index

Head Part
  • Doctype
  • Title
  • Base
  • Link
  • Meta
  • Style
  • Script
  • Noscript
Section
  • body
  • article
  • nav
  • aside
  • section
  • header
  • footer
  • h1-h6
  • main
  • address
Grouping
  • p
  • hr
  • pre
  • blockquote
  • ol
  • ul
  • li
  • dl, dt, dd
  • figure
  • figcaption
  • div
Tables
  • table
  • caption
  • thread
  • tbody
  • tfoot
  • tr, th, td
  • col, colgroup
Form
  • form
  • fieldset
  • legend
  • label
  • input
  • button
  • select
  • datalist
  • optgroup, option
  • textarea
Form 2 HTML5
  • keygen
  • output
  • progress
  • meter
  • detail
  • summary
  • command
  • menu
Embedded
  • img
  • iframe
  • embed
  • object
  • param
  • video
  • audio
  • source 
  • canvas
  • track
  • map
  • area
Text-level
  • a
  • em
  • strong
  • i, b
  • u
  • a
  • small
  • abbr
  • q
  • site
  • dfn
  • sub, sup
Text-level 2 HTML5
  • time
  • code
  • kdb
  • samp
  • var
  • mark
  • bdi
  • bdo
  • ruby, rt, rp
  • span
  • br
  • wbr

Thursday 14 November 2013

30 things you no longer need because of SMART PHONES



  1. Phones
  2. Flashlights
  3. Rolodex
  4. Newspapers
  5. Magazines
  6. Compasses
  7. Cameras
  8. Notepad
  9. Voice Recorder
  10. Calculator
  11. Watches
  12. Calculator Watches
  13. Alarm Clocks
  14. Egg Timers
  15. Stopwatches
  16. Mail
  17. Portable Game System
  18. Maps
  19. GPS System
  20. Encyclopedias ( Wiki )
  21. Radios
  22. Walkmen
  23. Record Stores
  24. Yellow Pages
  25. Takeout Menus
  26. Weathermen
  27. Photo Album
  28. Remembering Anything
  29. Boredom
  30. Conversation

A tutorial on how to create an interesting animated 3D opening type effect with pseudo-elements

Thursday 7 November 2013

Multiple Backgrounds Using Css

Tinted Images with Multiple Backgrounds and Multiple background images

The background property in css can accept comma separated value. "Multiple" backgrounds.
.tinted-image{
  background: linear-gradient ( rgba( 255, 0, 0, 0.45), rgba( 255, 0, 0, 0.45), )
}



Which CSS Measurements To Use When

It can be difficult for web developers to understand which units to use where, and when, on their pages.
Pixels ( px ), Percentage ( % ), em, ex, Points and Picas

Pixels 
Use for: hairline borders and general elements when creating fixed-width designs.

Percentage 
Use for: making responsive images and containers; setting height on the body in some cases.

em, ex
Use for: typography, and elements related to typography.

Points and Picas
Use for: print stylesheets.



I love Typography

Expletus Sans is a fifteen-year old google free font

It was March 2nd, 2011. For more details  Click me:-