{"id":631,"date":"2022-11-09T12:03:40","date_gmt":"2022-11-09T12:03:40","guid":{"rendered":"https:\/\/www.devopstrainer.in\/blog\/?p=631"},"modified":"2022-11-09T12:03:40","modified_gmt":"2022-11-09T12:03:40","slug":"what-is-selector-and-universal-selector","status":"publish","type":"post","link":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/","title":{"rendered":"What is selector and  universal selector?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Universal Selector<\/h2>\n\n\n\n<p>A universal selector is a selector that matches any element type&#8217;s name instead of selecting elements of a particular type.\u00a0The universal selector becomes helpful when you wish to put a specific style in all the HTML elements within your web page<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"253\" src=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg\" alt=\"\" class=\"wp-image-632\" srcset=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg 550w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG-300x138.jpg 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">syntax<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>* {\r\n     property : value;\r\n  }<\/code><\/pre>\n\n\n\n<p>uses the asterisk (&#8220;*&#8221;) symbol used for denoting the selector as a universal selector. It is usually written as an asterisk followed by a selector. The * is used for selecting all elements. This asterisk also has the capability to select all elements that are inside another element.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>* {\r\n     margin : 0px;\r\n     padding : 0px;\r\n  }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">There are some additional properties of Universal selector, where you can make use of a combination of asterisk with namespace:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>ns|* &#8211; this will allow you to match all elements within the namespace ns.<\/li><li>*|* &#8211; this will allow you to match simply all elements.<\/li><li>|* &#8211; this will allow you to match all elements that are without any declared namespace.<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Selectors<\/h1>\n\n\n\n<p>CSS selectors\u00a0are used\u00a0<em>to select the content you want to style<\/em>. Selectors are the part of CSS rule set. CSS selectors select HTML elements according to its id, class, type, attribute etc.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"413\" src=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/CSS-Selectors.png\" alt=\"\" class=\"wp-image-633\" srcset=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/CSS-Selectors.png 648w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/CSS-Selectors-300x191.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">There are several different types of selectors in CSS.<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>CSS Element Selector<\/li><li>CSS Id Selector<\/li><li>CSS Class Selector<\/li><li>CSS Universal Selector<\/li><li>CSS Group Selector<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>  \r\n&lt;html>  \r\n&lt;head>  \r\n&lt;style>  \r\np{  \r\n    text-align: center;  \r\n    color: blue;  \r\n}   \r\n&lt;\/style>  \r\n&lt;\/head>  \r\n&lt;body>  \r\n&lt;p>This style will be applied on every paragraph.&lt;\/p>  \r\n&lt;p id=\"para1\">Me too!&lt;\/p>  \r\n&lt;p>And me!&lt;\/p>  \r\n&lt;\/body>  \r\n&lt;\/html><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Universal Selector A universal selector is a selector that matches any element type&#8217;s name instead of selecting elements of a particular type.\u00a0The universal selector becomes helpful when you wish to&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-631","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is selector and universal selector? - DevOps | SRE | DevSecOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is selector and universal selector? - DevOps | SRE | DevSecOps\" \/>\n<meta property=\"og:description\" content=\"Universal Selector A universal selector is a selector that matches any element type&#8217;s name instead of selecting elements of a particular type.\u00a0The universal selector becomes helpful when you wish to&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps | SRE | DevSecOps\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-09T12:03:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg\" \/>\n<meta name=\"author\" content=\"shivam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shivam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\"},\"author\":{\"name\":\"shivam\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"headline\":\"What is selector and universal selector?\",\"datePublished\":\"2022-11-09T12:03:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\"},\"wordCount\":217,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\",\"name\":\"What is selector and universal selector? - DevOps | SRE | DevSecOps\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg\",\"datePublished\":\"2022-11-09T12:03:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg\",\"contentUrl\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg\",\"width\":550,\"height\":253},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.devopstrainer.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is selector and universal selector?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/\",\"name\":\"DevOps | SRE | DevSecOps\",\"description\":\"Automation means Cost, Quality, Time\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\",\"name\":\"shivam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"caption\":\"shivam\"},\"url\":\"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is selector and universal selector? - DevOps | SRE | DevSecOps","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/","og_locale":"en_US","og_type":"article","og_title":"What is selector and universal selector? - DevOps | SRE | DevSecOps","og_description":"Universal Selector A universal selector is a selector that matches any element type&#8217;s name instead of selecting elements of a particular type.\u00a0The universal selector becomes helpful when you wish to&hellip;","og_url":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/","og_site_name":"DevOps | SRE | DevSecOps","article_published_time":"2022-11-09T12:03:40+00:00","og_image":[{"url":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg","type":"","width":"","height":""}],"author":"shivam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"shivam","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#article","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/"},"author":{"name":"shivam","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"headline":"What is selector and universal selector?","datePublished":"2022-11-09T12:03:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/"},"wordCount":217,"commentCount":0,"image":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/","url":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/","name":"What is selector and universal selector? - DevOps | SRE | DevSecOps","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage"},"image":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg","datePublished":"2022-11-09T12:03:40+00:00","author":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"breadcrumb":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#primaryimage","url":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg","contentUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/FLO2NVMUUAgBIUG.jpg","width":550,"height":253},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-selector-and-universal-selector\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopstrainer.in\/blog\/"},{"@type":"ListItem","position":2,"name":"What is selector and universal selector?"}]},{"@type":"WebSite","@id":"https:\/\/www.devopstrainer.in\/blog\/#website","url":"https:\/\/www.devopstrainer.in\/blog\/","name":"DevOps | SRE | DevSecOps","description":"Automation means Cost, Quality, Time","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53","name":"shivam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","caption":"shivam"},"url":"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":1,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/631\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/631\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/media?parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/categories?post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/tags?post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}