{"id":402,"date":"2015-08-07T11:42:50","date_gmt":"2015-08-07T11:42:50","guid":{"rendered":"http:\/\/fazilabdulkhadar.com\/?p=402"},"modified":"2021-02-23T10:06:02","modified_gmt":"2021-02-23T10:06:02","slug":"difference-between-pseudo-classes-and-pseudo-elements","status":"publish","type":"post","link":"http:\/\/fazilabdulkhadar.com\/index.php\/2015\/08\/07\/difference-between-pseudo-classes-and-pseudo-elements\/","title":{"rendered":"Difference between Pseudo-Classes and Pseudo-Elements"},"content":{"rendered":"<p>A.: Pseudo-Classes &#8211; Pseudo-Classes are specified a special state of the element to be selected. In other word, Pseudo-classes are target elements that match certain criteria or state.<br \/>\nFeatures<br \/>\nPseudo class is signified by a single colon (:) followed by the name of a Pseudo class.<br \/>\nExample<br \/>\n1.: hover &#8211; Style an element when a user mouses over it.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1061 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/43.jpeg\" alt=\"\" width=\"428\" height=\"66\" data-sizes=\"auto\" data-srcset=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/43.jpeg 428w, http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/43-300x46.jpeg 300w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/div>\n<p>2.: visited,: link &#8211; Style visited and unvisited links differently<br \/>\n3.: focus &#8211; Style an element when an element has received focus, either from the user selecting it with the use of a keyboard.<\/p>\n<p><strong>List of Pseudo-classes<\/strong><br \/>\n:active, :checked, :default, :dir(), :disabled, :empty, :enabled, :first, :first-child, :first-of-type, :fullscreen, :focus, :hover, :indeterminate, :in-range, :invalid, :lang(), :last-child,\u00a0:last-of-type, :left, :link, :not(), :nth-child(), :nth-last-child(), :nth-last-of-type(), :nth-of-type(), :only-child, :only-of-type, :optional, :out-of-range, :read-only, :read-write, :required, :right, :root, :scope, :target, :valid, :visited<\/p>\n<p><strong>B.:: Pseudo-elements<\/strong> &#8211; \u00a0Pseudo-elements allow you to style certain parts of a document.<br \/>\n<strong>Features<\/strong><br \/>\n* Pseudo-elements is signified by a two colon (::) followed by the name of a Pseudo class.<br \/>\n* IE8 will not support the Pseudo-elements.<br \/>\n* If your browser supports two colon Pseudo-elements that also support the single colon Pseudo-classes.<br \/>\n<strong>Example<\/strong><br \/>\n1. ::first-letter &#8211; Style the first letter of a element.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1062 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/44.jpeg\" alt=\"\" width=\"469\" height=\"129\" data-sizes=\"auto\" data-srcset=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/44.jpeg 469w, http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/44-300x83.jpeg 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/div>\n<p>2.::first-line &#8211; Style the first line of an element.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1063 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/45.jpeg\" alt=\"\" width=\"469\" height=\"156\" data-sizes=\"auto\" data-srcset=\"http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/45.jpeg 469w, http:\/\/fazilabdulkhadar.com\/wp-content\/uploads\/2020\/09\/45-300x100.jpeg 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/div>\n<p><strong>List of Pseudo-elements<\/strong><br \/>\n::after, ::before, ::first-letter, ::first-line, ::selection, ::backdrop<\/p>\n<p><strong>Remember<\/strong>:\u00a0Pseudo class is signified by a single colon (<strong>:<\/strong>)followed by the name of a Pseudo class and\u00a0Pseudo elements is signified by a two colon (<strong>::<\/strong>) followed by the name of a Pseudo class.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A.: Pseudo-Classes &#8211; Pseudo-Classes are specified a special state of the element to be selected. In other word, Pseudo-classes are target elements that match certain criteria or state. Features Pseudo class is signified by a single colon (:) followed by the name of a Pseudo class. Example 1.: hover &#8211; Style an element when a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":403,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-402","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html"],"_links":{"self":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts\/402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/comments?post=402"}],"version-history":[{"count":3,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts\/402\/revisions"}],"predecessor-version":[{"id":1065,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/posts\/402\/revisions\/1065"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/media\/403"}],"wp:attachment":[{"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/media?parent=402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/categories?post=402"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fazilabdulkhadar.com\/index.php\/wp-json\/wp\/v2\/tags?post=402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}