

{"id":78649,"date":"2020-06-29T09:00:37","date_gmt":"2020-06-29T03:30:37","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=78649"},"modified":"2024-07-26T13:24:06","modified_gmt":"2024-07-26T07:54:06","slug":"html-and-css","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/html-and-css\/","title":{"rendered":"HTML and CSS Styles"},"content":{"rendered":"<p>One of the major requirements or necessities of a developer working on a web-page is to make it attractive and aesthetic to the users. HTML5 efficiently facilitates the development of static web-pages, but to add more styles(to images, content, backgrounds, etc.), cascading style sheets CSS are used. In this HTML Tutorial by DataFlair, we will learn connection between HTML and CSS. So let&#8217;s start!!!!<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78753\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg\" alt=\"HTML and CSS\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>Linking CSS to HTML<\/h2>\n<p>CSS is a language used for styling the HTML document and displaying its elements as per your preference.<\/p>\n<h2>Uses of HTML CSS<\/h2>\n<ul>\n<li>HTML elements can be made more attractive and appealing by using cascading style sheets.<\/li>\n<li>HTML documents can be incompatible with different devices; they can be made compatible with the help of CSS.<\/li>\n<li>Transition and animation effects can be added, without writing any complex JavaScript codes.<\/li>\n<li>The same style rules can be easily applied to various HTML elements without any hassle.<\/li>\n<li>An element can have dynamic states such as hover and focus that can also be styled using CSS, which would otherwise be a tedious task.<\/li>\n<li>Multiple pages can be styled and manipulated using a single CSS file.<\/li>\n<li>Elements such as skew, scale, rotate, etc, can be easily transformed in 2D or 3D state.<\/li>\n<\/ul>\n<p>Using CSS, you can create visually appealing layouts that improve user experience. The separation of content (HTML) and presentation (CSS) allows more maintainable and flexible code. CSS enables web developers to control the look and feel of a website with precision. This modular approach also supports faster page loading times and easier troubleshooting.<\/p>\n<h2>Advantages of HTML &amp; CSS<\/h2>\n<ul>\n<li>CSS can be written once and re-used with any HTML document, thus saving time.<\/li>\n<li>These files can be easily maintained, i.e., for a single change, just add it to the global CSS file, and all the HTML documents linked to it will be changed automatically.<\/li>\n<li>Search engines can easily read the CSS files and do not have to struggle.<\/li>\n<li>CSS outshines HTML because of its wider array of properties that can be used to style the HTML document more attractively.<\/li>\n<li>It has a local cache that can be used to view websites offline.<\/li>\n<li>CSS allows compatibility over multiple devices, thus enabling HTML documents to be rendered effectively in a desktop as well as a cell-phone.<\/li>\n<\/ul>\n<p>The latest version of CSS is CSS3 currently prevailing.<\/p>\n<h2>Advantages of CSS3 over CSS<\/h2>\n<ul>\n<li>CSS3 allows users to create responsive pages and handles media queries efficiently. Personalized CSS properties can be applied to devices of different screen widths.<\/li>\n<li>With new color formats such as rgb() and hsl(), it is possible to add new color effects and styles to the HTML document.<\/li>\n<li>The \u2018box-sizing\u2019 property of CSS3 has made the alignment easier, and CSS grids have reduced the use of table rows and columns.<\/li>\n<li>With CSS, in order to add animations, one had to write a code in the scripting language. With CSS3, it is finally possible to add animations using the inbuilt animation features such as text-shadow, thus reducing the workload of developers.<\/li>\n<li>Every browser supports CSS3, unlike the older vanilla CSS.<\/li>\n<li>CSS3 can be easily tested because of its modularity, thus making bug-detection easier.<\/li>\n<li>With the \u2018border-radius\u2019 property, the images and divisions can have rounded-borders, and their borders can be further styled.<\/li>\n<\/ul>\n<p>As we\u2019ve discussed in the previous article of HTML Styles, CSS can be added to an HTML document using 3 methods &#8211; inline CSS, internal CSS, and external CSS. In this article, we\u2019ll be using these methods. Here is an example of basic CSS,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\nh2{\r\n   font-family: verdana;\r\n   text-align: center;\r\n   color: blue;\r\n}\r\np{\r\n   font-size: 20px;\r\n   color: red;\r\n   font-family: cursive;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;DataFlair&lt;\/h2&gt;\r\n&lt;br&gt;\r\n&lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.\r\nDataFlair team comprises of trainers who are experts in their relevant technologies and are selected after many rounds of interviews, content team that continuously works hard to provide quality content to the readers, Marketing team that work hand in hand with other teams to make the content reaches the right audience and HR team that work to extend the team and to provide a healthy work environment.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78766\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336.png\" alt=\"CSS basics\" width=\"1290\" height=\"436\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336.png 1290w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336-300x101.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336-1024x346.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336-150x51.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336-768x260.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-336-520x176.png 520w\" sizes=\"auto, (max-width: 1290px) 100vw, 1290px\" \/><\/a><\/p>\n<h2>Major HTML and CSS Stylings<\/h2>\n<h3>1. Font<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Attribute<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">font-family<\/span><\/td>\n<td><span style=\"font-weight: 400\">This attribute is used to specify the font of an HTML document. It is possible to specify multiple fonts separated with a comma. This is used as a fallback system i.e., if the browser doesn\u2019t display the first font, control is shifted to the next.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">font-size<\/span><\/td>\n<td><span style=\"font-weight: 400\">This attribute is used to define the font or text size that should be displayed in an HTML document This can be specified in terms of-large, medium, small, or, percentages, or, pixels.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">font-stretch<\/span><\/td>\n<td><span style=\"font-weight: 400\">This attribute specifies whether the text will be condensed or expanded.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">font-variant<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to specify whether or not to display a particular content in small caps or not.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">font-weight<\/span><\/td>\n<td><span style=\"font-weight: 400\">This attribute is used to specify the thickness of the text in an HTML document.Its default value is \u2018normal\u2019.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">font-style<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to specify the style i.e. italic,oblique,or normal of the font.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">color<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to specify the color of the text to be displayed.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\nh2,h3{\r\n   text-align: center;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2 style=\"font-family: cursive;font-weight: bold;color: blue\"&gt;DataFlair&lt;\/h2&gt;\r\n&lt;h3&gt;E-learning!&lt;\/h3&gt;\r\n&lt;br&gt;\r\n&lt;p style=\"font-family: cursive;font-size: 20px;font-style: italic;color: red;font-stretch: expanded;\"&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;p style=\"font-family: monospace;font-size: 15px;font-style: oblique;color: purple;font-stretch: condensed;\"&gt;DataFlair team comprises of trainers who are experts in their relevant technologies and are selected after many rounds of interviews, content team that continuously works hard to provide quality content to the readers, Marketing team that work hand in hand with other teams to make the content reaches the right audience and HR team that work to extend the team and to provide a healthy work environment.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78755\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5.png\" alt=\"CSS stylings\" width=\"1290\" height=\"487\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5.png 1290w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5-300x113.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5-1024x387.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5-150x57.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5-768x290.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-1-5-520x196.png 520w\" sizes=\"auto, (max-width: 1290px) 100vw, 1290px\" \/><\/a><\/p>\n<h3>2. CSS border<\/h3>\n<p>The border property is used to specify the styling of the border of a particular element.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\nh2,h3{\r\n   text-align: center;\r\n}\r\np{\r\n   border: 20px solid red;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2 style=\"font-family: cursive;font-weight: bold;color: blue\"&gt;DataFlair&lt;\/h2&gt;\r\n&lt;h3&gt;E-learning!&lt;\/h3&gt;\r\n&lt;br&gt;\r\n&lt;p style=\"font-family: cursive;font-size: 20px;font-style: italic;color: red;font-stretch: expanded;\"&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;p style=\"font-family: monospace;font-size: 15px;font-style: oblique;color: purple;font-stretch: condensed;\"&gt;DataFlair team comprises of trainers who are experts in their relevant technologies and are selected after many rounds of interviews, content team that continuously works hard to provide quality content to the readers, Marketing team that work hand in hand with other teams to make the content reaches the right audience and HR team that work to extend the team and to provide a healthy work environment.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78765\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16.png\" alt=\"CSS border styling\" width=\"1290\" height=\"577\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16.png 1290w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16-300x134.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16-1024x458.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16-150x67.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16-768x344.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-16-520x233.png 520w\" sizes=\"auto, (max-width: 1290px) 100vw, 1290px\" \/><\/a><\/p>\n<h3>3. CSS padding<\/h3>\n<p>It is used to specify the distance between the text and the implicit or explicit border.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;  \r\n&lt;html&gt;  \r\n&lt;head&gt;  \r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\np{\r\n  border:20px solid blue;\r\n  padding: 10px;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;  \r\n&lt;body style=\"background-color:hsl(0,100%,25%);\"&gt;\r\n&lt;h1 style=\"text-align: center;\"&gt;&lt;u&gt;&lt;i&gt; Welcome to DataFlair&lt;\/i&gt;&lt;\/u&gt;&lt;\/h1&gt; \r\n&lt;h2 style=\"text-align: center;\"&gt;&lt;u&gt;About Us&lt;\/u&gt;&lt;\/h2&gt; \r\n&lt;p align=\"center\" style=\"color:hsla(0,100%,90%);\"&gt;\r\nWe continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.\r\nDataFlair team comprises of trainers who are experts in their relevant technologies and are selected after many rounds of interviews, content team that continuously works hard to provide quality content to the readers, Marketing team that work hand in hand with other teams to make the content reaches the right audience and HR team that work to extend the team and to provide a healthy work environment.\r\n&lt;\/p&gt;\r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;   \r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78756\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6.png\" alt=\"CSS padding\" width=\"1291\" height=\"433\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6.png 1291w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6-300x101.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6-1024x343.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6-150x50.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6-768x258.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-2-6-520x174.png 520w\" sizes=\"auto, (max-width: 1291px) 100vw, 1291px\" \/><\/a><\/p>\n<h3>4. CSS Margin<\/h3>\n<p>The margin property of CSS is used to set the margins in an HTML document. However, variations such as margin-top,margin-bottom,margin-left and margin-right are also available. If the margin property has values in the manner margin:10px,15px,7px; it means that top margin is 10px, left and right margins are 15px and bottom margin is 7px.<\/p>\n<p>If margin:5px; this means that all the margins are set to 5px.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;  \r\n&lt;html&gt;  \r\n&lt;head&gt;  \r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\np{\r\n  border:20px solid blue;\r\n  padding: 10px;\r\n  margin: 40px;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;  \r\n&lt;body style=\"background-color:hsl(0,100%,25%);\"&gt;\r\n&lt;h1 style=\"text-align: center;\"&gt;&lt;u&gt;&lt;i&gt; Welcome to DataFlair&lt;\/i&gt;&lt;\/u&gt;&lt;\/h1&gt; \r\n&lt;h2 style=\"text-align: center;\"&gt;&lt;u&gt;About Us&lt;\/u&gt;&lt;\/h2&gt; \r\n&lt;p align=\"center\" style=\"color:hsla(0,100%,90%);\"&gt;\r\nWe continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.\r\nDataFlair team comprises of trainers who are experts in their relevant technologies and are selected after many rounds of interviews, content team that continuously works hard to provide quality content to the readers, Marketing team that work hand in hand with other teams to make the content reaches the right audience and HR team that work to extend the team and to provide a healthy work environment.\r\n&lt;\/p&gt;\r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78757\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4.png\" alt=\"CSS margin\" width=\"1290\" height=\"439\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4.png 1290w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4-300x102.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4-1024x348.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4-150x51.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4-768x261.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-3-4-520x177.png 520w\" sizes=\"auto, (max-width: 1290px) 100vw, 1290px\" \/><\/a><\/p>\n<h3>5. CSS Icons<\/h3>\n<p>To add icons to an HTML document, the fontawesome or any other icon library can be used. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;script src=\"https:\/\/kit.fontawesome.com\/a076d05399.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;i class=\"fas fa-cloud\"&gt;&lt;\/i&gt;\r\n&lt;i class=\"fas fa-heart\"&gt;&lt;\/i&gt;\r\n&lt;i class=\"fas fa-car\"&gt;&lt;\/i&gt;\r\n&lt;i class=\"fas fa-file\"&gt;&lt;\/i&gt;\r\n&lt;i class=\"fas fa-bars\"&gt;&lt;\/i&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-4-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78759\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-4-4.png\" alt=\"CSS icons\" width=\"298\" height=\"65\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-4-4.png 298w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-4-4-150x33.png 150w\" sizes=\"auto, (max-width: 298px) 100vw, 298px\" \/><\/a><\/p>\n<h3>6. Links in CSS<\/h3>\n<p>CSS properties can be used to style the links as well. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;style&gt;\r\n\/* unvisited link *\/\r\na:link {\r\n  color: red;\r\n}\r\n\r\n\/* visited link *\/\r\na:visited {\r\n  color: green;\r\n}\r\n\r\n\/* mouse over link *\/\r\na:hover {\r\n  color: hotpink;\r\n}\r\n\r\n\/* selected link *\/\r\na:active {\r\n  color: blue;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;ul&gt;\r\n&lt;li&gt;&lt;a href=\"headings.html\"&gt;LINK1&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"frames.html\"&gt;LINK2&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"elements.html\"&gt;LINK3&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-scaled.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78767\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-scaled.jpg\" alt=\"CSS links\" width=\"2560\" height=\"1794\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-scaled.jpg 2560w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-300x210.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-1024x718.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-150x105.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-768x538.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-1536x1076.jpg 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-2048x1435.jpg 2048w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160222-520x364.jpg 520w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-rotated.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78768\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-rotated.jpg\" alt=\"CSS links\" width=\"1536\" height=\"1224\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-rotated.jpg 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-300x239.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-1024x816.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-150x120.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-768x612.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/20200525_160232-1-520x414.jpg 520w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/a><\/p>\n<h2>CSS Selectors<\/h2>\n<p>A CSS contains selectors and declarations. CSS selector is used to specify the HTML element that should be styled. Declaration contains the name-value property of CSS attributes. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">p{\r\ncolor:blue;\r\nfont-family:monospace;\r\nfont-size:15px;\r\n}\r\n<\/pre>\n<p>Here, p is the selector and color:blue; font-family:monospace; font-size:15px;, is the declaration.<br \/>\nThe declaration block is contained within curly braces,{}.<\/p>\n<h3>1. Universal Selectors<\/h3>\n<p>Instead of selecting a particular element, the universal selector is used to select the name of any element it matched. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\n* {  \r\n   color: purple;  \r\n} \r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n&lt;p&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;h2&gt;About Us&lt;\/h2&gt;\r\n&lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78760\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2.png\" alt=\"CSS universal selectors\" width=\"1292\" height=\"296\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2.png 1292w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2-300x69.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2-1024x235.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2-150x34.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2-768x176.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-5-2-520x119.png 520w\" sizes=\"auto, (max-width: 1292px) 100vw, 1292px\" \/><\/a><\/p>\n<h3>2. CSS Element Selector<\/h3>\n<p>The element is used to select a particular element whose name has been specified. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\np { \r\n    text-align: center; \r\n    color: red; \r\n} \r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n&lt;p&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;h2&gt;About Us&lt;\/h2&gt;\r\n&lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78761\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2.png\" alt=\"CSS element selectors\" width=\"1292\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2.png 1292w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2-300x73.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2-1024x249.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2-150x36.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2-768x187.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-6-2-520x126.png 520w\" sizes=\"auto, (max-width: 1292px) 100vw, 1292px\" \/><\/a><\/p>\n<h3>3. CSS Descendant Selector<\/h3>\n<p>Used to select a particular element only when it is a descendant of a particular element. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\nbody h2 { \r\n    text-align: center; \r\n    color: red; \r\n} \r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n&lt;p&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;h2&gt;About Us&lt;\/h2&gt;\r\n&lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78762\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2.png\" alt=\"CSS descendant selector\" width=\"1292\" height=\"320\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2.png 1292w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2-300x74.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2-1024x254.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2-150x37.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2-768x190.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-7-2-520x129.png 520w\" sizes=\"auto, (max-width: 1292px) 100vw, 1292px\" \/><\/a><\/p>\n<h3>4. CSS ID and Class Selectors<\/h3>\n<p>This <a href=\"http:\/\/web.simmons.edu\/~grabiner\/comm244\/weekfour\/selectors.html\">CSS selector<\/a> is used to select the element based on its ID(using #) or based on class(using .).For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\n#identity { \r\n    text-align: center; \r\n    color: red; \r\n} \r\n.identity2{\r\n    text-align: center; \r\n    color: green;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n&lt;p id=\"identity\"&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;h2&gt;About Us&lt;\/h2&gt;\r\n&lt;p class=\"identity2\"&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78763\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2.png\" alt=\"CSS id and class selectors\" width=\"1292\" height=\"298\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2.png 1292w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2-300x69.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2-1024x236.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2-150x35.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2-768x177.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-8-2-520x120.png 520w\" sizes=\"auto, (max-width: 1292px) 100vw, 1292px\" \/><\/a><\/p>\n<h3>5. CSS Grouping Selectors<\/h3>\n<p>Elements with the same styles can be grouped together with commas(,). For example,<br \/>\n<strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;style&gt;\r\nh1, h2, p {\r\n  text-align: center;\r\n  color: purple;\r\n  font-family: cursive;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n&lt;p&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;h2&gt;About Us&lt;\/h2&gt;\r\n&lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78764\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1.png\" alt=\"CSS grouping selectors\" width=\"1109\" height=\"372\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1.png 1109w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1-300x101.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1-1024x343.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1-150x50.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1-768x258.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-9-1-520x174.png 520w\" sizes=\"auto, (max-width: 1109px) 100vw, 1109px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In the following article, we\u2019ve looked at the basics of HTML and CSS3 i.e., its advantages and its peculiar features with respect to CSS2 and its prior versions. We\u2019ve also looked at some commonly used CSS properties &#8211; font styling, border, padding, margin. Other properties will be studied in depth in the following articles. CSS Selectors that play a major role in CSS styling have also been discussed.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1060,&quot;href&quot;:&quot;http:\\\/\\\/web.simmons.edu\\\/~grabiner\\\/comm244\\\/weekfour\\\/selectors.html&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251209002038\\\/http:\\\/\\\/web.simmons.edu\\\/~grabiner\\\/comm244\\\/weekfour\\\/selectors.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-21 09:04:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 11:44:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 10:04:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-18 13:33:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-19 16:47:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-06 01:08:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-23 05:41:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-01 02:34:24&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-01 02:34:24&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the major requirements or necessities of a developer working on a web-page is to make it attractive and aesthetic to the users. HTML5 efficiently facilitates the development of static web-pages, but to&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":78753,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22400],"tags":[22465,22463,22462,22464,22466,22467],"class_list":["post-78649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","tag-cascading-style-sheets","tag-css","tag-html-and-css","tag-html-css","tag-learn-html-and-css","tag-linking-css-to-html"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTML and CSS Styles - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn HTML and CSS to understand linking of CSS to HTML, CSS stylings, Advantages and limitations of CSS3&amp; properties-font styling, border, padding, margin.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/html-and-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML and CSS Styles - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn HTML and CSS to understand linking of CSS to HTML, CSS stylings, Advantages and limitations of CSS3&amp; properties-font styling, border, padding, margin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/html-and-css\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-29T03:30:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-26T07:54:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML and CSS Styles - DataFlair","description":"Learn HTML and CSS to understand linking of CSS to HTML, CSS stylings, Advantages and limitations of CSS3& properties-font styling, border, padding, margin.","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:\/\/data-flair.training\/blogs\/html-and-css\/","og_locale":"en_US","og_type":"article","og_title":"HTML and CSS Styles - DataFlair","og_description":"Learn HTML and CSS to understand linking of CSS to HTML, CSS stylings, Advantages and limitations of CSS3& properties-font styling, border, padding, margin.","og_url":"https:\/\/data-flair.training\/blogs\/html-and-css\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-06-29T03:30:37+00:00","article_modified_time":"2024-07-26T07:54:06+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"HTML and CSS Styles","datePublished":"2020-06-29T03:30:37+00:00","dateModified":"2024-07-26T07:54:06+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/"},"wordCount":1159,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg","keywords":["cascading style sheets","css","HTML and CSS","html css","learn html and css","linking css to html"],"articleSection":["HTML Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/html-and-css\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/","url":"https:\/\/data-flair.training\/blogs\/html-and-css\/","name":"HTML and CSS Styles - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg","datePublished":"2020-06-29T03:30:37+00:00","dateModified":"2024-07-26T07:54:06+00:00","description":"Learn HTML and CSS to understand linking of CSS to HTML, CSS stylings, Advantages and limitations of CSS3& properties-font styling, border, padding, margin.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/html-and-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Styling-with-CSS3.jpg","width":1200,"height":628,"caption":"HTML and CSS"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/html-and-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"HTML Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/html\/"},{"@type":"ListItem","position":3,"name":"HTML and CSS Styles"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=78649"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78649\/revisions"}],"predecessor-version":[{"id":142940,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78649\/revisions\/142940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/78753"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=78649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=78649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=78649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}