{"id":46795,"date":"2017-04-10T16:29:56","date_gmt":"2017-04-10T10:59:56","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=46795"},"modified":"2017-04-11T16:40:29","modified_gmt":"2017-04-11T11:10:29","slug":"advanced-features-of-html5-and-css3","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/advanced-features-of-html5-and-css3\/","title":{"rendered":"Advanced Features of HTML5 and CSS3"},"content":{"rendered":"<p style=\"text-align: justify\">HTML was simply perceived as a markup language some years back. With an advancement in HTML and birth of CSS media queries, the web has evolved drastically. HTML5 and CSS3 media queries are both allowing developers to go the extra mile and deliver a superior web as well as mobile experience to the viewers.<\/p>\n<p style=\"text-align: justify\">This blog will take you through some attractive features of HTML5 and CSS3 enabling you to enhance the look and feel of your web properties.<\/p>\n<p style=\"text-align: justify\"><strong>1. Editing content within the elements<br \/>\n<\/strong>You can edit content within an element by using an HTML attribute called contenteditable. There is a CSS property -webkit-user-modify similar to<strong>\u00a0<\/strong>contenteditable\u00a0which determines whether or not a user can edit the content. The default value is always read-only and read-write value of -webkit-user-modify allows the user to edit the content. Here&#8217;s an example:<\/p>\n<p>[js] &lt;h2 contenteditable=true&gt;You can edit me&lt;\/h2&gt;<br \/>\nh2{<br \/>\n-webkit-user-modify:read-write;<br \/>\n}<br \/>\n[\/js]<\/p>\n<p style=\"text-align: justify\"><strong>2. Form attribute required<\/strong><br \/>\nThis particular feature ensures that the form is not\u00a0submitted if an input box with required attribute is empty. \u00a0The required attribute can also be used as a selector to style the element. Here&#8217;s an example:<\/p>\n<p>[js]&lt;input type=&quot;text&quot; name=&quot;required Field&quot;  required=&quot;required&quot;&gt;<br \/>\ninput:required{<br \/>\nbackground:red;<br \/>\n}<br \/>\n[\/js]<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/required.jpg\" alt=\"Required attribute\" \/><\/p>\n<p style=\"text-align: justify\"><strong>3. Regular expressions<\/strong><br \/>\nVerifying textbox is simple. For verifying any particular textbox, we can insert regular expression directly into an element. We can check a textbox value against the regular expression specified in the pattern attribute. Here&#8217;s an example<\/p>\n<p>[js]&lt;input type=&quot;text&quot;  name=&quot;rollno&quot;  pattern=&quot;[0-9]{5}&quot;&gt;[\/js]<\/p>\n<p style=\"text-align: justify\">In the above example, input box should contain only five characters (the characters can only be numerals)<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/regex.jpg\" alt=\"Regex expression\" \/><\/p>\n<p style=\"text-align: justify\"><strong>4. Figure tag<br \/>\n<\/strong>Figure tag includes figcaption\u00a0tag through which we can associate captions with an image element. Apart from images, we can also include audio, video, chart,\u00a0SVG, and <a href=\"http:\/\/www.tothenew.com\/blog\/tutorial-to-create-a-circular-progress-bar-with-canvas\/\">canvas<\/a> in the figure tag. Here&#8217;s an example<\/p>\n<p>[js]&lt;figure&gt;<br \/>\n\t&lt;img src=&quot;\/blog\/wp-ttn-blog\/uploads\/2017\/03\/productimg.png&quot;&gt;<br \/>\n\t&lt;figcaption&gt;<br \/>\n\t&lt;p&gt;Image of birds&lt;\/p&gt;<br \/>\n\t&lt;\/figcaption&gt;<br \/>\n\t&lt;\/figure&gt;<br \/>\n[\/js]<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/figure.jpg\" alt=\"Figure Tag\" \/><\/p>\n<p style=\"text-align: justify\"><strong>5. SVG element<\/strong><br \/>\nThe SVG element can be used to draw various shapes on a web page since these are vector based. They can also be scaled, up or down to any extent without losing the image quality. Here&#8217;s an example<\/p>\n<p>[js]&lt;svg xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; viewBox=&quot;0 0 64.47 53.44&quot;&gt; &lt;path id=&quot;Shape_5_copy&quot; data-name=&quot;Shape 5 copy&quot; class=&quot;rewind-svg gray-icon&quot; d=&quot;M2758.62,4719.2l28.92-23.09a1.538,1.538,0,0,1,.98-0.34,1.633,1.633,0,0,1,.71.16,1.672,1.672,0,0,1,.9,1.49v19.26l25.75-20.57a1.585,1.585,0,0,1,.99-0.34,1.56,1.56,0,0,1,.7.16,1.672,1.672,0,0,1,.9,1.49v46.16a1.672,1.672,0,0,1-.9,1.49,1.56,1.56,0,0,1-.7.16,1.585,1.585,0,0,1-.99-0.34l-25.75-20.57v19.26a1.672,1.672,0,0,1-.9,1.49,1.633,1.633,0,0,1-.71.16,1.538,1.538,0,0,1-.98-0.34l-28.92-23.09A1.673,1.673,0,0,1,2758.62,4719.2Z&quot; transform=&quot;translate(-2756 -4693.78)&quot;&gt;&lt;\/path&gt;<br \/>\n &lt;\/svg&gt;<br \/>\n[\/js]<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/reverse.jpg\" alt=\"svg Tag\" \/><\/p>\n<p style=\"text-align: justify\"><strong>6.\u00a0Webfonts<\/strong><br \/>\nWith the help of @fontface rule, we can include any source file for fonts. At a later point, we can refer it through font-family declaration. Here&#8217;s an example<\/p>\n<p>@font-face {<br \/>\nfont-family: &#8216;opensanssemi&#8217;;<br \/>\nsrc: url(&#8220;..\/fonts\/OpenSans-Semibold.ttf&#8221;) format(&#8220;truetype&#8221;);<br \/>\n}<br \/>\nElement font-family will be:<br \/>\np{<br \/>\nfont-family:opensanssemi;<br \/>\n}<\/p>\n<p style=\"text-align: justify\"><strong>7. Gradient<\/strong><br \/>\nGradient displays a combination of two or more colors. They can either be linear or radial. For the responsive\u00a0layouts, it is better to use gradient image over the background image. Here&#8217;s an example:<\/p>\n<p style=\"text-align: justify\">background: -webkit-linear-gradient(to bottom,rgba(36,4,3,.8) 41%,rgba(0,0,0,0) 100%);<br \/>\nbackground: linear-gradient(to bottom,rgba(36,4,3,.8) 41%,rgba(0,0,0,0) 100%);<\/p>\n<p style=\"text-align: justify\">Below is the example of a linear gradient changing color from dark to light brown<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/04\/button.jpg\" alt=\"Gradient Tag\" \/><\/p>\n<p style=\"text-align: justify\"><strong>8. Animation and Transition<\/strong><br \/>\nWe can use both Transition and Animation when it is required to change an element from one state to another. The difference is that <a href=\"http:\/\/www.tothenew.com\/blog\/slide-in-animation-while-scrolling-page\/\">animation<\/a> can be made up of multiple states, providing control over its animation. Here&#8217;s an example<\/p>\n<p>@-webkit-keyframes expand-bottom-overlay {<br \/>\n0% {<br \/>\ntop: -6.5em; }<br \/>\n100% {<br \/>\ntop: 0;<br \/>\n} }<\/p>\n<p style=\"text-align: justify\">This will animate element from -6.5em to 0<\/p>\n<p style=\"text-align: justify\">These are some of the most advanced features of HTML5 and CSS3 media queries. You will be able to implement them and improve your user experience drastically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML was simply perceived as a markup language some years back. With an advancement in HTML and birth of CSS media queries, the web has evolved drastically. HTML5 and CSS3 media queries are both allowing developers to go the extra mile and deliver a superior web as well as mobile experience to the viewers. This [&hellip;]<\/p>\n","protected":false},"author":1030,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":64},"categories":[3429,1],"tags":[355,4860,378],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46795"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1030"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=46795"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46795\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=46795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=46795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=46795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}