{"id":98,"date":"2018-07-26T08:43:24","date_gmt":"2018-07-26T08:43:24","guid":{"rendered":"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=98"},"modified":"2018-08-02T06:12:38","modified_gmt":"2018-08-02T06:12:38","slug":"css","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/chapter\/css\/","title":{"rendered":"CSS"},"content":{"raw":"<div>\r\n\r\n<strong>Introduction<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>CSS <\/strong>stands for<strong> \u201cCascading Style Sheets\u201d <\/strong>which is a technology to control how elements are presented in the Web page.The term <em>Cascading<\/em> refers to the procedure that determines which style will apply to a certain section, if we have more than one style rule.The term <em>Style<\/em> refers to how you want a certain part of our page to look. We can set colors, fonts, alignment, borders, backgrounds, spacing, margins, and much more.The term <em>Sheets<\/em> represents that the \u201csheets\u201d are like templates, or a set of rules, for determining how the webpage will look.So, CSS (all together) is a <strong><em>styling language<\/em><\/strong> that defines a set of rules to tell browsers how the webpage should look.A style sheet is a document that contains style information about one or more documents written in markup languages. It enables us to control rendering of styles such as fonts, color, type face, size and other aspects of document style.<\/p>\r\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;font-size: 1em\">\u00a0<\/strong><\/p>\r\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;font-size: 1em\">What is \u201cStyle\u201d?<\/strong><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">\u00a0\u201cStyle\u201d is a command that you set to tell the browser how a certain section of your webpage should look.You can apply style on many HTML \u201celements like &lt;p&gt; &lt;h1&gt; &lt;table&gt; etc.<\/p>\r\n&nbsp;\r\n\r\n<strong>Advantages:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Most of the browsers cache external style sheets. So, once a style sheet is cached, there is no delay in document presentation.The size of a document using external style sheet is comparatively smaller and hence, download time is also smaller. This speeds up overall response time.<\/p>\r\n&nbsp;\r\n\r\n<strong>How to write style rules?<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">There are two parts when we write style rules: (1) <strong><em>selector<\/em><\/strong> and (2) <strong><em>declaration<\/em>.<\/strong>Selector: It is the HTML element that you want to add style to. For e.g. &lt;p&gt; &lt;h1&gt; &lt;table&gt; etc.Declaration: It is the statement of style for that element. It is made up of <em>property<\/em> and <em>value<\/em>.They are defined as,<\/p>\r\n&nbsp;\r\n\r\nSelector {declaration;}\r\n\r\nDeclaration = {property: value;}\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Property: <\/strong>defines what aspect you want to change. For e.g. color, font, margins, etc<strong>. Value<\/strong>: defines the exact setting for that aspect. For e.g. red, italic, 40px, etc.<strong> <em>Examples:<\/em><\/strong><\/p>\r\n&nbsp;\r\n\r\nh1 {color: red;}\r\n\r\nh1 {color: blue; background-color: green;}\r\n\r\n&nbsp;\r\n\r\n<strong>Where to put the style rules?<\/strong>\r\n\r\n&nbsp;\r\n\r\nThere are <strong><em>4 ways<\/em><\/strong> to attach CSS to a page:\r\n\r\n&nbsp;\r\n\r\n<strong>Inline Style Sheet<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 - CSS is not attached in the &lt;header&gt; but is used directly within HTML tags.\r\n\r\n&nbsp;\r\n\r\n<strong>Internal Style Sheet<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 - Best used to control styling on one page.\r\n\r\n&nbsp;\r\n\r\n<strong>External Style Sheet<\/strong>\u00a0\u00a0\u00a0\u00a0 - Best used to control styling on multiple pages.\r\n\r\n&nbsp;\r\n\r\n<strong>Imported Style Sheet<\/strong>\u00a0\u00a0\u00a0 - To import CSS from other style sheets.\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 <\/strong>\r\n\r\n<strong>Inline Style sheet<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe style information is incorporated directly into the HTML tags.\r\n\r\n&nbsp;\r\n\r\n&lt;\/head&gt;\r\n\r\n<strong>&lt;body&gt;<\/strong>\r\n\r\n&lt;p style= \u201ctext-align: center;\r\n\r\nfont-weight: bold;\r\n\r\ncolor: yellow;\u201d&gt;What was I thinking?&lt;\/p&gt;\r\n\r\n<strong>&lt;\/body&gt;<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>Internal Style sheet<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe style information is placed under the style tag in the head section of an HTML page. <strong>&lt;head&gt;<\/strong>&lt;title&gt;My Wonderful Example\r\n\r\n&nbsp;\r\n\r\n&lt;\/title&gt;\r\n\r\n&lt;style type=\u201ctext\/css\u201d&gt;\r\n\r\nbody\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\r\ntext-align: left;\r\n\r\nfont-family: trebuchet, verdana;\r\n\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n<strong>&lt;\/head&gt;<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>External Style sheet<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">External style sheet is specified using the HTML <strong>&lt;link&gt;<\/strong> tag. The Style information is written in a separate file and is referenced from an HTML document.An external style sheet is useful when the same style is applied on different documents. &lt;html&gt;<\/p>\r\n&nbsp;\r\n\r\n<strong>&lt;head&gt;<\/strong>&lt;title&gt;My Way&lt;\/title&gt;\r\n\r\n&lt;link rel=\"stylesheet\"\u00a0\u00a0 href=\"http:\/\/www.annauniv.edu\/~myway.css\" type=\"text\/css\u201c&gt;\r\n\r\n<strong>&lt;\/head&gt;<\/strong>\r\n\r\n&lt;body&gt; &lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0<\/strong>\r\n\r\n<strong>Imported Style Sheet<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">We can import the style sheet using @import statement. The import statement is used within the style tag in an HTML document as follows<\/p>\r\n&nbsp;\r\n\r\n<strong>&lt;style&gt;<\/strong>\r\n\r\n<strong>@import url(\u201cstyle.css\u201d);<\/strong>\r\n\r\n<strong>&lt;\/style&gt;<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong><em>Note<\/em><\/strong><em>: The import statement must be the first rule within a style tag.<\/em>\r\n\r\n&nbsp;\r\n\r\nInternal rules override the conflicting rules in the imported style sheets.\r\n\r\n&nbsp;\r\n\r\n&lt;style&gt;\r\n\r\n@import url(\u201cstyle.css\u201d);\r\n\r\np\u00a0 {color:green;}\r\n\r\n&lt;\/style&gt;\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The above mentioned style rule makes all paragraphs green even if style.css contains a different rule for paragraphs.<\/p>\r\n&nbsp;\r\n\r\n&lt;style type=\"text\/css\u201c &gt;\r\n\r\n@import url(http:\/\/www.xxx.com\/red.css);\r\n\r\n@import url(\/stylesheets\/pink.css); &gt;\r\n\r\n&lt;\/style&gt;\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">A &lt;style&gt; tag may contain an arbitrary number of import statements, but the order in which the style sheets are imported is important in determining cascading styles.<\/p>\r\n&nbsp;\r\n\r\n<strong>Cascading Rules<\/strong>\r\n\r\n&nbsp;\r\n\r\nMore specific rules gets preference over less specific rules.\r\n\r\n&nbsp;\r\n\r\n<strong>p b {color:green;}<\/strong>\r\n\r\n<strong>b{color:Red;}<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In the following example the word \u2018hello\u2019 will be in red whereas the word \u2018world\u2019 will be in green color due to the above mentioned rule.<\/p>\r\n&nbsp;\r\n\r\n<strong>&lt;b&gt;hello&lt;\/b&gt; &lt;p&gt;&lt;b&gt;world&lt;\/b&gt;&lt;\/p&gt;<\/strong>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>Order rules<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe following figure shows the rules for resolving conflicting styles<span style=\"text-align: initial;font-size: 1em\">Inline Internal External Imported Browser\u2019s Style Style Style Style<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\"> Default style <\/span><strong style=\"text-align: initial;font-size: 1em\">---------------------------------------------------------------------------------------------&gt;<\/strong>\r\n\r\n<\/div>\r\n<div>\r\n\r\nHighest priority\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 lowest priority\r\n\r\n&nbsp;\r\n\r\n<strong style=\"text-align: initial;font-size: 1em\">\u00a0Working of CSS<\/strong>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">CSS works in conjunction with HTML. One way is that an HTML file (or multiple files) links to a CSS file (or multiple CSS files) and when the web browser displays the page, it references the CSS file(s) to determine how to display the content.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Another approach is that HTML elements are marked with \u201cIDs\u201d and \u201cclasses,\u201d which are defined in the CSS file and using this the browser knows which styles belong to which element. Each element type (&lt;h1&gt;, &lt;img&gt;, &lt;p&gt;, &lt;li&gt;, etc.) can also be styled with CSS. IDs and classes are defined by the person writing the code and there are no default IDs and classes.<\/p>\r\n&nbsp;\r\n\r\n<strong>Difference between ID and Classes<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">IDs and classes function the same way. They both can provide the same styling functionality to an HTML element, however IDs are unique; each element can only have one ID, and that ID can only be on the page once. Classes are not unique; an element can have multiple classes, and multiple elements can have the same class.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">IDs can be used to style elements that are different from anything else on the page. Classes can be used to style multiple elements on a single page that have things in common, like font size, color, or style.<\/p>\r\n&nbsp;\r\n\r\nThe styles for each element, ID, or class used on an HTML page are defined in a CSS document.\r\n\r\n&nbsp;\r\n\r\nElements are declared with the element (HTML) tag; styles for the element are wrapped with curly brackets like\r\n\r\nh1 {\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\r\nIDs are declared with a hash sign and the ID name; styles for the ID are wrapped with curly brackets like\r\n\r\n#title { }\r\n\r\n&nbsp;\r\n\r\nClasses are declared with a period and the class name; styles for the class are wrapped with curly brackets like\r\n\r\n<\/div>\r\n<div>\r\n\r\n\u00a0 \u00a0 .bodytext\r\n\r\n{\r\n\r\n}\r\n\r\n<\/div>\r\n<strong style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0 \u00a0Anatomy of a style rule<\/strong>\r\n<div>\r\n\r\n&nbsp;\r\n\r\nSelector\r\n\r\n{\r\n\r\nProperty 1 : value 1;\r\n\r\nProperty 2 : value 2;\r\n\r\nProperty N : value N;\r\n\r\n}\r\n\r\n&nbsp;\r\n\r\nThe selector specifies which HTML elements are affected by the style rule.\r\n\r\nThe declaration specifies what the effect will be.\r\n\r\n&nbsp;\r\n\r\n<strong>Grouping Selectors<\/strong>\r\n\r\n&nbsp;\r\n\r\nGroup <strong>the same selector<\/strong> with different declarations together on one line.\r\n\r\n&nbsp;\r\n\r\nh1 {color: black;}\r\n\r\nh1 {font-weight: bold;}\r\n\r\nh1 {background: white;}\r\n\r\n&nbsp;\r\n\r\nThe above declarations can be grouped as,\r\n\r\n&nbsp;\r\n\r\n<strong>h1 {<\/strong>\r\n\r\n<strong>color: black;<\/strong>\r\n\r\n<strong>font-weight: bold;<\/strong>\r\n\r\n<strong>background: white;<\/strong>\r\n\r\n<strong>}<\/strong>\r\n\r\n&nbsp;\r\n\r\nSelectors having common declarations are grouped into a comma-separated list.\r\n\r\n&nbsp;\r\n\r\nh1{color:red;}\r\n\r\nh2{color:red;}\r\n\r\nh3{color:red;}\r\n\r\n&nbsp;\r\n\r\nThe above declarations can be written as\r\n\r\n&nbsp;\r\n\r\n<strong>h1,h2,h3{color:red;}<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>Selectors<\/strong>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0 Selectors are patterns used to select the elements we want to style. Now we will look at the demonstration of the different selectors.<\/span><\/p>\r\n\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 <\/strong>\r\n\r\n<strong>Type selectors<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">A type selector is a simple selector, which is the name of a document element and it matches every single element of the document.<\/p>\r\n&nbsp;\r\n\r\nFor e.g.: The selector b selects every &lt;b&gt; element.\r\n\r\n&nbsp;\r\n\r\n<strong>Universal selector<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">CSS has a special selector *, which matches with every single element in the document. For eg: <strong>*{color:red;}.<\/strong><span style=\"font-size: 1em;text-align: initial\">It makes all the text in the document red.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 \u00a0Compound Selectors<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Selectors can be defined so that a style rule applies to an element only when it is a descendant of a certain other type of element. Examples:<\/p>\r\n&nbsp;\r\n\r\n<strong>ul ul { list-style-type : square }<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">This specifies that an unordered list inside another unordered list will be bulleted by squares.<\/p>\r\n&nbsp;\r\n\r\n<strong>h1 em em { color : red }<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">This specifies that emphasized text inside emphasized text in an <strong>&lt;h1&gt;<\/strong> header will appear in red. Compound selectors are more specific than simple selectors like<\/p>\r\n&nbsp;\r\n\r\n<strong>p { color : red }<\/strong>\r\n\r\n<strong>div p { color : blue }<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>Descendant selectors<\/strong>\r\n\r\n&nbsp;\r\n\r\nA descendant selector selects only those elements that are descendants of a particular element.\r\n\r\n&nbsp;\r\n\r\nFor e.g.\r\n\r\n&lt;div&gt;&lt;b&gt;<strong>C<\/strong>&lt;\/b&gt;ascading&lt;b&gt;<strong>S<\/strong>&lt;\/b&gt;tyle&lt;b&gt;<strong>S<\/strong>&lt;\/b&gt;heet&lt;\/div&gt; &lt;p&gt;descendant&lt;b&gt;selectors&lt;\/b&gt;&lt;\/p&gt;\r\n\r\n<strong>&lt;p&gt;<\/strong>this &lt;b&gt;is&lt;\/b&gt;a<strong>&lt;i&gt;&lt;b&gt;<em>paragraph<\/em>&lt;\/b&gt;&lt;\/i&gt;&lt;\/p&gt;<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">To select all the &lt;b&gt; elements which are descendants of &lt;i&gt; element we need to give as, <strong>p i b<\/strong> which selects the word 'paragraph' from the above text.<\/p>\r\n\r\n<\/div>\r\n<strong style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0Child selectors<\/strong>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Child selectors select elements that are immediate children of a specified element.<\/p>\r\n<p style=\"text-align: justify\">For e.g.: &lt;p&gt;This<strong>&lt;b&gt;<\/strong>is<strong>&lt;\/b&gt;<\/strong>a&lt;i&gt;&lt;b&gt;paragraph&lt;\/b&gt;&lt;\/i&gt;&lt;p&gt; The selector <strong>p&gt;b<\/strong> selects only highlighted &lt;b&gt; elements .<\/p>\r\n<p style=\"text-align: justify\">The selector <strong>p&gt;i&gt;b<\/strong> selects only the &lt;b&gt;element whose parent is the &lt;i&gt;element whose parent is ,in turn the &lt;p&gt; element.<\/p>\r\n&nbsp;\r\n\r\n<strong>Style Classes<\/strong>\r\n\r\n&nbsp;\r\n\r\nStyle classes allow us to control which elements of a given type should use a style rule. This method has two parts:\r\n\r\n&nbsp;\r\n\r\nIn the style sheet, the selector defines the class name, which is preceded by a period.\r\n\r\nIn the HTML, the tag includes the <strong>class<\/strong> attribute and specifies the value of the class name\r\n\r\n&nbsp;\r\n\r\n<strong><em>Example:<\/em><\/strong>\r\n\r\n&nbsp;\r\n\r\nDefine the <strong>nodec<\/strong> class for anchor tags as,\r\n\r\na.nodec { text-decoration : none }\r\n\r\nThis suppresses the usual underlining. Use it in HTML like so, &lt;a class=\"nodec\" href=\"somepage.html\"&gt;Link text&lt;\/a&gt;\r\n\r\nStyle classes can also be \u201cgeneric,\u201d that is not tied to a specific element type.\r\n\r\n&nbsp;\r\n\r\n<strong><em>Example:<\/em><\/strong>\r\n\r\n&nbsp;\r\n\r\nDefine the <strong>zowie<\/strong> class as,\r\n\r\n<strong>.zowie { text-decoration : blink }<\/strong>\r\n\r\nUse it on an emphasized element as,\r\n\r\n<strong>&lt;em class=\"zowie\"&gt;Important!&lt;\/em&gt;<\/strong>\r\n\r\nUse it with no other style attributes as,\r\n\r\n<strong>&lt;span class=\"zowie\"&gt;Buy Now!&lt;\/span&gt;<\/strong>\r\n\r\n<strong>The &lt;span&gt; and &lt;div&gt; Tags<\/strong>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0 These tags are provided to allow arbitrary chunks of HTML to be treated as elements. This is usually done in order to apply style attributes to them, as in the preceding example.<\/span><\/p>\r\n\r\n<div>\r\n<p style=\"text-align: justify\">A <strong>&lt;span&gt;<\/strong> ... <strong>&lt;\/span&gt;<\/strong> element defines an \u201cinline\u201d structure, i.e. it simply defines a stretch of text. Thus it can be used within a paragraph or table element without affecting the flow of the text.<\/p>\r\n<p style=\"text-align: justify\">A <strong>&lt;div&gt;<\/strong> ... <strong>&lt;\/div&gt;<\/strong> element defines a \u201cblock\u201d structure. Usually the browser will place line breaks before and after this element, but otherwise it has no effect itself.<\/p>\r\n&nbsp;\r\n\r\n<strong>Pseudo-classes<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">These are like style classes, but an element acquires a pseudo-class by user action or by a relationship other than descendancy.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">In the style sheet, a pseudo-class name is preceded by a colon.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">In the HTML, the pseudo-class name is NOT used with the affected tag, because it is implied.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Pseudo classes match elements using the information other than their name, content or attribute such as states of an anchor element.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Pseudo elements , on the other hand, address sub-parts of an element such as the first letter of a paragraph.<\/p>\r\n<p style=\"text-align: justify\">The general form is<\/p>\r\n&nbsp;\r\n\r\n<strong>Selector:pseudo-class{declaration}<\/strong>\r\n\r\n<strong>Selector:pseudo-element{declaration}<\/strong>\r\n\r\n<strong>Pseudo Classes and Elements<\/strong>\r\n\r\n<strong>The :first-child, :last-child and only-child pseudo classes<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The <strong>first-child<\/strong> pseudo class selects an element if it is the first child of its parent regardless of what this parent element is.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">For eg: <strong>p:first-child<\/strong> selects all p elements that are the first children of any element.<\/p>\r\n<p style=\"text-align: justify\">The <strong>last-child<\/strong> pseudo class selects the last child element of any element.<\/p>\r\n<p style=\"text-align: justify\">For eg: <strong>p:last-child<\/strong> selects all p elements that are the last children of any element The <strong>only-child<\/strong> pseudo class selects an element if it is the only child of another element.<\/p>\r\n<p style=\"text-align: justify\"><strong>The anchor pseudo classes :link and :visited<\/strong><\/p>\r\n<p style=\"text-align: justify\">The <strong>:link<\/strong> pseudo class applies to hyperlinks that have not been visited.<span style=\"text-align: initial;font-size: 1em\">The <\/span><strong style=\"text-align: initial;font-size: 1em\">:visited<\/strong><span style=\"text-align: initial;font-size: 1em\"> pseudo class applies to hyperlinks that have already been visited at least once.<\/span><\/p>\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">\u00a0For e.g.:<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 a:link {color :blue;}<\/strong>\r\n\r\n<strong>a:visited{color:red;}<\/strong>\r\n\r\n<strong>The dynamic pseudo classes :hover, :active, :focus<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The <strong>:hover<\/strong> pseudo class selects elements that are being designated by the user with a pointing device.<\/p>\r\n<p style=\"text-align: justify\">The <strong>:active<\/strong> pseudo class applies to an element that is currently being activated by the user.<\/p>\r\n<p style=\"text-align: justify\">The <strong>:focus<\/strong> pseudo class applies to an element that has currently got the focus by keyboard events or other means.<\/p>\r\n&nbsp;\r\n\r\n<strong>a:focus {color:green;}<\/strong>\r\n\r\n<strong>a:hover{color:yellow;}<\/strong>\r\n\r\n<strong>a:active{color:pink;}<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>The :first-line pseudo element<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The <strong>:first-line<\/strong> pseudo element allows us to add styles to the first line of an element.<\/p>\r\n<p style=\"text-align: justify\">For e.g.:<\/p>\r\n<p style=\"text-align: justify\"><strong>p:first-line{text-decoration:underline;} <\/strong>underlines the first line of a paragraph.<\/p>\r\n<p style=\"text-align: justify\"><strong>The :first-letter pseudo element<\/strong><\/p>\r\n<p style=\"text-align: justify\">The <strong>:first-letter<\/strong> pseudo element is used to add style to the first letter of the first line of block elements.<\/p>\r\n&nbsp;\r\n\r\nFor e.g.:\r\n\r\n&nbsp;\r\n\r\n<strong>p:first-letter {font-size:300%; float:left;}<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>Example of Pseudo Classes \u2013 first-line<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;style&gt;\r\n\r\np::first-line {\r\n\r\ncolor: #ff0000;\r\n\r\nfont-variant: small-caps;\r\n\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;body&gt;<\/span>\r\n\r\n<\/div>\r\n<div>\r\n<p style=\"text-align: justify\">\u00a0 \u00a0&lt;p&gt;You can use the ::first-line pseudo-element to add a special effect to the first line of a text. Some more text. And even more, and more, and more, and more, and more, and more, and more, and more, and more, and more, and more, and more.&lt;\/p&gt; &lt;\/body&gt;<\/p>\r\n&lt;\/html&gt;\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-99 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41.png\" alt=\"\" width=\"457\" height=\"149\" \/><\/p>\r\n\r\n<div>\r\n<p style=\"text-align: justify\"><strong>\u00a0 \u00a0 \u00a0The :before and :after pseudo elements<\/strong><\/p>\r\n<p style=\"text-align: justify\">The :before pseudo element inserts some new content before an existing element<\/p>\r\n<p style=\"text-align: justify\">The :after pseudo element inserts some new content after an existing element .<\/p>\r\n<p style=\"text-align: justify\">The <strong>content<\/strong> property is used to define the content to be inserted before and after the selected elements.<\/p>\r\n<p style=\"text-align: justify\">For e.g., :<strong>body &gt; ol&gt; li<\/strong> <strong>:before { content: \u201dchapter:\u201d; }<\/strong><\/p>\r\n<p style=\"text-align: justify\">Adds chapter before every &lt;li&gt; element which is a grandchildren of the &lt;body&gt; element.<\/p>\r\n&nbsp;\r\n\r\n<strong>Attribute Selector<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Attribute Selector provide a way of selecting elements depending on the presence of an attribute or the presence of certain attribute values.<\/p>\r\n&nbsp;\r\n\r\n<strong>Simple Attribute Selector<\/strong>\r\n\r\n&nbsp;\r\n\r\nIt selects elements having specified attribute.\r\n\r\nGeneral syntax :\r\n\r\n<strong>element[attribute_name] or<\/strong>\r\n\r\n<strong>[attribute_name]<\/strong>\r\n\r\nFor e.g.: <strong>a[href]<\/strong> selects all &lt;a&gt;elements having the attribute href.\r\n\r\n&nbsp;\r\n\r\n<strong>Attribute Selector - Example<\/strong>\r\n\r\n<\/div>\r\n<span style=\"text-align: initial;font-size: 1em\">\u00a0 &lt;!DOCTYPE html&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;html&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;head&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;style&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">a[target] {<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">background-color: yellow;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">}<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/style&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/head&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;body&gt;<\/span>\r\n<div>\r\n<p style=\"text-align: justify\">\u00a0&lt;p&gt;The links with a target attribute gets a yellow background:&lt;\/p&gt; &lt;a href=\"http:\/\/www.w3schools.com\"&gt;w3schools.com&lt;\/a&gt;<\/p>\r\n&lt;a href=\"http:\/\/www.disney.com\" target=\"_blank\"&gt;disney.com&lt;\/a&gt; &lt;a href=\"http:\/\/www.wikipedia.org\" target=\"_top\"&gt;wikipedia.org&lt;\/a&gt;\r\n<p style=\"text-align: justify\">&lt;p&gt;&lt;b&gt;Note:&lt;\/b&gt; For [&lt;i&gt;attribute&lt;\/i&gt;] to work in IE8 and earlier, a DOCTYPE must be declared.&lt;\/p&gt; &lt;\/body&gt;<\/p>\r\n&lt;\/html&gt;\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-100 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42.png\" alt=\"\" width=\"533\" height=\"100\" \/><\/p>\r\n\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Attribute Value Selector<\/strong>\r\n\r\n&nbsp;\r\n\r\nSelecting elements based on the attribute value.\r\n\r\n&nbsp;\r\n\r\nThe syntax :\r\n\r\n<strong>element[attribute_name=\u201cattribute_Value\u201d]<\/strong>\r\n\r\n<strong>or<\/strong>\r\n\r\n<strong>[attribute_name=\u201cattribute_Value\u201d]<\/strong>\r\n\r\n&nbsp;\r\n\r\nExample:\r\n\r\n&nbsp;\r\n\r\n<strong>p[type=\u201cnote\u201d] <\/strong>selects all &lt;p&gt;elements having the type attribute value \u201cnote\u201d.\r\n\r\n&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;style&gt;\r\n\r\na[target=_blank] { background-color: yellow;}\r\n\r\n&lt;\/style&gt;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/head&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;body&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;p&gt;The link with target=\"_blank\" gets a yellow background:&lt;\/p&gt; &lt;a href=\"http:\/\/www.w3schools.com\"&gt;w3schools.com&lt;\/a&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;a href=\"http:\/\/www.disney.com\" target=\"_blank\"&gt;disney.com&lt;\/a&gt; &lt;a href=\"http:\/\/www.wikipedia.org\" target=\"_top\"&gt;wikipedia.org&lt;\/a&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;p&gt;&lt;b&gt;Note:&lt;\/b&gt; For [&lt;i&gt;attribute&lt;\/i&gt;] to work in IE8 and earlier, a DOCTYPE must be declared.&lt;\/p&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/body&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span>\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-101 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43.png\" alt=\"\" width=\"385\" height=\"116\" \/><\/p>\r\n\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 \u00a0Starts-with attribute value selector<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe selector selects elements having an attribute value that starts with the value specified.\r\n\r\n&nbsp;\r\n\r\nThe general syntax :\r\n\r\n&nbsp;\r\n\r\n<strong>Element[attribute_name^=\u201cattribute_value\u201d]<\/strong>\r\n\r\nFor example, the selector <strong>p[type^=\u201ccopy\u201d]<\/strong> matches\r\n\r\n&lt;p type=\u201ccopyright\u201d&gt;copyright&lt;\/p&gt; as well as &lt;p type=\u201ccopyleft\u201d&gt;copyleft..&lt;\/p&gt;\r\n\r\n&nbsp;\r\n\r\n&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;style&gt;\r\n\r\n[class^=\"top\"] {\r\n\r\nbackground: yellow;\r\n\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1 class=\"top-header\"&gt;Welcome&lt;\/h1&gt;\r\n\r\n&lt;p class=\"top-text\"&gt;Hello world!&lt;\/p&gt;\r\n\r\n&lt;p class=\"top-content\"&gt;Are you learning CSS?&lt;\/p&gt;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">&lt;p&gt;&lt;b&gt;Note:&lt;\/b&gt; For [&lt;i&gt;attribute&lt;\/i&gt;^=&lt;i&gt;value&lt;\/i&gt;] to work in IE8 and earlier, a DOCTYPE must be\u00a0<\/span><span style=\"text-align: initial;font-size: 1em\">declared.&lt;\/p&gt;<\/span><\/p>\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/body&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span>\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-102 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44.png\" alt=\"\" width=\"424\" height=\"169\" \/><\/p>\r\n\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0Ends-with attribute value selector<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">This attribute selects elements having attribute value that ends with the value specified.<\/p>\r\n<p style=\"text-align: justify\">The general syntax :<\/p>\r\n<p style=\"text-align: justify\"><strong>Element[attribute_name$=\u201cattribute_value\u201d]<\/strong><\/p>\r\n<p style=\"text-align: justify\">For e.g.,<\/p>\r\n<p style=\"text-align: justify\"><strong>a[href$=\u201c.com\u201d] - <\/strong>selects those anchor tags that point to .com websites and not any other domains.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Substring match attribute value selector<\/strong><\/p>\r\n<p style=\"text-align: justify\">This selector selects those elements having an attribute value containing at least one occurrence of the<\/p>\r\n<p style=\"text-align: justify\">value specified.<\/p>\r\n<p style=\"text-align: justify\">The general syntax :<\/p>\r\n<p style=\"text-align: justify\"><strong>Element[attribute_name*=\u201cattribute_value\u201d]<\/strong><\/p>\r\n<p style=\"text-align: justify\">For e.g.,<\/p>\r\n<p style=\"text-align: justify\"><strong>a[href*=\u201cimage\u201d] - <\/strong>selects those anchor tags that have image in the href attribute.<\/p>\r\n<p style=\"text-align: justify\"><strong>The Class Selector<\/strong><\/p>\r\n<p style=\"text-align: justify\">This selector is a specific case of one of many attribute value selectors with the attribute name class and \u201c~=\u201c substituted by \u201c.\u201d<\/p>\r\nSo p[class~=\u201cbold\u201d] and p.bold are identical in meaning.\r\n\r\nIt matches &lt;p class=\u201cbold\u201d&gt;..&lt;\/p&gt; as well as &lt;p class=\u201citalic bold\u201d&gt;..&lt;\/p&gt; but not &lt;p class=\u201cleft\u201d&gt;..&lt;\/p&gt;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">Class selectors are useful to control elements that belong to a group as well as to remove limitations of the selector.<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>The Class Selector - Example<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;style&gt;\r\n\r\n.center {\r\n\r\ntext-align: center;\r\n\r\ncolor: red;\r\n\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1 class=\"center\"&gt;Red and center-aligned heading&lt;\/h1&gt;\r\n\r\n&lt;p class=\"center\"&gt;Red and center-aligned paragraph.&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-103 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-45.png\" alt=\"\" width=\"291\" height=\"96\" \/><\/p>\r\n\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>ID Selectors<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The id differs from class in that id identifies a single element whereas class identifies a set of related elements. An id selector selects a single element based on its unique id attribute value regardless of its position in the document tree. An id selector is defined by placing a # symbol before the selector name. The selector p #para1 selects the p elements having id attribute value para1.<\/p>\r\nSo it matches &lt;p id=\u201cpara1\u201d&gt;\u2026&lt;\/p&gt; but not &lt;div id=\u201cpara1\u201d&gt;..&lt;\/div&gt;.\r\n\r\n&nbsp;\r\n\r\n<strong><em>Note: <\/em><\/strong>The id attributes should be unique Id selectors and other selectors can be combined.\r\n\r\n&nbsp;\r\n\r\nFor e.g.:\r\n\r\n&nbsp;\r\n\r\n<strong>&lt;div id=\u201cbook1\u201d&gt;&lt;h1&gt;Web Technology&lt;\/h1&gt;<\/strong>\r\n\r\n<strong>&lt;p&gt;HTML&lt;\/p&gt;<\/strong>\r\n\r\n<strong>&lt;\/div&gt;<\/strong>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">\u00a0And<\/span>\r\n\r\n<strong style=\"text-align: initial;font-size: 1em\">#book1 h1{color:red;} <\/strong><span style=\"text-align: initial;font-size: 1em\">makes the h1 elements in the div tag to be red.<\/span>\r\n\r\n<\/div>\r\n<strong>\u00a0 ID Selectors - Example<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;style&gt;\r\n\r\n#para1 {\r\n\r\ntext-align: center;\r\n\r\ncolor: red;\r\n\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;p id=\"para1\"&gt;Hello World!&lt;\/p&gt;\r\n\r\n&lt;p&gt;This paragraph is not affected by the style.&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n&nbsp;\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-104 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-46.png\" alt=\"\" width=\"332\" height=\"24\" \/><\/p>\r\n&nbsp;\r\n\r\n<strong>Summary<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">This module explains about CSS, adding different style sheets and its anatomy. The module also explores about Selectors, Pseudo Classes and elements. Moreover, the module also discusses about the Attribute Selectors, Class Selectors and ID selectors.<\/p>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>Web Links<\/strong>\r\n<ul>\r\n \t<li><em>www.w3schools.com<\/em><\/li>\r\n \t<li><em>https:\/\/www.uvu.edu\/web\/docs\/<strong>css<\/strong>_basics.<strong>ppt<\/strong>m<\/em><\/li>\r\n \t<li><em>www.hawaii.edu\/lis\/webteam\/workshops\/07fa.wksp3_basic<strong>CSS<\/strong>.<strong>ppt<\/strong><\/em><\/li>\r\n \t<li><em>html<strong>css<\/strong>javascript.com\/downloads\/<strong>css<\/strong>.<strong>ppt<\/strong><\/em><\/li>\r\n \t<li><em>www.dsm.fordham.edu\/moniot\/Classes\/IntroWebM04\/Chapter6-<strong>CSS<\/strong>.<strong>ppt<\/strong><\/em><\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n&nbsp;","rendered":"<div>\n<p><strong>Introduction<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>CSS <\/strong>stands for<strong> \u201cCascading Style Sheets\u201d <\/strong>which is a technology to control how elements are presented in the Web page.The term <em>Cascading<\/em> refers to the procedure that determines which style will apply to a certain section, if we have more than one style rule.The term <em>Style<\/em> refers to how you want a certain part of our page to look. We can set colors, fonts, alignment, borders, backgrounds, spacing, margins, and much more.The term <em>Sheets<\/em> represents that the \u201csheets\u201d are like templates, or a set of rules, for determining how the webpage will look.So, CSS (all together) is a <strong><em>styling language<\/em><\/strong> that defines a set of rules to tell browsers how the webpage should look.A style sheet is a document that contains style information about one or more documents written in markup languages. It enables us to control rendering of styles such as fonts, color, type face, size and other aspects of document style.<\/p>\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;font-size: 1em\">\u00a0<\/strong><\/p>\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;font-size: 1em\">What is \u201cStyle\u201d?<\/strong><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">\u00a0\u201cStyle\u201d is a command that you set to tell the browser how a certain section of your webpage should look.You can apply style on many HTML \u201celements like &lt;p&gt; &lt;h1&gt; &lt;table&gt; etc.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Advantages:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Most of the browsers cache external style sheets. So, once a style sheet is cached, there is no delay in document presentation.The size of a document using external style sheet is comparatively smaller and hence, download time is also smaller. This speeds up overall response time.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>How to write style rules?<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">There are two parts when we write style rules: (1) <strong><em>selector<\/em><\/strong> and (2) <strong><em>declaration<\/em>.<\/strong>Selector: It is the HTML element that you want to add style to. For e.g. &lt;p&gt; &lt;h1&gt; &lt;table&gt; etc.Declaration: It is the statement of style for that element. It is made up of <em>property<\/em> and <em>value<\/em>.They are defined as,<\/p>\n<p>&nbsp;<\/p>\n<p>Selector {declaration;}<\/p>\n<p>Declaration = {property: value;}<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Property: <\/strong>defines what aspect you want to change. For e.g. color, font, margins, etc<strong>. Value<\/strong>: defines the exact setting for that aspect. For e.g. red, italic, 40px, etc.<strong> <em>Examples:<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>h1 {color: red;}<\/p>\n<p>h1 {color: blue; background-color: green;}<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Where to put the style rules?<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>There are <strong><em>4 ways<\/em><\/strong> to attach CSS to a page:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Inline Style Sheet<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; CSS is not attached in the &lt;header&gt; but is used directly within HTML tags.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Internal Style Sheet<\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; Best used to control styling on one page.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>External Style Sheet<\/strong>\u00a0\u00a0\u00a0\u00a0 &#8211; Best used to control styling on multiple pages.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Imported Style Sheet<\/strong>\u00a0\u00a0\u00a0 &#8211; To import CSS from other style sheets.<\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 <\/strong><\/p>\n<p><strong>Inline Style sheet<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The style information is incorporated directly into the HTML tags.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p><strong>&lt;body&gt;<\/strong><\/p>\n<p>&lt;p style= \u201ctext-align: center;<\/p>\n<p>font-weight: bold;<\/p>\n<p>color: yellow;\u201d&gt;What was I thinking?&lt;\/p&gt;<\/p>\n<p><strong>&lt;\/body&gt;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Internal Style sheet<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The style information is placed under the style tag in the head section of an HTML page. <strong>&lt;head&gt;<\/strong>&lt;title&gt;My Wonderful Example<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;\/title&gt;<\/p>\n<p>&lt;style type=\u201ctext\/css\u201d&gt;<\/p>\n<p>body\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/p>\n<p>text-align: left;<\/p>\n<p>font-family: trebuchet, verdana;<\/p>\n<p>}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p><strong>&lt;\/head&gt;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>External Style sheet<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">External style sheet is specified using the HTML <strong>&lt;link&gt;<\/strong> tag. The Style information is written in a separate file and is referenced from an HTML document.An external style sheet is useful when the same style is applied on different documents. &lt;html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>&lt;head&gt;<\/strong>&lt;title&gt;My Way&lt;\/title&gt;<\/p>\n<p>&lt;link rel=&#8221;stylesheet&#8221;\u00a0\u00a0 href=&#8221;http:\/\/www.annauniv.edu\/~myway.css&#8221; type=&#8221;text\/css\u201c&gt;<\/p>\n<p><strong>&lt;\/head&gt;<\/strong><\/p>\n<p>&lt;body&gt; &lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0<\/strong><\/p>\n<p><strong>Imported Style Sheet<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We can import the style sheet using @import statement. The import statement is used within the style tag in an HTML document as follows<\/p>\n<p>&nbsp;<\/p>\n<p><strong>&lt;style&gt;<\/strong><\/p>\n<p><strong>@import url(\u201cstyle.css\u201d);<\/strong><\/p>\n<p><strong>&lt;\/style&gt;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>Note<\/em><\/strong><em>: The import statement must be the first rule within a style tag.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Internal rules override the conflicting rules in the imported style sheets.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>@import url(\u201cstyle.css\u201d);<\/p>\n<p>p\u00a0 {color:green;}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The above mentioned style rule makes all paragraphs green even if style.css contains a different rule for paragraphs.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;style type=&#8221;text\/css\u201c &gt;<\/p>\n<p>@import url(http:\/\/www.xxx.com\/red.css);<\/p>\n<p>@import url(\/stylesheets\/pink.css); &gt;<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">A &lt;style&gt; tag may contain an arbitrary number of import statements, but the order in which the style sheets are imported is important in determining cascading styles.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Cascading Rules<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>More specific rules gets preference over less specific rules.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>p b {color:green;}<\/strong><\/p>\n<p><strong>b{color:Red;}<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In the following example the word \u2018hello\u2019 will be in red whereas the word \u2018world\u2019 will be in green color due to the above mentioned rule.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>&lt;b&gt;hello&lt;\/b&gt; &lt;p&gt;&lt;b&gt;world&lt;\/b&gt;&lt;\/p&gt;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Order rules<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The following figure shows the rules for resolving conflicting styles<span style=\"text-align: initial;font-size: 1em\">Inline Internal External Imported Browser\u2019s Style Style Style Style<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\"> Default style <\/span><strong style=\"text-align: initial;font-size: 1em\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt;<\/strong><\/p>\n<\/div>\n<div>\n<p>Highest priority\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 lowest priority<\/p>\n<p>&nbsp;<\/p>\n<p><strong style=\"text-align: initial;font-size: 1em\">\u00a0Working of CSS<\/strong><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">CSS works in conjunction with HTML. One way is that an HTML file (or multiple files) links to a CSS file (or multiple CSS files) and when the web browser displays the page, it references the CSS file(s) to determine how to display the content.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Another approach is that HTML elements are marked with \u201cIDs\u201d and \u201cclasses,\u201d which are defined in the CSS file and using this the browser knows which styles belong to which element. Each element type (&lt;h1&gt;, &lt;img&gt;, &lt;p&gt;, &lt;li&gt;, etc.) can also be styled with CSS. IDs and classes are defined by the person writing the code and there are no default IDs and classes.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Difference between ID and Classes<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">IDs and classes function the same way. They both can provide the same styling functionality to an HTML element, however IDs are unique; each element can only have one ID, and that ID can only be on the page once. Classes are not unique; an element can have multiple classes, and multiple elements can have the same class.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">IDs can be used to style elements that are different from anything else on the page. Classes can be used to style multiple elements on a single page that have things in common, like font size, color, or style.<\/p>\n<p>&nbsp;<\/p>\n<p>The styles for each element, ID, or class used on an HTML page are defined in a CSS document.<\/p>\n<p>&nbsp;<\/p>\n<p>Elements are declared with the element (HTML) tag; styles for the element are wrapped with curly brackets like<\/p>\n<p>h1 {\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p>IDs are declared with a hash sign and the ID name; styles for the ID are wrapped with curly brackets like<\/p>\n<p>#title { }<\/p>\n<p>&nbsp;<\/p>\n<p>Classes are declared with a period and the class name; styles for the class are wrapped with curly brackets like<\/p>\n<\/div>\n<div>\n<p>\u00a0 \u00a0 .bodytext<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<\/div>\n<p><strong style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0 \u00a0Anatomy of a style rule<\/strong><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p>Selector<\/p>\n<p>{<\/p>\n<p>Property 1 : value 1;<\/p>\n<p>Property 2 : value 2;<\/p>\n<p>Property N : value N;<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>The selector specifies which HTML elements are affected by the style rule.<\/p>\n<p>The declaration specifies what the effect will be.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Grouping Selectors<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Group <strong>the same selector<\/strong> with different declarations together on one line.<\/p>\n<p>&nbsp;<\/p>\n<p>h1 {color: black;}<\/p>\n<p>h1 {font-weight: bold;}<\/p>\n<p>h1 {background: white;}<\/p>\n<p>&nbsp;<\/p>\n<p>The above declarations can be grouped as,<\/p>\n<p>&nbsp;<\/p>\n<p><strong>h1 {<\/strong><\/p>\n<p><strong>color: black;<\/strong><\/p>\n<p><strong>font-weight: bold;<\/strong><\/p>\n<p><strong>background: white;<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Selectors having common declarations are grouped into a comma-separated list.<\/p>\n<p>&nbsp;<\/p>\n<p>h1{color:red;}<\/p>\n<p>h2{color:red;}<\/p>\n<p>h3{color:red;}<\/p>\n<p>&nbsp;<\/p>\n<p>The above declarations can be written as<\/p>\n<p>&nbsp;<\/p>\n<p><strong>h1,h2,h3{color:red;}<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Selectors<\/strong><\/p>\n<\/div>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0 Selectors are patterns used to select the elements we want to style. Now we will look at the demonstration of the different selectors.<\/span><\/p>\n<div>\n<p><strong>\u00a0 \u00a0 <\/strong><\/p>\n<p><strong>Type selectors<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">A type selector is a simple selector, which is the name of a document element and it matches every single element of the document.<\/p>\n<p>&nbsp;<\/p>\n<p>For e.g.: The selector b selects every &lt;b&gt; element.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Universal selector<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">CSS has a special selector *, which matches with every single element in the document. For eg: <strong>*{color:red;}.<\/strong><span style=\"font-size: 1em;text-align: initial\">It makes all the text in the document red.<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0 \u00a0Compound Selectors<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Selectors can be defined so that a style rule applies to an element only when it is a descendant of a certain other type of element. Examples:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ul ul { list-style-type : square }<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This specifies that an unordered list inside another unordered list will be bulleted by squares.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>h1 em em { color : red }<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This specifies that emphasized text inside emphasized text in an <strong>&lt;h1&gt;<\/strong> header will appear in red. Compound selectors are more specific than simple selectors like<\/p>\n<p>&nbsp;<\/p>\n<p><strong>p { color : red }<\/strong><\/p>\n<p><strong>div p { color : blue }<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Descendant selectors<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>A descendant selector selects only those elements that are descendants of a particular element.<\/p>\n<p>&nbsp;<\/p>\n<p>For e.g.<\/p>\n<p>&lt;div&gt;&lt;b&gt;<strong>C<\/strong>&lt;\/b&gt;ascading&lt;b&gt;<strong>S<\/strong>&lt;\/b&gt;tyle&lt;b&gt;<strong>S<\/strong>&lt;\/b&gt;heet&lt;\/div&gt; &lt;p&gt;descendant&lt;b&gt;selectors&lt;\/b&gt;&lt;\/p&gt;<\/p>\n<p><strong>&lt;p&gt;<\/strong>this &lt;b&gt;is&lt;\/b&gt;a<strong>&lt;i&gt;&lt;b&gt;<em>paragraph<\/em>&lt;\/b&gt;&lt;\/i&gt;&lt;\/p&gt;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">To select all the &lt;b&gt; elements which are descendants of &lt;i&gt; element we need to give as, <strong>p i b<\/strong> which selects the word &#8216;paragraph&#8217; from the above text.<\/p>\n<\/div>\n<p><strong style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0Child selectors<\/strong><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Child selectors select elements that are immediate children of a specified element.<\/p>\n<p style=\"text-align: justify\">For e.g.: &lt;p&gt;This<strong>&lt;b&gt;<\/strong>is<strong>&lt;\/b&gt;<\/strong>a&lt;i&gt;&lt;b&gt;paragraph&lt;\/b&gt;&lt;\/i&gt;&lt;p&gt; The selector <strong>p&gt;b<\/strong> selects only highlighted &lt;b&gt; elements .<\/p>\n<p style=\"text-align: justify\">The selector <strong>p&gt;i&gt;b<\/strong> selects only the &lt;b&gt;element whose parent is the &lt;i&gt;element whose parent is ,in turn the &lt;p&gt; element.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Style Classes<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Style classes allow us to control which elements of a given type should use a style rule. This method has two parts:<\/p>\n<p>&nbsp;<\/p>\n<p>In the style sheet, the selector defines the class name, which is preceded by a period.<\/p>\n<p>In the HTML, the tag includes the <strong>class<\/strong> attribute and specifies the value of the class name<\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>Example:<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Define the <strong>nodec<\/strong> class for anchor tags as,<\/p>\n<p>a.nodec { text-decoration : none }<\/p>\n<p>This suppresses the usual underlining. Use it in HTML like so, &lt;a class=&#8221;nodec&#8221; href=&#8221;somepage.html&#8221;&gt;Link text&lt;\/a&gt;<\/p>\n<p>Style classes can also be \u201cgeneric,\u201d that is not tied to a specific element type.<\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>Example:<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Define the <strong>zowie<\/strong> class as,<\/p>\n<p><strong>.zowie { text-decoration : blink }<\/strong><\/p>\n<p>Use it on an emphasized element as,<\/p>\n<p><strong>&lt;em class=&#8221;zowie&#8221;&gt;Important!&lt;\/em&gt;<\/strong><\/p>\n<p>Use it with no other style attributes as,<\/p>\n<p><strong>&lt;span class=&#8221;zowie&#8221;&gt;Buy Now!&lt;\/span&gt;<\/strong><\/p>\n<p><strong>The &lt;span&gt; and &lt;div&gt; Tags<\/strong><\/p>\n<\/div>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">\u00a0 \u00a0 These tags are provided to allow arbitrary chunks of HTML to be treated as elements. This is usually done in order to apply style attributes to them, as in the preceding example.<\/span><\/p>\n<div>\n<p style=\"text-align: justify\">A <strong>&lt;span&gt;<\/strong> &#8230; <strong>&lt;\/span&gt;<\/strong> element defines an \u201cinline\u201d structure, i.e. it simply defines a stretch of text. Thus it can be used within a paragraph or table element without affecting the flow of the text.<\/p>\n<p style=\"text-align: justify\">A <strong>&lt;div&gt;<\/strong> &#8230; <strong>&lt;\/div&gt;<\/strong> element defines a \u201cblock\u201d structure. Usually the browser will place line breaks before and after this element, but otherwise it has no effect itself.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Pseudo-classes<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">These are like style classes, but an element acquires a pseudo-class by user action or by a relationship other than descendancy.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In the style sheet, a pseudo-class name is preceded by a colon.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In the HTML, the pseudo-class name is NOT used with the affected tag, because it is implied.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Pseudo classes match elements using the information other than their name, content or attribute such as states of an anchor element.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Pseudo elements , on the other hand, address sub-parts of an element such as the first letter of a paragraph.<\/p>\n<p style=\"text-align: justify\">The general form is<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Selector:pseudo-class{declaration}<\/strong><\/p>\n<p><strong>Selector:pseudo-element{declaration}<\/strong><\/p>\n<p><strong>Pseudo Classes and Elements<\/strong><\/p>\n<p><strong>The :first-child, :last-child and only-child pseudo classes<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The <strong>first-child<\/strong> pseudo class selects an element if it is the first child of its parent regardless of what this parent element is.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">For eg: <strong>p:first-child<\/strong> selects all p elements that are the first children of any element.<\/p>\n<p style=\"text-align: justify\">The <strong>last-child<\/strong> pseudo class selects the last child element of any element.<\/p>\n<p style=\"text-align: justify\">For eg: <strong>p:last-child<\/strong> selects all p elements that are the last children of any element The <strong>only-child<\/strong> pseudo class selects an element if it is the only child of another element.<\/p>\n<p style=\"text-align: justify\"><strong>The anchor pseudo classes :link and :visited<\/strong><\/p>\n<p style=\"text-align: justify\">The <strong>:link<\/strong> pseudo class applies to hyperlinks that have not been visited.<span style=\"text-align: initial;font-size: 1em\">The <\/span><strong style=\"text-align: initial;font-size: 1em\">:visited<\/strong><span style=\"text-align: initial;font-size: 1em\"> pseudo class applies to hyperlinks that have already been visited at least once.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">\u00a0For e.g.:<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0 a:link {color :blue;}<\/strong><\/p>\n<p><strong>a:visited{color:red;}<\/strong><\/p>\n<p><strong>The dynamic pseudo classes :hover, :active, :focus<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The <strong>:hover<\/strong> pseudo class selects elements that are being designated by the user with a pointing device.<\/p>\n<p style=\"text-align: justify\">The <strong>:active<\/strong> pseudo class applies to an element that is currently being activated by the user.<\/p>\n<p style=\"text-align: justify\">The <strong>:focus<\/strong> pseudo class applies to an element that has currently got the focus by keyboard events or other means.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>a:focus {color:green;}<\/strong><\/p>\n<p><strong>a:hover{color:yellow;}<\/strong><\/p>\n<p><strong>a:active{color:pink;}<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>The :first-line pseudo element<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The <strong>:first-line<\/strong> pseudo element allows us to add styles to the first line of an element.<\/p>\n<p style=\"text-align: justify\">For e.g.:<\/p>\n<p style=\"text-align: justify\"><strong>p:first-line{text-decoration:underline;} <\/strong>underlines the first line of a paragraph.<\/p>\n<p style=\"text-align: justify\"><strong>The :first-letter pseudo element<\/strong><\/p>\n<p style=\"text-align: justify\">The <strong>:first-letter<\/strong> pseudo element is used to add style to the first letter of the first line of block elements.<\/p>\n<p>&nbsp;<\/p>\n<p>For e.g.:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>p:first-letter {font-size:300%; float:left;}<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Example of Pseudo Classes \u2013 first-line<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>p::first-line {<\/p>\n<p>color: #ff0000;<\/p>\n<p>font-variant: small-caps;<\/p>\n<p>}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;body&gt;<\/span><\/p>\n<\/div>\n<div>\n<p style=\"text-align: justify\">\u00a0 \u00a0&lt;p&gt;You can use the ::first-line pseudo-element to add a special effect to the first line of a text. Some more text. And even more, and more, and more, and more, and more, and more, and more, and more, and more, and more, and more, and more.&lt;\/p&gt; &lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-99 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41.png\" alt=\"\" width=\"457\" height=\"149\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41.png 457w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41-300x98.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41-65x21.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41-225x73.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-41-350x114.png 350w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<div>\n<p style=\"text-align: justify\"><strong>\u00a0 \u00a0 \u00a0The :before and :after pseudo elements<\/strong><\/p>\n<p style=\"text-align: justify\">The :before pseudo element inserts some new content before an existing element<\/p>\n<p style=\"text-align: justify\">The :after pseudo element inserts some new content after an existing element .<\/p>\n<p style=\"text-align: justify\">The <strong>content<\/strong> property is used to define the content to be inserted before and after the selected elements.<\/p>\n<p style=\"text-align: justify\">For e.g., :<strong>body &gt; ol&gt; li<\/strong> <strong>:before { content: \u201dchapter:\u201d; }<\/strong><\/p>\n<p style=\"text-align: justify\">Adds chapter before every &lt;li&gt; element which is a grandchildren of the &lt;body&gt; element.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Attribute Selector<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Attribute Selector provide a way of selecting elements depending on the presence of an attribute or the presence of certain attribute values.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Simple Attribute Selector<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>It selects elements having specified attribute.<\/p>\n<p>General syntax :<\/p>\n<p><strong>element[attribute_name] or<\/strong><\/p>\n<p><strong>[attribute_name]<\/strong><\/p>\n<p>For e.g.: <strong>a[href]<\/strong> selects all &lt;a&gt;elements having the attribute href.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Attribute Selector &#8211; Example<\/strong><\/p>\n<\/div>\n<p><span style=\"text-align: initial;font-size: 1em\">\u00a0 &lt;!DOCTYPE html&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;html&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;head&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;style&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">a[target] {<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">background-color: yellow;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">}<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/style&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/head&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;body&gt;<\/span><\/p>\n<div>\n<p style=\"text-align: justify\">\u00a0&lt;p&gt;The links with a target attribute gets a yellow background:&lt;\/p&gt; &lt;a href=&#8221;http:\/\/www.w3schools.com&#8221;&gt;w3schools.com&lt;\/a&gt;<\/p>\n<p>&lt;a href=&#8221;http:\/\/www.disney.com&#8221; target=&#8221;_blank&#8221;&gt;disney.com&lt;\/a&gt; &lt;a href=&#8221;http:\/\/www.wikipedia.org&#8221; target=&#8221;_top&#8221;&gt;wikipedia.org&lt;\/a&gt;<\/p>\n<p style=\"text-align: justify\">&lt;p&gt;&lt;b&gt;Note:&lt;\/b&gt; For [&lt;i&gt;attribute&lt;\/i&gt;] to work in IE8 and earlier, a DOCTYPE must be declared.&lt;\/p&gt; &lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-100 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42.png\" alt=\"\" width=\"533\" height=\"100\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42.png 533w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42-300x56.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42-65x12.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42-225x42.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-42-350x66.png 350w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Attribute Value Selector<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Selecting elements based on the attribute value.<\/p>\n<p>&nbsp;<\/p>\n<p>The syntax :<\/p>\n<p><strong>element[attribute_name=\u201cattribute_Value\u201d]<\/strong><\/p>\n<p><strong>or<\/strong><\/p>\n<p><strong>[attribute_name=\u201cattribute_Value\u201d]<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Example:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>p[type=\u201cnote\u201d] <\/strong>selects all &lt;p&gt;elements having the type attribute value \u201cnote\u201d.<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>a[target=_blank] { background-color: yellow;}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/head&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;body&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;p&gt;The link with target=&#8221;_blank&#8221; gets a yellow background:&lt;\/p&gt; &lt;a href=&#8221;http:\/\/www.w3schools.com&#8221;&gt;w3schools.com&lt;\/a&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;a href=&#8221;http:\/\/www.disney.com&#8221; target=&#8221;_blank&#8221;&gt;disney.com&lt;\/a&gt; &lt;a href=&#8221;http:\/\/www.wikipedia.org&#8221; target=&#8221;_top&#8221;&gt;wikipedia.org&lt;\/a&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;p&gt;&lt;b&gt;Note:&lt;\/b&gt; For [&lt;i&gt;attribute&lt;\/i&gt;] to work in IE8 and earlier, a DOCTYPE must be declared.&lt;\/p&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/body&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span><\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-101 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43.png\" alt=\"\" width=\"385\" height=\"116\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43.png 385w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43-300x90.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43-65x20.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43-225x68.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-43-350x105.png 350w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/p>\n<div>\n<p><strong>\u00a0 \u00a0 \u00a0Starts-with attribute value selector<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The selector selects elements having an attribute value that starts with the value specified.<\/p>\n<p>&nbsp;<\/p>\n<p>The general syntax :<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Element[attribute_name^=\u201cattribute_value\u201d]<\/strong><\/p>\n<p>For example, the selector <strong>p[type^=\u201ccopy\u201d]<\/strong> matches<\/p>\n<p>&lt;p type=\u201ccopyright\u201d&gt;copyright&lt;\/p&gt; as well as &lt;p type=\u201ccopyleft\u201d&gt;copyleft..&lt;\/p&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>[class^=&#8221;top&#8221;] {<\/p>\n<p>background: yellow;<\/p>\n<p>}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h1 class=&#8221;top-header&#8221;&gt;Welcome&lt;\/h1&gt;<\/p>\n<p>&lt;p class=&#8221;top-text&#8221;&gt;Hello world!&lt;\/p&gt;<\/p>\n<p>&lt;p class=&#8221;top-content&#8221;&gt;Are you learning CSS?&lt;\/p&gt;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">&lt;p&gt;&lt;b&gt;Note:&lt;\/b&gt; For [&lt;i&gt;attribute&lt;\/i&gt;^=&lt;i&gt;value&lt;\/i&gt;] to work in IE8 and earlier, a DOCTYPE must be\u00a0<\/span><span style=\"text-align: initial;font-size: 1em\">declared.&lt;\/p&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/body&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span><\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-102 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44.png\" alt=\"\" width=\"424\" height=\"169\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44.png 424w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44-300x120.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44-65x26.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44-225x90.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-44-350x140.png 350w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/p>\n<div>\n<p><strong>\u00a0 \u00a0Ends-with attribute value selector<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This attribute selects elements having attribute value that ends with the value specified.<\/p>\n<p style=\"text-align: justify\">The general syntax :<\/p>\n<p style=\"text-align: justify\"><strong>Element[attribute_name$=\u201cattribute_value\u201d]<\/strong><\/p>\n<p style=\"text-align: justify\">For e.g.,<\/p>\n<p style=\"text-align: justify\"><strong>a[href$=\u201c.com\u201d] &#8211; <\/strong>selects those anchor tags that point to .com websites and not any other domains.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Substring match attribute value selector<\/strong><\/p>\n<p style=\"text-align: justify\">This selector selects those elements having an attribute value containing at least one occurrence of the<\/p>\n<p style=\"text-align: justify\">value specified.<\/p>\n<p style=\"text-align: justify\">The general syntax :<\/p>\n<p style=\"text-align: justify\"><strong>Element[attribute_name*=\u201cattribute_value\u201d]<\/strong><\/p>\n<p style=\"text-align: justify\">For e.g.,<\/p>\n<p style=\"text-align: justify\"><strong>a[href*=\u201cimage\u201d] &#8211; <\/strong>selects those anchor tags that have image in the href attribute.<\/p>\n<p style=\"text-align: justify\"><strong>The Class Selector<\/strong><\/p>\n<p style=\"text-align: justify\">This selector is a specific case of one of many attribute value selectors with the attribute name class and \u201c~=\u201c substituted by \u201c.\u201d<\/p>\n<p>So p[class~=\u201cbold\u201d] and p.bold are identical in meaning.<\/p>\n<p>It matches &lt;p class=\u201cbold\u201d&gt;..&lt;\/p&gt; as well as &lt;p class=\u201citalic bold\u201d&gt;..&lt;\/p&gt; but not &lt;p class=\u201cleft\u201d&gt;..&lt;\/p&gt;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">Class selectors are useful to control elements that belong to a group as well as to remove limitations of the selector.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>The Class Selector &#8211; Example<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>.center {<\/p>\n<p>text-align: center;<\/p>\n<p>color: red;<\/p>\n<p>}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h1 class=&#8221;center&#8221;&gt;Red and center-aligned heading&lt;\/h1&gt;<\/p>\n<p>&lt;p class=&#8221;center&#8221;&gt;Red and center-aligned paragraph.&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-103 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-45.png\" alt=\"\" width=\"291\" height=\"96\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-45.png 291w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-45-65x21.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-45-225x74.png 225w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>ID Selectors<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The id differs from class in that id identifies a single element whereas class identifies a set of related elements. An id selector selects a single element based on its unique id attribute value regardless of its position in the document tree. An id selector is defined by placing a # symbol before the selector name. The selector p #para1 selects the p elements having id attribute value para1.<\/p>\n<p>So it matches &lt;p id=\u201cpara1\u201d&gt;\u2026&lt;\/p&gt; but not &lt;div id=\u201cpara1\u201d&gt;..&lt;\/div&gt;.<\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>Note: <\/em><\/strong>The id attributes should be unique Id selectors and other selectors can be combined.<\/p>\n<p>&nbsp;<\/p>\n<p>For e.g.:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>&lt;div id=\u201cbook1\u201d&gt;&lt;h1&gt;Web Technology&lt;\/h1&gt;<\/strong><\/p>\n<p><strong>&lt;p&gt;HTML&lt;\/p&gt;<\/strong><\/p>\n<p><strong>&lt;\/div&gt;<\/strong><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">\u00a0And<\/span><\/p>\n<p><strong style=\"text-align: initial;font-size: 1em\">#book1 h1{color:red;} <\/strong><span style=\"text-align: initial;font-size: 1em\">makes the h1 elements in the div tag to be red.<\/span><\/p>\n<\/div>\n<p><strong>\u00a0 ID Selectors &#8211; Example<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>#para1 {<\/p>\n<p>text-align: center;<\/p>\n<p>color: red;<\/p>\n<p>}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;p id=&#8221;para1&#8243;&gt;Hello World!&lt;\/p&gt;<\/p>\n<p>&lt;p&gt;This paragraph is not affected by the style.&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-104 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-46.png\" alt=\"\" width=\"332\" height=\"24\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-46.png 332w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-46-300x22.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-46-65x5.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-46-225x16.png 225w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Summary<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This module explains about CSS, adding different style sheets and its anatomy. The module also explores about Selectors, Pseudo Classes and elements. Moreover, the module also discusses about the Attribute Selectors, Class Selectors and ID selectors.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Web Links<\/strong><\/p>\n<ul>\n<li><em>www.w3schools.com<\/em><\/li>\n<li><em>https:\/\/www.uvu.edu\/web\/docs\/<strong>css<\/strong>_basics.<strong>ppt<\/strong>m<\/em><\/li>\n<li><em>www.hawaii.edu\/lis\/webteam\/workshops\/07fa.wksp3_basic<strong>CSS<\/strong>.<strong>ppt<\/strong><\/em><\/li>\n<li><em>html<strong>css<\/strong>javascript.com\/downloads\/<strong>css<\/strong>.<strong>ppt<\/strong><\/em><\/li>\n<li><em>www.dsm.fordham.edu\/moniot\/Classes\/IntroWebM04\/Chapter6-<strong>CSS<\/strong>.<strong>ppt<\/strong><\/em><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"author":4,"menu_order":13,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-m-vijayalakshmi"],"pb_section_license":""},"chapter-type":[],"contributor":[58],"license":[],"class_list":["post-98","chapter","type-chapter","status-publish","hentry","contributor-dr-m-vijayalakshmi"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":15,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/98\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/98\/revisions\/540"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/98\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapter-type?post=98"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/contributor?post=98"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/license?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}