{"id":4577,"date":"2016-10-06T06:20:23","date_gmt":"2016-10-06T06:20:23","guid":{"rendered":"http:\/\/a1webdesignteam.com\/blog\/?p=4577"},"modified":"2016-10-06T06:20:23","modified_gmt":"2016-10-06T06:20:23","slug":"learning-css3","status":"publish","type":"post","link":"https:\/\/a1webdesignteam.com\/blog\/learning-css3\/","title":{"rendered":"Learning CSS3"},"content":{"rendered":"<p class=\"lead\"><strong>CSS-3<\/strong> is the <strong>latest version of CSS<\/strong>, the <strong>stylesheet language<\/strong> of web with <strong>new selectors<\/strong>, <strong>shadows<\/strong>, <strong>multiple backgrounds<\/strong>, <strong>gradients<\/strong>, <strong>transition<\/strong>, <strong>animations<\/strong>, <strong>embedded fonts<\/strong> and <strong>responsive layouts.<\/strong><\/p>\n<h2 id=\"article3\" class=\"section\">CSS3 Features<\/h2>\n<div class=\"bs-example\">\n<table class=\"table table-hover\">\n<thead>\n<tr>\n<th>New Features<\/th>\n<th>Uses<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>New Selectors<\/strong><\/td>\n<td>Better Selections of HTML Elements<\/td>\n<\/tr>\n<tr>\n<td><strong>Shadows Effect<\/strong><\/td>\n<td><strong>Box shadow<\/strong> and <strong>text shadow<\/strong> for shadow effects<\/td>\n<\/tr>\n<tr>\n<td><strong>Rounded Corners<\/strong><\/td>\n<td>Easily round the corners of images and block elements.<\/td>\n<\/tr>\n<tr>\n<td><strong>Gradients<\/strong><\/td>\n<td><strong>Linear<\/strong>, <strong>Radial<\/strong> and <strong>Repeating gradients<\/strong> effects<\/td>\n<\/tr>\n<tr>\n<td><strong>Opacity<\/strong><\/td>\n<td>Reduce opacity of Elements and Background colors using <strong>rbga colors<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Transitions<\/strong><\/td>\n<td>Hover and Focus element with time and timing functions.<\/td>\n<\/tr>\n<tr>\n<td><strong>Transformations<\/strong><\/td>\n<td><strong>Rotate<\/strong>, <strong>Scale<\/strong>, <strong>Skew<\/strong> and <strong>Translate<\/strong> any object<\/td>\n<\/tr>\n<tr>\n<td><strong>Animations<\/strong><\/td>\n<td><strong>Animate<\/strong> any object without using flash.<\/td>\n<\/tr>\n<tr>\n<td><strong>Multi Column layout<\/strong><\/td>\n<td>Create multiple <strong>columns layouts<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>@font face<\/strong><\/td>\n<td>Embedded various fonts family<\/td>\n<\/tr>\n<tr>\n<td><strong>@media<\/strong><\/td>\n<td>Condition based CSS to create <strong>Responsive layouts<\/strong>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 id=\"article2\" class=\"section\">CSS and CSS-3 Selectors<\/h2>\n<p class=\"lead\">Initially CSS use <strong>tag<\/strong>, <strong>class<\/strong> and <strong>id selectors<\/strong>.<br \/>\nHowever <strong>CSS 2.1<\/strong> adds<strong> pseudo-elements<\/strong>, <strong>pseudo-classes<\/strong>, and <strong>combinators<\/strong>.<br \/>\nAnd now With CSS3, we can target almost any element on the page with a <strong>wide range of selectors<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p class=\"lead\">Here we will discuss all <strong>CSS and CSS3 selectors<\/strong>.<\/p>\n<h2 id=\"article3\" class=\"section\">Rational Selectors<\/h2>\n<div class=\"bs-example\">\n<p class=\"lead\"><strong>Rational Selectors <\/strong> targets elements based on their relationship with another element.<\/p>\n<table class=\"table table-bordered table-striped lead\">\n<tbody>\n<tr>\n<th>Selector<\/th>\n<th class=\"mw120\">CSS Code<\/th>\n<th>Use<\/th>\n<th class=\"mw123\">CSS Level<\/th>\n<\/tr>\n<tr>\n<td>\n<h3 class=\"h4\">Descendant Selector<\/h3>\n<\/td>\n<td>div p{ }<\/td>\n<td>Target all p tags that are <strong>descendent<\/strong>(<em>child, grandchild, great grandchild, and so on)<\/em> of div tag.<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>\n<h3 class=\"h4\">Child Selector<\/h3>\n<\/td>\n<td>div&gt;p{ }<\/td>\n<td>This selector matches only <strong>direct child<\/strong> of element<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\n<h3 class=\"h4\">Adjacent Sibling<\/h3>\n<\/td>\n<td>h4+p{ }<\/td>\n<td>This selector matches p tag next to h4 and both sharing <strong>same parent<\/strong>. That Means p should comes <strong>directly after<\/strong> h4.<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\n<h3 class=\"h4\">General Sibling<\/h3>\n<\/td>\n<td>h3~p{ }<\/td>\n<td>This selector matches all P elements exactly after h3 element.<\/td>\n<td>3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"alert alert-danger\">\n<p class=\"lead\"><strong>General Sibling<\/strong> i.e. ( <b> A~B<\/b>) selector will only in HTML-5 Supported Browsers. IE 8 and lesser doesn&#8217;t support this selector.<\/p>\n<\/div>\n<\/div>\n<hr \/>\n<h2 id=\"article4\" class=\"section\">Attribute Selectors<\/h2>\n<div class=\"bs-example\">\n<p class=\"lead\"><strong>Attribute Selectors <\/strong>were introduced in css2. They targets matching elements based on their <strong>attributes<\/strong>.<\/p>\n<table class=\"table table-bordered table-striped lead\">\n<tbody>\n<tr>\n<th class=\"mw156\">CSS Code<\/th>\n<th>Use<\/th>\n<th class=\"mw123\">CSS Level<\/th>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr]{}<\/h4>\n<\/td>\n<td>Target only E Element or Elements having exact case-insensitive attribute value. For exp input with disabled attribute,<br \/>\n<span class=\"text-danger\">input[ disabled]{ cursor:not-allowed }<\/span><\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr=&#8221;value&#8221;]{}<\/h4>\n<\/td>\n<td>This selector matches only Element with exact attribute and value. For exp, input type checkbox only,<br \/>\n<span class=\"text-danger\">input[ type=&#8221;checkbox&#8221; ]<\/span><\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr~=&#8221;foo&#8221;]{}<\/h4>\n<\/td>\n<td>This selector matches only Elements with exact Attribute with multiple values separated by white-space, and one of the value is exactly equal to &#8220;foo&#8221;.<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr|=&#8221;foo&#8221;]{}<\/h4>\n<\/td>\n<td>This selector matches only Elements with exact Attribute with value separated by hyphen (<b>&#8211;<\/b>) , and one of the value is exactly equal to &#8220;foo&#8221;.<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr^=&#8221;foo&#8221;]{}<\/h4>\n<\/td>\n<td>This selector matches only element E with attribute value starting exactly with foo. For exp, div having class name starting with &#8220;col&#8221;,<br \/>\n<span class=\"text-danger\">div[ class^=&#8221;col&#8221; ]<\/span><\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr$=&#8221;value&#8221;]{}<\/h4>\n<\/td>\n<td>This selector matches only element E with attribute value ending exactly with foo. For exp, div having class name ending with &#8220;wrap&#8221;,<br \/>\n<span class=\"text-danger\">div[ class$=&#8221;wrap&#8221; ]<\/span><\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E[attr*=&#8221;value&#8221;]{}<\/h4>\n<\/td>\n<td>This selector matches only element E with atttribute value contains the substring &#8220;foo&#8221;. For exp, div having class name with substring &#8220;md&#8221;,<br \/>\n<span class=\"text-danger\">div[ class*=&#8221;md&#8221; ]<\/span><\/td>\n<td>3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"alert alert-danger\">\n<p><strong>E[attr^=foo&#8221;]{}<\/strong>, <strong>E[attr$=foo&#8221;]{}<\/strong> and <strong>E[attr*=foo&#8221;]{}<\/strong> <strong>attribute selectors<\/strong> will only in HTML-5 Supported Browsers. IE 8 and lesser doesn&#8217;t support these selectors.<\/p>\n<\/div>\n<\/div>\n<hr \/>\n<h2 id=\"article5\" class=\"section\">Pseudo Selectors<\/h2>\n<p class=\"lead\"><strong>CSS Pseudo Selectors<\/strong> are classified in <strong>Pseudo Class<\/strong> and <strong> pseudo elements<\/strong>.<\/p>\n<div class=\"bs-example\">\n<p class=\"lead\">Since<strong> CSS1<\/strong> &amp;<strong> CSS2<\/strong>, we are using <strong>Pseudo Selectors<\/strong> .<\/p>\n<table class=\"table table-bordered table-striped lead\">\n<tbody>\n<tr>\n<th class=\"mw120\">CSS Code<\/th>\n<th>Use<\/th>\n<th class=\"mw120\">CSS Level<\/th>\n<\/tr>\n<tr>\n<td>\n<h4>E:link{}<\/h4>\n<\/td>\n<td>E (Anchor) element with a hyperlink, and which is <strong>not visited<\/strong> yet.<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E:visited{}<\/h4>\n<\/td>\n<td>E (Anchor) element with a hyperlink, and which is <strong>already visited<\/strong> as per browsers history.<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E:hover{}<\/h4>\n<\/td>\n<td>Change style on <strong>mouseover<\/strong> state of E element. Exp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<table class=\"table table-bordered table-striped lead\">\n<tbody>\n<tr>\n<td>1 and 2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E:focus{}<\/h4>\n<\/td>\n<td>Change style on <strong>focus<\/strong> state of E element. Generally All Form Controls supports focus state. <input class=\"form-control\" type=\"text\" \/><\/td>\n<td>1 and 2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E:active{}<\/h4>\n<\/td>\n<td>Change style on <strong>mouse key down<\/strong> state of E element. <strong>&lt;button&gt;<\/strong>, <strong>&lt;input type=&#8221;submit&#8221;&gt;<\/strong>, <strong>&lt;button type=&#8221;reset&#8221;&gt;<\/strong> supports this. Exp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"bs-example\">\n<table class=\"table table-bordered table-striped lead\">\n<tbody>\n<tr>\n<td>1 and 2<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:enable{}<\/h4>\n<\/td>\n<td>A user interface element which is enable. exp <input class=\"form-control\" type=\"text\" placeholder=\"Enabled field\" \/><\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:disable{}<\/h4>\n<\/td>\n<td>A user interface element that is disabled. exp <input class=\"form-control disabled\" disabled=\"disabled\" type=\"text\" value=\"Disabled Field\" \/><\/p>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n    input[ type=\"text\"]:disabled{ cursor:not-allowed }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"text\" value=\"Disabled Field\" disabled&gt;:Enter Country &lt;\/label&gt;   \r\n                         <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:read-only{}<\/h4>\n<\/td>\n<td>A user interface element that is disabled. exp <input class=\"form-control\" readonly=\"readonly\" type=\"text\" value=\"Read Only Field\" \/><\/p>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n    input[ type=\"text\"]:readonly{ cursor:not-allowed }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"text\" value=\"Read Only Field\" readonly&gt;:Enter Country &lt;\/label&gt;   \r\n                         <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>E:checked{}<\/h4>\n<\/td>\n<td>For Checkbox and radio buttons that are checked.<br \/>\nexp<\/p>\n<div class=\"checkbox\"><label><input class=\"checkbox\" type=\"checkbox\" \/>: I Agree<\/label><\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n    input[ type=\"checkbox\"]~span{ color:red }\r\n    input[ type=\"checkbox\"]:checked~span{ color:green }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"checkbox\"&gt;: &lt;span&gt;I Agree&lt;\/span&gt;&lt;\/label&gt;   \r\n                         <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:valid{}<\/h4>\n<\/td>\n<td>Applicable to elements that are <strong>valid<\/strong>, based on their type and pattern. For exp<\/p>\n<div class=\"form-group\"><label>Enter ATM PIN: <input class=\"form-control\" maxlength=\"4\" pattern=\"^[0-9]{4}$\" required=\"\" type=\"text\" value=\"1234\" \/> <\/label><\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n input[ type=\"text\"]:valid{ box-shadow: 0px 0px 5px 1px green  }\r\n input[ type=\"text\"]:invalid{ box-shadow: 0px 0px 5px 1px red }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"text\" pattern=\"^[0-9]{4}$\" required maxlength=\"4\"&gt;: Enter ATM Pin&lt;\/label&gt;     \r\n\t\t\t             <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:invalid{}<\/h4>\n<\/td>\n<td>Applicable to elements that are <strong>invalid<\/strong>, based on their type and pattern. For exp<\/p>\n<div class=\"form-group\"><label>Enter ATM PIN: <input class=\"form-control\" maxlength=\"4\" pattern=\"^[0-9]{4}$\" required=\"\" type=\"text\" value=\"abcd\" \/> <\/label><\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n input[ type=\"text\"]:valid{ box-shadow: 0px 0px 5px 1px green  }\r\n input[ type=\"text\"]:invalid{ box-shadow: 0px 0px 5px 1px red }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"text\" pattern=\"^[0-9]{4}$\" required maxlength=\"4\"&gt;: Enter ATM Pin&lt;\/label&gt;     \r\n\t\t\t             <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:required{}<\/h4>\n<\/td>\n<td>Applicable to input elements having<strong>required<\/strong> attribute. For exp<\/p>\n<div class=\"form-group\"><label>Enter Name: <input id=\"req\" class=\"form-control\" required=\"\" type=\"text\" placeholder=\"Enter Name\" \/> <\/label><\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n input:required{ box-shadow: 0px 0px 5px 1px #ffae15  }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"text\" required placeholder=\"Enter name\"&gt;: Enter Name&lt;\/label&gt;     \r\n\t\t\t             <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:optional{}<\/h4>\n<\/td>\n<td>Applicable to input elements that do not have <strong>required<\/strong> attribute. For exp<\/p>\n<div class=\"form-group\"><label>Enter Name: <input id=\"req1\" class=\"form-control\" type=\"text\" placeholder=\"Enter Name\" \/> <\/label><\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n input:optional{ box-shadow: 0px 0px 5px 1px #e83edb  }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input type=\"text\" placeholder=\"Enter name\"&gt;: Enter Name&lt;\/label&gt;     \r\n\t\t\t             <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:in-range{}<\/h4>\n<\/td>\n<td>Applicable to <strong>range<\/strong> and <strong>input type number<\/strong> element when the value is <strong>in-range<\/strong> . For exp<\/p>\n<div class=\"form-group\">\n<form><label>Enter Age: <input class=\"form-control\" max=\"50\" min=\"18\" required=\"\" type=\"number\" \/> <\/label><\/form>\n<\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n input:in-range{ box-shadow: 0px 0px 5px 1px green  }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input required type=\"number\" min=\"18\" max=\"50\" &lt;\/label&gt;     \r\n\t\t\t             <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\n<h4>:out-of-range{}<\/h4>\n<\/td>\n<td>Applicable to <strong>range<\/strong> and <strong>input type number<\/strong> element when the value is <strong>out-of-range<\/strong> . For exp<\/p>\n<div class=\"form-group\">\n<form><label>Enter Age: <input class=\"form-control\" max=\"50\" min=\"18\" required=\"\" type=\"number\" \/> <\/label><\/form>\n<\/div>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n input:out-of-range{ box-shadow: 0px 0px 5px 1px red  }\r\n&lt;\/style&gt;\r\n\r\n &lt;label&gt;&lt;input required type=\"number\" min=\"18\" max=\"50\" &lt;\/label&gt;     \r\n\t\t\t             <\/code><\/pre>\n<\/div>\n<\/td>\n<td>3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"section\">Browsers Compatibility<\/h3>\n<div class=\"alert alert-danger\">\n<p class=\"lead\"><strong>:hover<\/strong> is not supported in <strong>IE-6<\/strong> and below. IE-7 and below doesn&#8217;t supports <strong>:focus<\/strong>. However all Level 1 and Level 2 selectors are supported in IE-8 except(<em>:checked, :enabled, :disabled, &amp; :target<\/em>). Good News is tha- <strong>IE-9<\/strong> and above supports all CSS Level selectors.<\/p>\n<\/div>\n<hr \/>\n<h2>Structural Pseudo-classes<\/h2>\n<div class=\"bs-example\">\n<p class=\"lead\">Using <strong> Structural Pseudo-classes<\/strong>, we can target any element based on <strong>their position<\/strong> .<\/p>\n<table class=\"table table-striped table-bordered lead\">\n<tbody>\n<tr class=\"text-info\">\n<th class=\"mw120\">CSS Code<\/th>\n<th>Use<\/th>\n<th class=\"mw123\">CSS Level<\/th>\n<\/tr>\n<tr>\n<td>E:root<\/td>\n<td>an E Element, root of the document.<\/td>\n<td class=\"text-center\">2<\/td>\n<\/tr>\n<tr>\n<td>:first-child<\/td>\n<td>Targets only <strong>first child<\/strong> Element of parent. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li class=\"text-danger\">List 1<\/li>\n<li>List 2<\/li>\n<li>List 3<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:first-child{ color:#a94442}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">2<\/td>\n<\/tr>\n<tr>\n<td>:first-line<\/td>\n<td>Targets only <strong>first line<\/strong> of Element. For Exp,<\/p>\n<p id=\"fc\"><small>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque ducimus delectus recusandae nisi dolore tenetur doloremque voluptas, ad inventore earum quos harum illo mollitia magnam velit cum asperiores. Earum, voluptatem.<\/small><\/p>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n p:first-line{ color:red}\r\n&lt;\/style&gt;\r\n\r\n&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident suscipit magnam ad architecto magni optio alias quibusdam aliquam incidunt eligendi tempore quam nobis nisi non, similique minus, nihil deleniti neque.\r\n&lt;\/p&gt;              \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">1<\/td>\n<\/tr>\n<tr>\n<td>:first-letter<\/td>\n<td>targets only <strong>first letter<\/strong> of Element, For exp,<\/p>\n<p id=\"fl\">Lorem ipsum dolor sit amet.<\/p>\n<div class=\"bs-example\">\n<pre><code>\r\n&lt;style&gt;\r\n p:first-letter{ color:red; font-size:2em}\r\n&lt;\/style&gt;\r\n\r\n&lt;p&gt;Lorem ipsum dolor sit amet.\r\n&lt;\/p&gt;              \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">1<\/td>\n<\/tr>\n<tr>\n<td>:last-child<\/td>\n<td>Targets only <strong>last child<\/strong> Element of parent. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li>List 1<\/li>\n<li>List 2<\/li>\n<li class=\"text-danger\">List 3<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:last-child{ color:#a94442}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:nth-child(n)<\/td>\n<td>Targets only <strong>nth child<\/strong> of parent element. n is a numeric value. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li>List 1<\/li>\n<li class=\"text-danger\">List 2<\/li>\n<li>List 3<\/li>\n<li>List 4<\/li>\n<li class=\"text-info\">List 5<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:nth-child(2){ color:#a94442}\r\n ul li:nth-child(5){ color:#31708f}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n     &lt;li&gt;List 4&lt;\/li&gt;\r\n     &lt;li&gt;List 5&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:nth-child(odd)<\/td>\n<td>Targets only <strong>odd children<\/strong> of parent element. n is a numeric value. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li class=\"text-danger\">List 1<\/li>\n<li>List 2<\/li>\n<li class=\"text-danger\">List 3<\/li>\n<li>List 4<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:nth-child(odd){ color:#a94442}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n     &lt;li&gt;List 4&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:nth-child(even)<\/td>\n<td>Targets only <strong>even children<\/strong> of parent element, ie 2,4,6, etc. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li>List 1<\/li>\n<li class=\"text-danger\">List 2<\/li>\n<li>List 3<\/li>\n<li class=\"text-danger\">List 4<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:nth-child(even){ color:#a94442}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n     &lt;li&gt;List 4&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:nth-of-type(n)<\/td>\n<td>Targets only <strong>nth sibling<\/strong> of type n, starting from first. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li class=\"text-danger\">List 1<\/li>\n<li>List 2<\/li>\n<li>List 3<\/li>\n<li class=\"text-danger\">List 4<\/li>\n<li>List 5<\/li>\n<li>List 6<\/li>\n<li class=\"text-danger\">List 7<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:nth-of-type(3n+1){ color:#a94442}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n     &lt;li&gt;List 4&lt;\/li&gt;\r\n     &lt;li&gt;List 5&lt;\/li&gt;\r\n     &lt;li&gt;List 6&lt;\/li&gt;\r\n     &lt;li&gt;List 7&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:nth-last-of-type(n)<\/td>\n<td>Targets only <strong>nth sibling<\/strong> of element, starting from last. For Exp<\/p>\n<div class=\"bs-example\">\n<ul>\n<li>List 1<\/li>\n<li class=\"text-danger\">List 2<\/li>\n<li>List 3<\/li>\n<li>List 4<\/li>\n<li class=\"text-danger\">List 5<\/li>\n<li>List 6<\/li>\n<li>List 7<\/li>\n<\/ul>\n<pre><code>\r\n&lt;style&gt;\r\n ul li:nth-last-of-type(3n){ color:#a94442}\r\n&lt;\/style&gt;\r\n\r\n &lt;ul&gt;\r\n     &lt;li&gt;List 1&lt;\/li&gt;\r\n     &lt;li&gt;List 2&lt;\/li&gt;\r\n     &lt;li&gt;List 3&lt;\/li&gt;\r\n     &lt;li&gt;List 4&lt;\/li&gt;\r\n     &lt;li&gt;List 5&lt;\/li&gt;\r\n     &lt;li&gt;List 6&lt;\/li&gt;\r\n     &lt;li&gt;List 7&lt;\/li&gt;\r\n &lt;\/ul&gt;       \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:empty<\/td>\n<td>An element having <strong>no child<\/strong> element. For Exp<\/p>\n<div class=\"bs-example\">\n<p>This is a para with content.<\/p>\n<p>Another para with content.<\/p>\n<pre><code>\r\n&lt;style&gt;\r\n p:empty{ border:solid 2px red}\r\n&lt;\/style&gt;\r\n\r\n&lt;p&gt;This is a para with content&lt;\/p&gt;                            \r\n&lt;p&gt;&lt;\/p&gt;                            \r\n&lt;p&gt;Another para withh content.&lt;\/p&gt;                            \r\n&lt;p&gt;&lt;\/p&gt;                            \r\n                         \r\n                        <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<tr>\n<td>:lang()<\/td>\n<td>An element having <strong>lang attribute<\/strong> with given value. For Exp<\/p>\n<div class=\"bs-example\">\n<p>Hello frind, how do you do?.<\/p>\n<p><i>Hola amigo, \u00bfc\u00f3mo se hace?<\/i><\/p>\n<pre><code>\r\n&lt;style&gt;\r\n p:lang(es){ color:red; font-style:italic}\r\n&lt;\/style&gt;\r\n\r\n&lt;p&gt;This is a para with content&lt;\/p&gt;                            \r\n&lt;p lang=\"es\"&gt;Hola amigo, \u00bfc\u00f3mo se hace?&lt;\/p&gt;                            \r\n                    <\/code><\/pre>\n<\/div>\n<\/td>\n<td class=\"text-center\">3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"alert alert-danger\">\n<p class=\"lead\"><strong>:first-child<\/strong>, <strong>:first-letter<\/strong>, <strong>:first-line<\/strong> will be supported in IE 7 and 8. But <strong>Level 3<\/strong> selectors will supported only in IE 9 and above browsers.<\/p>\n<\/div>\n<div class=\"well\">\n<p class=\"lead\"><strong>CSS-3<\/strong> <strong>opacity<\/strong> sets the <strong>opaqueness<\/strong> of the element. The value of <strong>CSS3 opacity<\/strong> is a floating value, between 0 and 1.<br \/>\n0 defines the element as <strong>fully transparent<\/strong>( <i>same like visibility:hidden<\/i>), whereas an opacity value 1 means the element is fully opaque( <i>default<\/i>).<\/p>\n<div class=\"panel panel-default\">\n<div class=\"panel-heading\">\n<h2 class=\"h4\">CSS3 Opacity<\/h2>\n<\/div>\n<div class=\"panel-body\">\n<p>Possible values of opacity<\/p>\n<\/div>\n<table class=\"table table-bordered\">\n<tbody>\n<tr class=\"success\">\n<th>Opacity<\/th>\n<th>values<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>default opacity of all elements.<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>Opacity 0 shows element as <strong>fully transparent<\/strong>. Same like (<i>visibility:hidden<\/i>)<\/td>\n<\/tr>\n<tr>\n<td>0.5<\/td>\n<td>Opacity 0.5 shows element as <strong>half transparent<\/strong>. Thus we can see background colors and images.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<hr \/>\n<p><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-4936639296773650\" data-ad-slot=\"7512016927\" data-ad-format=\"auto\"><\/ins><\/p>\n<h2>How to use opacity<\/h2>\n<p class=\"lead\">Opacity values are always <strong>floating values<\/strong>, minimum value is 0, and maximum value is 1.<\/p>\n<div class=\"highlight\">\n<div class=\"bs-example\">\n<pre>            <code>\r\n &lt;style&gt;           \r\n    .img-1{opacity:1}\t\t\t\t\r\n    .img-2{opacity:0.8}\t\t\t\t\r\n    .img-3{opacity:0.5}\t\t\t\t\r\n    .img-4{opacity:0.2}\t\t\t\t\r\n&lt;\/style&gt;\r\n &lt;div&gt;     \r\n     &lt;img class=\"img-1\" src=\"images\/logo.png\" alt=\"Tech Altum\"&gt; \r\n     &lt;img class=\"img-2\" src=\"images\/logo.png\" alt=\"Tech Altum\"&gt; \r\n     &lt;img class=\"img-3\" src=\"images\/logo.png\" alt=\"Tech Altum\"&gt; \r\n     &lt;img class=\"img-4\" src=\"images\/logo.png\" alt=\"Tech Altum\"&gt; \r\n                   \t\r\n &lt;\/div&gt;                   \t\r\n           \t\t\r\n            <\/code>\r\n<\/pre>\n<div class=\"row\">\n<div class=\"col-md-3\"><img class=\"img-responsive\" src=\"http:\/\/tutorial.techaltum.com\/images\/logo.png\" alt=\"tech altum\" \/><\/p>\n<p class=\"text-danger text-center lead\">Opacity:1<\/p>\n<\/div>\n<div class=\"col-md-3\"><img class=\"img-responsive\" src=\"http:\/\/tutorial.techaltum.com\/images\/logo.png\" alt=\"tech altum\" \/><\/p>\n<p class=\"text-danger text-center lead\">Opacity:0.8<\/p>\n<\/div>\n<div class=\"col-md-3\"><img class=\"img-responsive\" src=\"http:\/\/tutorial.techaltum.com\/images\/logo.png\" alt=\"tech altum\" \/><\/p>\n<p class=\"text-danger text-center lead\">Opacity:0.5<\/p>\n<\/div>\n<div class=\"col-md-3\"><img class=\"img-responsive\" src=\"http:\/\/tutorial.techaltum.com\/images\/logo.png\" alt=\"tech altum\" \/><\/p>\n<p class=\"text-danger text-center lead\">Opacity:0.2<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr \/>\n<p><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-4936639296773650\" data-ad-slot=\"7512016927\" data-ad-format=\"auto\"><\/ins><\/p>\n<h2>Opacity in IE8 and below<\/h2>\n<p class=\"lead\">Internet Explorer 8 and below doesn&#8217;t support opacity. But using <strong>css filter property<\/strong>, opacity can works even on old IE versions like IE 8, 7 , 6 and 5.<\/p>\n<div class=\"bs-example\">\n<h3>Opacity in Internet Explorer IE8 and below<\/h3>\n<pre><code>\r\n&lt;style&gt;\r\n.box{ \r\n    opacity:0.5;                      \/*latest Browsers*\/\r\n    filter: alpha(opacity=50)         \/*IE 5-7*\/\r\n    -ms-filter: alpha(opacity=50)     \/*IE 8*\/\r\n}\r\n&lt;\/style&gt;\r\n                                    \r\n                  \r\n              <\/code><\/pre>\n<\/div>\n<hr \/>\n<div class=\"alert alert-danger\">\n<p class=\"\">Note: opacity is supported in html5 based browsers only. IE 8 and below doesn&#8217;t support opacity. For old IE versions, use filter:alpha(opacity=n), where n is a number between 0-100.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>CSS-3 is the latest version of CSS, the stylesheet language of web with new selectors, shadows, multiple backgrounds, gradients, transition, animations, embedded fonts and responsive layouts. CSS3 Features New Features Uses New Selectors Better Selections of HTML Elements Shadows Effect Box shadow and text shadow for shadow effects Rounded Corners Easily round the corners of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4578,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[5],"tags":[122],"_links":{"self":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/4577"}],"collection":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/comments?post=4577"}],"version-history":[{"count":0,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/4577\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media\/4578"}],"wp:attachment":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media?parent=4577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/categories?post=4577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/tags?post=4577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}