{"appState":{"pageLoadApiCallsStatus":true},"categoryState":{"relatedCategories":{"headers":{"timestamp":"2025-04-17T16:01:07+00:00"},"categoryId":33601,"data":{"title":"HTML5","slug":"html5","image":{"src":null,"width":0,"height":0},"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"parentCategory":{"categoryId":33592,"title":"Programming & Web Design","slug":"programming-web-design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"}},"childCategories":[],"description":"HTML5 is like the DNA of the worldwide web. Yeah, it's that important. Learn how it works and what it can do, here.","relatedArticles":{"self":"https://dummies-api.dummies.com/v2/articles?category=33601&offset=0&size=5"},"hasArticle":true,"hasBook":true,"articleCount":265,"bookCount":2},"_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"relatedCategoriesLoadedStatus":"success"},"listState":{"list":{"count":10,"total":265,"items":[{"headers":{"creationTime":"2016-03-26T13:13:28+00:00","modifiedTime":"2023-07-10T18:44:09+00:00","timestamp":"2023-07-10T21:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"Making AJAX Requests with jQuery for HTML5 and CSS3","strippedTitle":"making ajax requests with jquery for html5 and css3","slug":"how-to-make-an-ajax-request-with-jquery-for-html5-and-css3-programming","canonicalUrl":"","seo":{"metaDescription":"The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with j","noIndex":0,"noFollow":0},"content":"The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with jQuery.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414071.image0.jpg\" alt=\"Preview of a HTML site using Ajax.\" width=\"533\" height=\"400\" />\r\n<h2 id=\"tab1\" >How to include a text file with AJAX</h2>\r\nCheck out this clean code:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n &lt;meta charset=\"UTF-8\"&gt;\r\n &lt;title&gt;ajax.html&lt;/title&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(document).ready(getAJAX);\r\n function getAJAX(){\r\n $(\"#output\").load(\"hello.txt\");\r\n }\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"output\"&gt;&lt;/div&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe HTML is very clean. It simply creates an empty div called <span class=\"code\">output</span>.\r\n<p class=\"Remember\">This example does use AJAX, so if it isn't working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request.</p>\r\nThe <span class=\"code\">load()</span> mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages.\r\n<h2 id=\"tab2\" >Building a poor man's CMS with AJAX</h2>\r\nAJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414072.image1.jpg\" alt=\"A website created with Ajax and JQuery.\" width=\"533\" height=\"400\" />\r\n\r\nAlthough nothing is all that shocking about the page from the user's perspective, a look at the code can show some surprises:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;CMS Using AJAX&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"cmsStd.css\" /&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(init);\r\n function init(){\r\n $(\"#heading\").load(\"head.html\");\r\n $(\"#menu\").load(\"menu.html\");\r\n $(\"#content1\").load(\"story1.html\");\r\n $(\"#content2\").load(\"story2.html\");\r\n $(\"#footer\").load(\"footer.html\");\r\n };\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"all\"&gt;\r\n &lt;!-- This div centers a fixed-width layout →\r\n &lt;div id = \"heading\"&gt;\r\n &lt;/div&gt;&lt;!-- end heading div →\r\n &lt;div id = \"menu\"&gt;\r\n &lt;/div&gt; &lt;!-- end menu div →\r\n &lt;div class = \"content\"\r\n id = \"content1\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div class = \"content\"\r\n id = \"content2\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div id = \"footer\"&gt;\r\n &lt;/div&gt; &lt;!-- end footer div →\r\n &lt;/div&gt; &lt;!-- end all div →\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nLook over the code, and you can see these interesting features:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The page has no content!</b> All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The page consists of empty named divs.</b> Rather than any particular content, the page consists of placeholders with IDs.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>It uses jQuery.</b> The jQuery library is used to vastly simplify loading data through AJAX calls.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>All contents are in separate files.</b> Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this:</p>\r\n\r\n<pre class=\"code\">&lt;h2&gt;Book I - Creating the HTML Foundation&lt;/h3&gt;\r\n&lt;ol&gt;\r\n &lt;li&gt;Sound HTML Foundations&lt;/li&gt;\r\n &lt;li&gt;It's All About Validation&lt;/li&gt;\r\n &lt;li&gt;Choosing your Tools&lt;/li&gt;\r\n &lt;li&gt;Managing Information with Lists and Tables&lt;/li&gt;\r\n &lt;li&gt;Making Connections with Links&lt;/li&gt;\r\n &lt;li&gt;Adding Images&lt;/li&gt;\r\n &lt;li&gt;Creating forms&lt;/li&gt;\r\n&lt;/ol&gt;</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><b>init()</b></span><b> method runs on </b><span class=\"code\"><b>document.ready</b></span><b>.</b> When the document is ready, the page runs the <span class=\"code\">init()</span> method.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The</b><span class=\"code\"><b> init() </b></span><b>method uses AJAX calls to dynamically load content.</b> It's nothing more than a series of jQuery <span class=\"code\">load()</span> methods.</p>\r\n</li>\r\n</ul>\r\nThis approach may seem like a lot of work, but it has some very interesting characteristics:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">If you're building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Also, you'll probably have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages.</p>\r\n</li>\r\n</ul>\r\nThe advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it.\r\n\r\nHere's how you use this sort of approach:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Create a single template for your entire site.</p>\r\n<p class=\"child-para\">Build basic HTML and CSS to manage the overall look and feel for your entire site. Don't worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Add jQuery support.</p>\r\n<p class=\"child-para\">Make a link to the jQuery library, and make a default <span class=\"code\">init()</span> method. Put in code to handle populating those parts of the page that will always be consistent.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Duplicate the template.</p>\r\n<p class=\"child-para\">After you have a sense of how the template will work, make a copy for each page of your site.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Customize each page by changing the<span class=\"code\"><b> init() </b></span>function.</p>\r\n<p class=\"child-para\">The only part of the template that changes is the <span class=\"code\">init()</span> function. All your pages will be identical, except they have customized <span class=\"code\">init()</span> functions that load different content.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Load custom content into the divs with AJAX.</p>\r\n<p class=\"child-para\">Use the <span class=\"code\">init()</span>function to load content into each div.</p>\r\n</li>\r\n</ol>\r\n<p class=\"Tip\">This is a great way to manage content, but it isn't quite a full-blown content-management system. Even AJAX can't quite allow you to <i>store</i> content on the web. More complex content management systems also use databases rather than files to handle content. You'll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this kind of work.</p>","description":"The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with jQuery.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414071.image0.jpg\" alt=\"Preview of a HTML site using Ajax.\" width=\"533\" height=\"400\" />\r\n<h2 id=\"tab1\" >How to include a text file with AJAX</h2>\r\nCheck out this clean code:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n &lt;meta charset=\"UTF-8\"&gt;\r\n &lt;title&gt;ajax.html&lt;/title&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(document).ready(getAJAX);\r\n function getAJAX(){\r\n $(\"#output\").load(\"hello.txt\");\r\n }\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"output\"&gt;&lt;/div&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe HTML is very clean. It simply creates an empty div called <span class=\"code\">output</span>.\r\n<p class=\"Remember\">This example does use AJAX, so if it isn't working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request.</p>\r\nThe <span class=\"code\">load()</span> mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages.\r\n<h2 id=\"tab2\" >Building a poor man's CMS with AJAX</h2>\r\nAJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414072.image1.jpg\" alt=\"A website created with Ajax and JQuery.\" width=\"533\" height=\"400\" />\r\n\r\nAlthough nothing is all that shocking about the page from the user's perspective, a look at the code can show some surprises:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;CMS Using AJAX&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"cmsStd.css\" /&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(init);\r\n function init(){\r\n $(\"#heading\").load(\"head.html\");\r\n $(\"#menu\").load(\"menu.html\");\r\n $(\"#content1\").load(\"story1.html\");\r\n $(\"#content2\").load(\"story2.html\");\r\n $(\"#footer\").load(\"footer.html\");\r\n };\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"all\"&gt;\r\n &lt;!-- This div centers a fixed-width layout →\r\n &lt;div id = \"heading\"&gt;\r\n &lt;/div&gt;&lt;!-- end heading div →\r\n &lt;div id = \"menu\"&gt;\r\n &lt;/div&gt; &lt;!-- end menu div →\r\n &lt;div class = \"content\"\r\n id = \"content1\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div class = \"content\"\r\n id = \"content2\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div id = \"footer\"&gt;\r\n &lt;/div&gt; &lt;!-- end footer div →\r\n &lt;/div&gt; &lt;!-- end all div →\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nLook over the code, and you can see these interesting features:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The page has no content!</b> All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The page consists of empty named divs.</b> Rather than any particular content, the page consists of placeholders with IDs.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>It uses jQuery.</b> The jQuery library is used to vastly simplify loading data through AJAX calls.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>All contents are in separate files.</b> Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this:</p>\r\n\r\n<pre class=\"code\">&lt;h2&gt;Book I - Creating the HTML Foundation&lt;/h3&gt;\r\n&lt;ol&gt;\r\n &lt;li&gt;Sound HTML Foundations&lt;/li&gt;\r\n &lt;li&gt;It's All About Validation&lt;/li&gt;\r\n &lt;li&gt;Choosing your Tools&lt;/li&gt;\r\n &lt;li&gt;Managing Information with Lists and Tables&lt;/li&gt;\r\n &lt;li&gt;Making Connections with Links&lt;/li&gt;\r\n &lt;li&gt;Adding Images&lt;/li&gt;\r\n &lt;li&gt;Creating forms&lt;/li&gt;\r\n&lt;/ol&gt;</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><b>init()</b></span><b> method runs on </b><span class=\"code\"><b>document.ready</b></span><b>.</b> When the document is ready, the page runs the <span class=\"code\">init()</span> method.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The</b><span class=\"code\"><b> init() </b></span><b>method uses AJAX calls to dynamically load content.</b> It's nothing more than a series of jQuery <span class=\"code\">load()</span> methods.</p>\r\n</li>\r\n</ul>\r\nThis approach may seem like a lot of work, but it has some very interesting characteristics:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">If you're building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Also, you'll probably have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages.</p>\r\n</li>\r\n</ul>\r\nThe advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it.\r\n\r\nHere's how you use this sort of approach:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Create a single template for your entire site.</p>\r\n<p class=\"child-para\">Build basic HTML and CSS to manage the overall look and feel for your entire site. Don't worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Add jQuery support.</p>\r\n<p class=\"child-para\">Make a link to the jQuery library, and make a default <span class=\"code\">init()</span> method. Put in code to handle populating those parts of the page that will always be consistent.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Duplicate the template.</p>\r\n<p class=\"child-para\">After you have a sense of how the template will work, make a copy for each page of your site.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Customize each page by changing the<span class=\"code\"><b> init() </b></span>function.</p>\r\n<p class=\"child-para\">The only part of the template that changes is the <span class=\"code\">init()</span> function. All your pages will be identical, except they have customized <span class=\"code\">init()</span> functions that load different content.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Load custom content into the divs with AJAX.</p>\r\n<p class=\"child-para\">Use the <span class=\"code\">init()</span>function to load content into each div.</p>\r\n</li>\r\n</ol>\r\n<p class=\"Tip\">This is a great way to manage content, but it isn't quite a full-blown content-management system. Even AJAX can't quite allow you to <i>store</i> content on the web. More complex content management systems also use databases rather than files to handle content. You'll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this kind of work.</p>","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[{"label":"How to include a text file with AJAX","target":"#tab1"},{"label":"Building a poor man's CMS with AJAX","target":"#tab2"}],"relatedArticles":{"fromBook":[{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}},{"authorId":11290,"name":"Paul McFedries","slug":"paul-mcfedries","description":" <p><b>Paul McFedries</b> is a true renaissance geek. He has been a programmer, consultant, database developer, and website builder. He&#39;s also the author of more than 90 books including top sellers covering Windows, Office, and macOS. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/11290"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-64ac718f4115b\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-64ac718f418f8\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-09-19T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":156689},{"headers":{"creationTime":"2016-03-26T13:13:00+00:00","modifiedTime":"2023-06-28T20:51:25+00:00","timestamp":"2023-06-28T21:01:11+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"How to Create Page Styles for Your HTML5 & CSS3 Template","strippedTitle":"how to create page styles for your html5 & css3 template","slug":"how-to-create-page-styles-for-your-html5-and-css3-site-template","canonicalUrl":"","seo":{"metaDescription":"With an HTML framework in place, you can start working on the CSS to create page styles on your site. The best way to incorporate CSS3 is by following these ste","noIndex":0,"noFollow":0},"content":"With an HTML framework in place, you can start working on the CSS to create page styles on your site. The best way to incorporate CSS3 is by following these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Begin with the page template diagram.</p>\r\n<p class=\"child-para\">It should have all the information you need.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Test your CSS in a browser.</p>\r\n<p class=\"child-para\">Begin with a simple CSS implementation that ensures you have the right names for all the page elements. Then modify each element according to your design document, testing as you go.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Implement the CSS from your diagram.</p>\r\n<p class=\"child-para\">You should be <i>implementing</i> the design you already created, not <i>designing</i> the page. (That already happened in the diagramming process.)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Save the design.</p>\r\n<p class=\"child-para\">For multi-page projects, external CSS in a separate file is definitely the way to go. As you work, save the CSS in the normal way so the browser will be able to read it.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Test and tweak.</p>\r\n<p class=\"child-para\">Things are never quite what they seem with CSS because browsers don't conform to standards equally. You need to test and tweak on other browsers. If users with older technologies are a concern, you may have to use a secondary style sheet for older versions of IE. You may also want to make a mobile version.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Repeat for other templates.</p>\r\n<p class=\"child-para\">Repeat this process for each of the other templates you identified in your site diagram.</p>\r\n</li>\r\n</ol>\r\nThe result of this process should be a number of CSS files that you can readily reuse across your site.\r\n\r\nHere's the CSS code for the primary page:\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414306.image0.jpg\" alt=\"image0.jpg\" width=\"533\" height=\"400\" />\r\n<pre class=\"code\">body {\r\n background-color: #000000;\r\n}\r\nh1 {\r\n text-align: center;\r\n font-family: sans-serif;\r\n color: white;\r\n text-shadow: 0 0 10px black;\r\n}\r\n#all {\r\n background-color: white;\r\n border: 1px solid black;\r\n width: 800px;\r\n margin-top:2em;\r\n margin-left: auto;\r\n margin-right: auto;\r\n min-height: 600px;\r\n}\r\n#heading {\r\n background-color: #A11204;\r\n background-image: url(\"cbBackground.png\");\r\n color: #FFFFFF;\r\n height: 100px;\r\n font-size: 2em;\r\n padding-left: 1em;\r\n border-bottom: 3px solid black;\r\n margin-top: -1.5em;\r\n}\r\n#menu {\r\n background-image: url(\"cbBackground.png\");\r\n background-color: #A11204;\r\n color: #FFFFFF;\r\n float: left;\r\n width: 100px;\r\n min-height: 500px;\r\n}\r\n#menu li {\r\n list-style-type: none;\r\n margin-left: -2em;\r\n margin-right: .5em;\r\n text-align: center;\r\n}\r\n#menu a {\r\n color: #FFFFFF;\r\n display: block;\r\n border: #A11204 3px outset;\r\n text-decoration: none;\r\n}\r\n#menu a:hover {\r\n border: #A11204 3px inset;\r\n}\r\n.content {\r\n border: 3px double #A11204;\r\n margin: 1em;\r\n margin-left: 110px;\r\n padding-left: 1em;\r\n padding-bottom: 1em;\r\n padding-right: 1em;\r\n border-radius: 5px;\r\n box-shadow: 5px 5px 5px gray;\r\n}\r\n.content h2 {\r\n background-color: #A11204;\r\n background-image: url(\"cbBackground.png\");\r\n color: #FFFFFF;\r\n text-align: right;\r\n}\r\n#footer {\r\n color: #FFFFFF;\r\n background-color: #000000;\r\n border: 1px solid #A11204;\r\n float: left;\r\n clear: both;\r\n width: 100%;\r\n text-align: center;\r\n}</pre>","description":"With an HTML framework in place, you can start working on the CSS to create page styles on your site. The best way to incorporate CSS3 is by following these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Begin with the page template diagram.</p>\r\n<p class=\"child-para\">It should have all the information you need.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Test your CSS in a browser.</p>\r\n<p class=\"child-para\">Begin with a simple CSS implementation that ensures you have the right names for all the page elements. Then modify each element according to your design document, testing as you go.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Implement the CSS from your diagram.</p>\r\n<p class=\"child-para\">You should be <i>implementing</i> the design you already created, not <i>designing</i> the page. (That already happened in the diagramming process.)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Save the design.</p>\r\n<p class=\"child-para\">For multi-page projects, external CSS in a separate file is definitely the way to go. As you work, save the CSS in the normal way so the browser will be able to read it.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Test and tweak.</p>\r\n<p class=\"child-para\">Things are never quite what they seem with CSS because browsers don't conform to standards equally. You need to test and tweak on other browsers. If users with older technologies are a concern, you may have to use a secondary style sheet for older versions of IE. You may also want to make a mobile version.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Repeat for other templates.</p>\r\n<p class=\"child-para\">Repeat this process for each of the other templates you identified in your site diagram.</p>\r\n</li>\r\n</ol>\r\nThe result of this process should be a number of CSS files that you can readily reuse across your site.\r\n\r\nHere's the CSS code for the primary page:\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414306.image0.jpg\" alt=\"image0.jpg\" width=\"533\" height=\"400\" />\r\n<pre class=\"code\">body {\r\n background-color: #000000;\r\n}\r\nh1 {\r\n text-align: center;\r\n font-family: sans-serif;\r\n color: white;\r\n text-shadow: 0 0 10px black;\r\n}\r\n#all {\r\n background-color: white;\r\n border: 1px solid black;\r\n width: 800px;\r\n margin-top:2em;\r\n margin-left: auto;\r\n margin-right: auto;\r\n min-height: 600px;\r\n}\r\n#heading {\r\n background-color: #A11204;\r\n background-image: url(\"cbBackground.png\");\r\n color: #FFFFFF;\r\n height: 100px;\r\n font-size: 2em;\r\n padding-left: 1em;\r\n border-bottom: 3px solid black;\r\n margin-top: -1.5em;\r\n}\r\n#menu {\r\n background-image: url(\"cbBackground.png\");\r\n background-color: #A11204;\r\n color: #FFFFFF;\r\n float: left;\r\n width: 100px;\r\n min-height: 500px;\r\n}\r\n#menu li {\r\n list-style-type: none;\r\n margin-left: -2em;\r\n margin-right: .5em;\r\n text-align: center;\r\n}\r\n#menu a {\r\n color: #FFFFFF;\r\n display: block;\r\n border: #A11204 3px outset;\r\n text-decoration: none;\r\n}\r\n#menu a:hover {\r\n border: #A11204 3px inset;\r\n}\r\n.content {\r\n border: 3px double #A11204;\r\n margin: 1em;\r\n margin-left: 110px;\r\n padding-left: 1em;\r\n padding-bottom: 1em;\r\n padding-right: 1em;\r\n border-radius: 5px;\r\n box-shadow: 5px 5px 5px gray;\r\n}\r\n.content h2 {\r\n background-color: #A11204;\r\n background-image: url(\"cbBackground.png\");\r\n color: #FFFFFF;\r\n text-align: right;\r\n}\r\n#footer {\r\n color: #FFFFFF;\r\n background-color: #000000;\r\n border: 1px solid #A11204;\r\n float: left;\r\n clear: both;\r\n width: 100%;\r\n text-align: center;\r\n}</pre>","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}},{"authorId":11290,"name":"Paul McFedries","slug":"paul-mcfedries","description":" <p><b>Paul McFedries</b> is a true renaissance geek. He has been a programmer, consultant, database developer, and website builder. He&#39;s also the author of more than 90 books including top sellers covering Windows, Office, and macOS. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/11290"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-649c9f9803586\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-649c9f98040d3\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Five years","lifeExpectancySetFrom":"2023-06-28T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":156641},{"headers":{"creationTime":"2016-03-26T13:18:03+00:00","modifiedTime":"2023-05-03T18:30:51+00:00","timestamp":"2023-05-03T21:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"Setting the Font on HTML5 and CSS3 Web Pages","strippedTitle":"setting the font on html5 and css3 web pages","slug":"how-to-set-the-font-family-on-html5-and-css3-web-pages","canonicalUrl":"","seo":{"metaDescription":"To assign a font family to part of your page, use some new CSS. As an example, this page has the heading set to Comic Sans MS. If this page is viewed on a Windo","noIndex":0,"noFollow":0},"content":"To assign a font family to part of your page, use some new CSS. As an example, this page has the heading set to Comic Sans MS. If this page is viewed on a Windows machine, it generally displays the font correctly because Comic Sans MS is installed with most versions of Windows. If you're on another type of machine, you may get something else. Look at the simple case.\r\n\r\nHere's the code:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en-US\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;comicHead.html&lt;/title&gt;\r\n &lt;style type = \"text/css\"&gt;\r\n h1 {\r\n font-family: \"Comic Sans MS\";\r\n }\r\n &lt;/style&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;This is a heading&lt;/h1&gt;\r\n &lt;p&gt;\r\n This is ordinary text.\r\n &lt;/p&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe secret to this page is the CSS attribute. Like most CSS elements, this can be applied to any HTML tag on your page. In this particular case, it was applied it to the level one heading.\r\n<pre class=\"code\"> h1 {\r\n font-family: \"Comic Sans MS\";\r\n }</pre>\r\nYou can then attach any font name you wish, and the browser attempts to use that font to display the element.\r\n<p class=\"Warning\">Even though a font may work perfectly fine on your computer, it may not work if that font isn't installed on the user's machine.</p>\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412139.image0.jpg\" alt=\"image0.jpg\" width=\"533\" height=\"400\" />\r\n\r\nIf you run exactly the same page on an iPad, you might see this result.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412140.image1.jpg\" alt=\"image1.jpg\" width=\"533\" height=\"400\" />\r\n\r\nThe specific font Comic Sans MS is installed on Windows machines, but the <i>MS</i> stands for Microsoft. This font isn't always installed on Linux or Mac. (Sometimes it's there, and sometimes it isn't.) You can't count on users having any particular fonts installed.\r\n<p class=\"Tip\">The Comic Sans font is fine for an example, but it has been heavily over-used in web development. Serious web developers avoid using it in real applications because it tends to make your page look amateurish.</p>","description":"To assign a font family to part of your page, use some new CSS. As an example, this page has the heading set to Comic Sans MS. If this page is viewed on a Windows machine, it generally displays the font correctly because Comic Sans MS is installed with most versions of Windows. If you're on another type of machine, you may get something else. Look at the simple case.\r\n\r\nHere's the code:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en-US\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;comicHead.html&lt;/title&gt;\r\n &lt;style type = \"text/css\"&gt;\r\n h1 {\r\n font-family: \"Comic Sans MS\";\r\n }\r\n &lt;/style&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;This is a heading&lt;/h1&gt;\r\n &lt;p&gt;\r\n This is ordinary text.\r\n &lt;/p&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe secret to this page is the CSS attribute. Like most CSS elements, this can be applied to any HTML tag on your page. In this particular case, it was applied it to the level one heading.\r\n<pre class=\"code\"> h1 {\r\n font-family: \"Comic Sans MS\";\r\n }</pre>\r\nYou can then attach any font name you wish, and the browser attempts to use that font to display the element.\r\n<p class=\"Warning\">Even though a font may work perfectly fine on your computer, it may not work if that font isn't installed on the user's machine.</p>\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412139.image0.jpg\" alt=\"image0.jpg\" width=\"533\" height=\"400\" />\r\n\r\nIf you run exactly the same page on an iPad, you might see this result.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412140.image1.jpg\" alt=\"image1.jpg\" width=\"533\" height=\"400\" />\r\n\r\nThe specific font Comic Sans MS is installed on Windows machines, but the <i>MS</i> stands for Microsoft. This font isn't always installed on Linux or Mac. (Sometimes it's there, and sometimes it isn't.) You can't count on users having any particular fonts installed.\r\n<p class=\"Tip\">The Comic Sans font is fine for an example, but it has been heavily over-used in web development. Serious web developers avoid using it in real applications because it tends to make your page look amateurish.</p>","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}},{"authorId":11290,"name":"Paul McFedries","slug":"paul-mcfedries","description":" <p><b>Paul McFedries</b> is a technical writer who has been authoring computer books since 1991 and has over 100 books to his credit. These books include <i>Alexa For Dummies, Amazon Fire TV For Dummies</i>, and <i>Cord Cutting For Dummies</i>. You can visit Paul on the web at www.mcfedries.com.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/11290"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-6452cb8f15dad\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-6452cb8f1653a\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Five years","lifeExpectancySetFrom":"2023-05-03T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":157198},{"headers":{"creationTime":"2016-03-26T13:15:22+00:00","modifiedTime":"2022-09-19T15:09:40+00:00","timestamp":"2022-09-20T16:51:28+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"How to Build a Basic Array in JavaScript for HTML5 and CSS3 Programming","strippedTitle":"how to build a basic array in javascript for html5 and css3 programming","slug":"how-to-build-a-basic-array-in-javascript-for-html5-and-css3-programming","canonicalUrl":"","seo":{"metaDescription":"A rrays are groups of variables in JavaScript with a name. Arrays are similar to functions because they're used to manage complexity for HTML5 and CSS3 programm","noIndex":0,"noFollow":0},"content":"<i>A</i><i>rrays</i> are groups of variables in JavaScript with a name. Arrays are similar to functions because they're used to manage complexity for HTML5 and CSS3 programming. An array is a special kind of variable. Use an array whenever you want to work with a list of similar data types.\r\n\r\nThe following code shows a basic demonstration of arrays:\r\n<pre class=\"code\"> &lt;script type = \"text/javascript\"&gt;\r\n //from genres.html\r\n //creating an empty array\r\n var genre = new Array(5);\r\n //storing data in the array\r\n genre[0] = \"flight simulation\";\r\n genre[1] = \"first-person shooters\";\r\n genre[2] = \"driving\";\r\n genre[3] = \"action\";\r\n genre[4] = \"strategy\";\r\n //returning data from the array\r\n alert (\"I like \" + genre[4] + \" games.\");\r\n //]]&gt;\r\n &lt;/script&gt;</pre>\r\nThe variable is a special variable because it contains many values. Essentially, it's a list of genres. The <span class=\"code\">array(5)</span> construct creates space in memory for five variables, all named <span class=\"code\">genre</span>.\r\n<h2 id=\"tab1\" >Accessing array data</h2>\r\nAfter you specify an array, you can work with the individual elements using square-bracket syntax. An integer identifies each element of the array. The index usually begins with.\r\n<pre class=\"code\"> genre[0] = \"flight simulation\";</pre>\r\nThe preceding code assigns the text value <span class=\"code\">“flight simulation”</span> to the <span class=\"code\">genre</span> array variable at position <span class=\"code\">0</span>.\r\n<p class=\"TechnicalStuff\">Most languages require all array elements to be the same type. JavaScript is very forgiving. You can combine all kinds of stuff in a JavaScript array. This flexibility can sometimes be useful, but be aware that this trick doesn't work in all languages. Generally, try to keep all the members of an array the same type.</p>\r\nAfter you store the data in the array, you can use the same square-bracket syntax to read the information.\r\n\r\nThe line\r\n<pre class=\"code\"> alert (\"I like \" + genre[4] + \" games.\");</pre>\r\nfinds element 4 of the <span class=\"code\">genre</span> array and includes it in an output message.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412830.image0.jpg\" alt=\"image0.jpg\" width=\"535\" height=\"177\" />\r\n<h2 id=\"tab2\" >Using arrays with for loops</h2>\r\nThe main reason to use arrays is convenience. When you have a lot of information in an array, you can write code to work with the data quickly. Whenever you have an array of data, you commonly want to do something with each element in the array. Take a look at to see how you can do so:\r\n<pre class=\"code\"> &lt;script type = \"text/javascript\"&gt;\r\n //from games.html\r\n //pre-loading an array\r\n var gameList = new Array(\"Flight Gear\", \"Sauerbraten\", \"Future Pinball\",\r\n \"Racer\", \"TORCS\", \"Orbiter\", \"Step Mania\", \"NetHack\",\r\n \"Marathon\", \"Crimson Fields\");\r\n var text = \";\r\n for (i = 0; i &lt; gameList.length; i++){\r\n text += \"I love \" + gameList[i] + \"n\";\r\n } // end for loop\r\n alert(text);\r\n &lt;/script&gt;</pre>\r\nNotice several things in this code:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The array called </b><span class=\"code\">gameList</span><b>.</b> This array contains the names of some great freeware games.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The array is preloaded with values.</b> If you provide a list of values when creating an array, JavaScript simply preloads the array with the values you indicate. You don't need to specify the size of the array if you preload it.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>A </b><span class=\"code\">for</span><b> loop steps through the array.</b> Arrays and <span class=\"code\">for</span> loops are natural companions. The <span class=\"code\">for</span> loop steps through each element of the array.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The array's length is used in the </b><span class=\"code\">for</span><b> loop condition.</b> Rather than specifying the value 10, the array's <span class=\"code\">length</span> property was used in the loop. This practice is good because the <span class=\"code\">for</span> loop automatically adjusts to the size of the array when you add or remove elements.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Do something with each element.</b> Because goes from 0 to 9 (the array indices), you can easily print each value of the array. In this example, an output string was added to.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Note the newline characters.</b> The <span class=\"code\">n</span> combination is a special character that tells JavaScript to add a carriage return, such as you get by pressing the Enter key.</p>\r\n</li>\r\n</ul>\r\n<p class=\"Tip\">If you want to completely ruin your productivity, Google some of these game names. They're absolutely incredible, and every one of them is free. You can't beat that.</p>\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412831.image1.jpg\" alt=\"image1.jpg\" width=\"529\" height=\"400\" />","description":"<i>A</i><i>rrays</i> are groups of variables in JavaScript with a name. Arrays are similar to functions because they're used to manage complexity for HTML5 and CSS3 programming. An array is a special kind of variable. Use an array whenever you want to work with a list of similar data types.\r\n\r\nThe following code shows a basic demonstration of arrays:\r\n<pre class=\"code\"> &lt;script type = \"text/javascript\"&gt;\r\n //from genres.html\r\n //creating an empty array\r\n var genre = new Array(5);\r\n //storing data in the array\r\n genre[0] = \"flight simulation\";\r\n genre[1] = \"first-person shooters\";\r\n genre[2] = \"driving\";\r\n genre[3] = \"action\";\r\n genre[4] = \"strategy\";\r\n //returning data from the array\r\n alert (\"I like \" + genre[4] + \" games.\");\r\n //]]&gt;\r\n &lt;/script&gt;</pre>\r\nThe variable is a special variable because it contains many values. Essentially, it's a list of genres. The <span class=\"code\">array(5)</span> construct creates space in memory for five variables, all named <span class=\"code\">genre</span>.\r\n<h2 id=\"tab1\" >Accessing array data</h2>\r\nAfter you specify an array, you can work with the individual elements using square-bracket syntax. An integer identifies each element of the array. The index usually begins with.\r\n<pre class=\"code\"> genre[0] = \"flight simulation\";</pre>\r\nThe preceding code assigns the text value <span class=\"code\">“flight simulation”</span> to the <span class=\"code\">genre</span> array variable at position <span class=\"code\">0</span>.\r\n<p class=\"TechnicalStuff\">Most languages require all array elements to be the same type. JavaScript is very forgiving. You can combine all kinds of stuff in a JavaScript array. This flexibility can sometimes be useful, but be aware that this trick doesn't work in all languages. Generally, try to keep all the members of an array the same type.</p>\r\nAfter you store the data in the array, you can use the same square-bracket syntax to read the information.\r\n\r\nThe line\r\n<pre class=\"code\"> alert (\"I like \" + genre[4] + \" games.\");</pre>\r\nfinds element 4 of the <span class=\"code\">genre</span> array and includes it in an output message.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412830.image0.jpg\" alt=\"image0.jpg\" width=\"535\" height=\"177\" />\r\n<h2 id=\"tab2\" >Using arrays with for loops</h2>\r\nThe main reason to use arrays is convenience. When you have a lot of information in an array, you can write code to work with the data quickly. Whenever you have an array of data, you commonly want to do something with each element in the array. Take a look at to see how you can do so:\r\n<pre class=\"code\"> &lt;script type = \"text/javascript\"&gt;\r\n //from games.html\r\n //pre-loading an array\r\n var gameList = new Array(\"Flight Gear\", \"Sauerbraten\", \"Future Pinball\",\r\n \"Racer\", \"TORCS\", \"Orbiter\", \"Step Mania\", \"NetHack\",\r\n \"Marathon\", \"Crimson Fields\");\r\n var text = \";\r\n for (i = 0; i &lt; gameList.length; i++){\r\n text += \"I love \" + gameList[i] + \"n\";\r\n } // end for loop\r\n alert(text);\r\n &lt;/script&gt;</pre>\r\nNotice several things in this code:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The array called </b><span class=\"code\">gameList</span><b>.</b> This array contains the names of some great freeware games.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The array is preloaded with values.</b> If you provide a list of values when creating an array, JavaScript simply preloads the array with the values you indicate. You don't need to specify the size of the array if you preload it.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>A </b><span class=\"code\">for</span><b> loop steps through the array.</b> Arrays and <span class=\"code\">for</span> loops are natural companions. The <span class=\"code\">for</span> loop steps through each element of the array.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The array's length is used in the </b><span class=\"code\">for</span><b> loop condition.</b> Rather than specifying the value 10, the array's <span class=\"code\">length</span> property was used in the loop. This practice is good because the <span class=\"code\">for</span> loop automatically adjusts to the size of the array when you add or remove elements.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Do something with each element.</b> Because goes from 0 to 9 (the array indices), you can easily print each value of the array. In this example, an output string was added to.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Note the newline characters.</b> The <span class=\"code\">n</span> combination is a special character that tells JavaScript to add a carriage return, such as you get by pressing the Enter key.</p>\r\n</li>\r\n</ul>\r\n<p class=\"Tip\">If you want to completely ruin your productivity, Google some of these game names. They're absolutely incredible, and every one of them is free. You can't beat that.</p>\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412831.image1.jpg\" alt=\"image1.jpg\" width=\"529\" height=\"400\" />","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[{"label":"Accessing array data","target":"#tab1"},{"label":"Using arrays with for loops","target":"#tab2"}],"relatedArticles":{"fromBook":[{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-6329ef90b6e14\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-6329ef90b7ab1\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Five years","lifeExpectancySetFrom":"2022-09-19T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":156902},{"headers":{"creationTime":"2016-03-26T14:02:54+00:00","modifiedTime":"2022-08-11T20:10:42+00:00","timestamp":"2022-09-14T18:19:54+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"How to Create Definition Lists in HTML5","strippedTitle":"how to create definition lists in html5","slug":"how-to-create-definition-lists-in-html5","canonicalUrl":"","seo":{"metaDescription":"Definition lists group terms and definitions into a single list. Learn how to create definition lists in HTML5.","noIndex":0,"noFollow":0},"content":"Lists are powerful tools for grouping similar elements, and lists give visitors to your site an easy way to zoom in on groups of information. Just about anything fits in a list, from sets of instructions to collections of links. <i>Definition lists</i> group terms and definitions into a single list and require three elements to complete the list:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dl></span>: Holds the list definitions (dl = definition list)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dt></span>: Defines a term in the list (dt = definition term)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dd></span>: Defines a definition for a term (dd = definition list definition)</p>\r\n</li>\r\n</ul>\r\nYou can have as many terms (defined by <span class=\"code\"><dt></span>) in a list (<span class=\"code\"><dl></span>) as you need. Each term can have one or more definitions (defined by <span class=\"code\"><dd></span>).\r\n\r\nCreating a definition list with two items requires tags and content in the following order:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dl></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">First term name</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Content for the definition of the first item</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Second term name</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Content for the definition of the second item</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dl></span></p>\r\n</li>\r\n</ol>\r\nThe following definition list includes three terms, one of which has two definitions:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n &lt;head&gt;\r\n &lt;meta charset=\"UTF-8\" /&gt;\r\n &lt;title&gt;Definition Lists&lt;/title&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;Markup Language Definitions&lt;/h1&gt;\r\n &lt;dl&gt;\r\n &lt;dt&gt;SGML&lt;/dt&gt;\r\n &lt;dd&gt;The Standard Generalized Markup Language&lt;/dd&gt;\r\n &lt;dt&gt;HTML&lt;/dt&gt;\r\n &lt;dd&gt;The Hypertext Markup Language&lt;/dd&gt;\r\n &lt;dd&gt;The markup language you use to create web pages.&lt;/dd&gt;\r\n &lt;dt&gt;XML&lt;/dt&gt;\r\n &lt;dd&gt;The Extensible Markup Language&lt;/dd&gt;\r\n &lt;/dl&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe figure shows how a browser displays this HTML.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/398569.image0.jpg\" alt=\"image0.jpg\" width=\"503\" height=\"400\" />\r\n<p class=\"Tip\">If you think items in a list are too close together, you can use CSS styles to carefully control all aspects of list appearance.</p>\r\nNote that definition lists often display differently inside different browsers, and they aren’t always handled the same by search engines or text-to-speech translators. About.com has a nice discussion of definition lists on their <a href=\"http://webdesign.about.com/od/htmltags/a/aa112006.htm\">Web Design / HTML page</a>.\r\n\r\nAlas, this means that definition lists may not be the best choice of formatting for lists you create (even lists of definitions). For a more detailed discussion, see the excellent coverage of this topic on <a href=\"http://www.maxdesign.com.au/articles/definition/\">Max Design</a>.","description":"Lists are powerful tools for grouping similar elements, and lists give visitors to your site an easy way to zoom in on groups of information. Just about anything fits in a list, from sets of instructions to collections of links. <i>Definition lists</i> group terms and definitions into a single list and require three elements to complete the list:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dl></span>: Holds the list definitions (dl = definition list)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dt></span>: Defines a term in the list (dt = definition term)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dd></span>: Defines a definition for a term (dd = definition list definition)</p>\r\n</li>\r\n</ul>\r\nYou can have as many terms (defined by <span class=\"code\"><dt></span>) in a list (<span class=\"code\"><dl></span>) as you need. Each term can have one or more definitions (defined by <span class=\"code\"><dd></span>).\r\n\r\nCreating a definition list with two items requires tags and content in the following order:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dl></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">First term name</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Content for the definition of the first item</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Second term name</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dt></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"><dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Content for the definition of the second item</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dd></span></p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><span class=\"code\"></dl></span></p>\r\n</li>\r\n</ol>\r\nThe following definition list includes three terms, one of which has two definitions:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n &lt;head&gt;\r\n &lt;meta charset=\"UTF-8\" /&gt;\r\n &lt;title&gt;Definition Lists&lt;/title&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;Markup Language Definitions&lt;/h1&gt;\r\n &lt;dl&gt;\r\n &lt;dt&gt;SGML&lt;/dt&gt;\r\n &lt;dd&gt;The Standard Generalized Markup Language&lt;/dd&gt;\r\n &lt;dt&gt;HTML&lt;/dt&gt;\r\n &lt;dd&gt;The Hypertext Markup Language&lt;/dd&gt;\r\n &lt;dd&gt;The markup language you use to create web pages.&lt;/dd&gt;\r\n &lt;dt&gt;XML&lt;/dt&gt;\r\n &lt;dd&gt;The Extensible Markup Language&lt;/dd&gt;\r\n &lt;/dl&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe figure shows how a browser displays this HTML.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/398569.image0.jpg\" alt=\"image0.jpg\" width=\"503\" height=\"400\" />\r\n<p class=\"Tip\">If you think items in a list are too close together, you can use CSS styles to carefully control all aspects of list appearance.</p>\r\nNote that definition lists often display differently inside different browsers, and they aren’t always handled the same by search engines or text-to-speech translators. About.com has a nice discussion of definition lists on their <a href=\"http://webdesign.about.com/od/htmltags/a/aa112006.htm\">Web Design / HTML page</a>.\r\n\r\nAlas, this means that definition lists may not be the best choice of formatting for lists you create (even lists of definitions). For a more detailed discussion, see the excellent coverage of this topic on <a href=\"http://www.maxdesign.com.au/articles/definition/\">Max Design</a>.","blurb":"","authors":[{"authorId":9135,"name":"Ed Tittel","slug":"ed-tittel","description":" <b>Ed Tittel</b> is a computer trainer and author who has worked on more than 20 <i>For Dummies</i> books. <p><b>James Michael Stewart</b> is an independent security consultant who works as a writer and trainer.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9135"}},{"authorId":9070,"name":"Chris Minnick","slug":"chris-minnick","description":" <p>This All-in-One includes work by expert coders and coding educators, including <b>Chris Minnick and Eva Holland </b>coauthors of<i> Coding with JavaScript For Dummies</i>; <b>Nikhil Abraham,</b> author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies;</i> <b>John Paul Mueller and Luca Massaron,</b> coauthors of <i>Python for Data Science For Dummies</i> and <i>Machine Learning For Dummies;</i> and <b>Barry Burd,</b> author of<i> Flutter For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9070"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":204301,"title":"10 Stellar Web Resources for HTML5 and CSS3","slug":"10-stellar-web-resources-for-html5-and-css3","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204301"}},{"articleId":163221,"title":"CSS Property Reference","slug":"css-property-reference","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163221"}},{"articleId":163220,"title":"Know Your Elements!","slug":"know-your-elements","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163220"}},{"articleId":163158,"title":"Named Colors and Hex Values in HTML","slug":"named-colors-and-hex-values-in-html","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163158"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281635,"slug":"beginning-html5-and-css3-for-dummies","isbn":"9781118657201","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118657209-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/beginning-html5-and-css3-for-dummies-cover-9781118657201-205x255.jpg","width":205,"height":255},"title":"Beginning HTML5 and CSS3 For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9135\">Ed Tittel</b> is a 30-year veteran of the technology industry with more than 140 computing books to his credit, including the bestselling <i>HTML For Dummies</i>. </p>\n<p><b data-author-id=\"9070\">Chris Minnick</b> runs Minnick Web Services. He teaches, speaks, and consults on web-related topics and has contributed to numerous books, including <i>WebKit For Dummies</i>. </p>","authors":[{"authorId":9135,"name":"Ed Tittel","slug":"ed-tittel","description":" <b>Ed Tittel</b> is a computer trainer and author who has worked on more than 20 <i>For Dummies</i> books. <p><b>James Michael Stewart</b> is an independent security consultant who works as a writer and trainer.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9135"}},{"authorId":9070,"name":"Chris Minnick","slug":"chris-minnick","description":" <p>This All-in-One includes work by expert coders and coding educators, including <b>Chris Minnick and Eva Holland </b>coauthors of<i> Coding with JavaScript For Dummies</i>; <b>Nikhil Abraham,</b> author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies;</i> <b>John Paul Mueller and Luca Massaron,</b> coauthors of <i>Python for Data Science For Dummies</i> and <i>Machine Learning For Dummies;</i> and <b>Barry Burd,</b> author of<i> Flutter For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9070"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118657201&quot;]}]\" id=\"du-slot-63221b4a38b89\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118657201&quot;]}]\" id=\"du-slot-63221b4a3968c\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-08-11T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":161044},{"headers":{"creationTime":"2016-03-26T14:20:56+00:00","modifiedTime":"2022-08-02T19:44:17+00:00","timestamp":"2022-09-14T18:19:50+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"Mobile First Web Design","strippedTitle":"mobile first web design","slug":"mobile-first-web-design","canonicalUrl":"","seo":{"metaDescription":"Two big categories of strategies have been employed over the years to support web design for mobile devices: graceful degradation and progressive enhancement . ","noIndex":0,"noFollow":0},"content":"<p>Two big categories of strategies have been employed over the years to support web design for mobile devices: <i>graceful degradation</i> and <i>progressive enhancement</i>. Much of the web is currently nearly unusable on mobile devices because it was designed for desktop browsers and doesn't adapt well to small screens.</p>\r\n<p>Mobile web users are often forced to zoom, scroll, pinch, squint, and make their fingers as small as possible to use the majority of websites designed more than a couple years ago.</p>\r\n<h2 id=\"tab1\" >Graceful degradation web design strategy for mobile devices</h2>\r\n<p>The idea behind graceful degradation is to design your website primarily for desktop users, but to also design it in such a way that features of the desktop site that won't work or fit on mobile devices will still be usable — if not pretty or as functional — on mobile devices.</p>\r\n<p class=\"Warning\">Graceful degradation was a good design philosophy in the days before smartphones with full-featured browsers existed. However, graceful degradation does have major problems. Most importantly, graceful degradation forces the user to download your whole website, only to be shown a degraded version of it. On mobile devices, which often have limited bandwidth, this is not a good thing.</p>\r\n<h2 id=\"tab2\" >Progressive enhancement web design strategy for mobile devices</h2>\r\n<p>As a result of graceful degradation's limitations, a new strategy called progressive enhancement has become popular. Progressive enhancement starts with the very most basic website and adds on features depending on what the user's browser supports.</p>\r\n<p>Progressive enhancement enables websites to be usable even when using a very basic mobile phone. The mobile browser doesn't need to download a lot of CSS and JavaScript code (for example) that it doesn't know what to do with.</p>\r\n<p class=\"Remember\">One way to visualize progressive enhancement is as a system that adds layers onto a website depending on the size of the browser or the features the browser supports.</p>\r\n<p>Here's a simple example of how two style sheet links can be used to enhance a mobile webpage for larger browsers:</p>\r\n<pre class=\"code\">&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" media=\"screen, handheld\" /&gt; \r\n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"enhanced.css\" media=\"screen and (min-width: 800px)\" /&gt;</pre>\r\n<p>The first link includes <span class=\"code\">style.css</span> for any screen or handheld device. In this case, <span class=\"code\">style.css</span> contains styles that are optimized for a mobile device.</p>\r\n<p>The second link is for a style sheet called <pre class=\"code\">enhanced.css</pre>. If you look at the <pre class=\"code\">media</pre> attribute for this link, you'll notice that it has a <pre class=\"code\">min-width</pre> condition. The <pre class=\"code\">enhanced.css</pre> file will only be included if the device is larger than 800px. Inside <pre class=\"code\">enhanced.css</pre>, the web designer can override properties from the <pre class=\"code\">style.css</pre> style sheet to make the browser scale up for larger browser widths.</p>\r\n<h2 id=\"tab3\" >Mobile first design solves the browser size issue</h2>\r\n<p>Mobile first is a design philosophy that employs the ideas of progressive enhancement to build mobile websites first and then enhance them for desktop. The great thing about mobile first design is that when you build the mobile site first, as opposed to the other way around, you get a functional desktop site for free!</p>\r\n<p>Think about all the websites you've seen that don't fit in mobile browsers. Now, imagine visiting a mobile website with a desktop computer. A website that is optimized for a small screen will always work on a desktop browser — even if it does end up not filling the entire browser window.</p>","description":"<p>Two big categories of strategies have been employed over the years to support web design for mobile devices: <i>graceful degradation</i> and <i>progressive enhancement</i>. Much of the web is currently nearly unusable on mobile devices because it was designed for desktop browsers and doesn't adapt well to small screens.</p>\r\n<p>Mobile web users are often forced to zoom, scroll, pinch, squint, and make their fingers as small as possible to use the majority of websites designed more than a couple years ago.</p>\r\n<h2 id=\"tab1\" >Graceful degradation web design strategy for mobile devices</h2>\r\n<p>The idea behind graceful degradation is to design your website primarily for desktop users, but to also design it in such a way that features of the desktop site that won't work or fit on mobile devices will still be usable — if not pretty or as functional — on mobile devices.</p>\r\n<p class=\"Warning\">Graceful degradation was a good design philosophy in the days before smartphones with full-featured browsers existed. However, graceful degradation does have major problems. Most importantly, graceful degradation forces the user to download your whole website, only to be shown a degraded version of it. On mobile devices, which often have limited bandwidth, this is not a good thing.</p>\r\n<h2 id=\"tab2\" >Progressive enhancement web design strategy for mobile devices</h2>\r\n<p>As a result of graceful degradation's limitations, a new strategy called progressive enhancement has become popular. Progressive enhancement starts with the very most basic website and adds on features depending on what the user's browser supports.</p>\r\n<p>Progressive enhancement enables websites to be usable even when using a very basic mobile phone. The mobile browser doesn't need to download a lot of CSS and JavaScript code (for example) that it doesn't know what to do with.</p>\r\n<p class=\"Remember\">One way to visualize progressive enhancement is as a system that adds layers onto a website depending on the size of the browser or the features the browser supports.</p>\r\n<p>Here's a simple example of how two style sheet links can be used to enhance a mobile webpage for larger browsers:</p>\r\n<pre class=\"code\">&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" media=\"screen, handheld\" /&gt; \r\n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"enhanced.css\" media=\"screen and (min-width: 800px)\" /&gt;</pre>\r\n<p>The first link includes <span class=\"code\">style.css</span> for any screen or handheld device. In this case, <span class=\"code\">style.css</span> contains styles that are optimized for a mobile device.</p>\r\n<p>The second link is for a style sheet called <pre class=\"code\">enhanced.css</pre>. If you look at the <pre class=\"code\">media</pre> attribute for this link, you'll notice that it has a <pre class=\"code\">min-width</pre> condition. The <pre class=\"code\">enhanced.css</pre> file will only be included if the device is larger than 800px. Inside <pre class=\"code\">enhanced.css</pre>, the web designer can override properties from the <pre class=\"code\">style.css</pre> style sheet to make the browser scale up for larger browser widths.</p>\r\n<h2 id=\"tab3\" >Mobile first design solves the browser size issue</h2>\r\n<p>Mobile first is a design philosophy that employs the ideas of progressive enhancement to build mobile websites first and then enhance them for desktop. The great thing about mobile first design is that when you build the mobile site first, as opposed to the other way around, you get a functional desktop site for free!</p>\r\n<p>Think about all the websites you've seen that don't fit in mobile browsers. Now, imagine visiting a mobile website with a desktop computer. A website that is optimized for a small screen will always work on a desktop browser — even if it does end up not filling the entire browser window.</p>","blurb":"","authors":[{"authorId":9135,"name":"Ed Tittel","slug":"ed-tittel","description":" <b>Ed Tittel</b> is a computer trainer and author who has worked on more than 20 <i>For Dummies</i> books. <p><b>James Michael Stewart</b> is an independent security consultant who works as a writer and trainer.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9135"}},{"authorId":9070,"name":"Chris Minnick","slug":"chris-minnick","description":" <p>This All-in-One includes work by expert coders and coding educators, including <b>Chris Minnick and Eva Holland </b>coauthors of<i> Coding with JavaScript For Dummies</i>; <b>Nikhil Abraham,</b> author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies;</i> <b>John Paul Mueller and Luca Massaron,</b> coauthors of <i>Python for Data Science For Dummies</i> and <i>Machine Learning For Dummies;</i> and <b>Barry Burd,</b> author of<i> Flutter For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9070"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[{"label":"Graceful degradation web design strategy for mobile devices","target":"#tab1"},{"label":"Progressive enhancement web design strategy for mobile devices","target":"#tab2"},{"label":"Mobile first design solves the browser size issue","target":"#tab3"}],"relatedArticles":{"fromBook":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":204301,"title":"10 Stellar Web Resources for HTML5 and CSS3","slug":"10-stellar-web-resources-for-html5-and-css3","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204301"}},{"articleId":163221,"title":"CSS Property Reference","slug":"css-property-reference","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163221"}},{"articleId":163220,"title":"Know Your Elements!","slug":"know-your-elements","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163220"}},{"articleId":163158,"title":"Named Colors and Hex Values in HTML","slug":"named-colors-and-hex-values-in-html","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163158"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281635,"slug":"beginning-html5-and-css3-for-dummies","isbn":"9781118657201","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118657209-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/beginning-html5-and-css3-for-dummies-cover-9781118657201-205x255.jpg","width":205,"height":255},"title":"Beginning HTML5 and CSS3 For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9135\">Ed Tittel</b> is a 30-year veteran of the technology industry with more than 140 computing books to his credit, including the bestselling <i>HTML For Dummies</i>. </p>\n<p><b data-author-id=\"9070\">Chris Minnick</b> runs Minnick Web Services. He teaches, speaks, and consults on web-related topics and has contributed to numerous books, including <i>WebKit For Dummies</i>. </p>","authors":[{"authorId":9135,"name":"Ed Tittel","slug":"ed-tittel","description":" <b>Ed Tittel</b> is a computer trainer and author who has worked on more than 20 <i>For Dummies</i> books. <p><b>James Michael Stewart</b> is an independent security consultant who works as a writer and trainer.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9135"}},{"authorId":9070,"name":"Chris Minnick","slug":"chris-minnick","description":" <p>This All-in-One includes work by expert coders and coding educators, including <b>Chris Minnick and Eva Holland </b>coauthors of<i> Coding with JavaScript For Dummies</i>; <b>Nikhil Abraham,</b> author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies;</i> <b>John Paul Mueller and Luca Massaron,</b> coauthors of <i>Python for Data Science For Dummies</i> and <i>Machine Learning For Dummies;</i> and <b>Barry Burd,</b> author of<i> Flutter For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9070"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118657201&quot;]}]\" id=\"du-slot-63221b4692757\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118657201&quot;]}]\" id=\"du-slot-63221b4693158\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-08-02T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":163031},{"headers":{"creationTime":"2016-03-27T16:48:56+00:00","modifiedTime":"2022-03-18T18:24:56+00:00","timestamp":"2022-09-14T18:19:28+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","strippedTitle":"beginning html5 & css3 for dummies cheat sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Learn the ins and outs of Hypertext Markup Language (HTML) and the Cascading Style Sheet (CSS) language with these tables of properties.","noIndex":0,"noFollow":0},"content":"Hypertext Markup Language (HTML) and the Cascading Style Sheet (CSS) language are the lifeblood of web pages. Even experienced web designers and authors need help sometimes. This Cheat Sheet provides a quick color code guide, a table of HTML5 elements, and a table of CSS properties.","description":"Hypertext Markup Language (HTML) and the Cascading Style Sheet (CSS) language are the lifeblood of web pages. Even experienced web designers and authors need help sometimes. This Cheat Sheet provides a quick color code guide, a table of HTML5 elements, and a table of CSS properties.","blurb":"","authors":[{"authorId":9135,"name":"Ed Tittel","slug":"ed-tittel","description":" <b>Ed Tittel</b> is a computer trainer and author who has worked on more than 20 <i>For Dummies</i> books. <p><b>James Michael Stewart</b> is an independent security consultant who works as a writer and trainer.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9135"}},{"authorId":9070,"name":"Chris Minnick","slug":"chris-minnick","description":" <p>This All-in-One includes work by expert coders and coding educators, including <b>Chris Minnick and Eva Holland </b>coauthors of<i> Coding with JavaScript For Dummies</i>; <b>Nikhil Abraham,</b> author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies;</i> <b>John Paul Mueller and Luca Massaron,</b> coauthors of <i>Python for Data Science For Dummies</i> and <i>Machine Learning For Dummies;</i> and <b>Barry Burd,</b> author of<i> Flutter For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9070"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":204301,"title":"10 Stellar Web Resources for HTML5 and CSS3","slug":"10-stellar-web-resources-for-html5-and-css3","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204301"}},{"articleId":163220,"title":"Know Your Elements!","slug":"know-your-elements","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163220"}},{"articleId":163221,"title":"CSS Property Reference","slug":"css-property-reference","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163221"}},{"articleId":163158,"title":"Named Colors and Hex Values in HTML","slug":"named-colors-and-hex-values-in-html","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163158"}},{"articleId":163090,"title":"A Quick Guide to the CSS Value Definition Syntax","slug":"a-quick-guide-to-the-css-value-definition-syntax","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163090"}}],"fromCategory":[{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}},{"articleId":204301,"title":"10 Stellar Web Resources for HTML5 and CSS3","slug":"10-stellar-web-resources-for-html5-and-css3","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204301"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281635,"slug":"beginning-html5-and-css3-for-dummies","isbn":"9781118657201","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118657209-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118657209/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/beginning-html5-and-css3-for-dummies-cover-9781118657201-205x255.jpg","width":205,"height":255},"title":"Beginning HTML5 and CSS3 For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9135\">Ed Tittel</b> is a 30-year veteran of the technology industry with more than 140 computing books to his credit, including the bestselling <i>HTML For Dummies</i>. </p>\n<p><b data-author-id=\"9070\">Chris Minnick</b> runs Minnick Web Services. He teaches, speaks, and consults on web-related topics and has contributed to numerous books, including <i>WebKit For Dummies</i>. </p>","authors":[{"authorId":9135,"name":"Ed Tittel","slug":"ed-tittel","description":" <b>Ed Tittel</b> is a computer trainer and author who has worked on more than 20 <i>For Dummies</i> books. <p><b>James Michael Stewart</b> is an independent security consultant who works as a writer and trainer.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9135"}},{"authorId":9070,"name":"Chris Minnick","slug":"chris-minnick","description":" <p>This All-in-One includes work by expert coders and coding educators, including <b>Chris Minnick and Eva Holland </b>coauthors of<i> Coding with JavaScript For Dummies</i>; <b>Nikhil Abraham,</b> author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies;</i> <b>John Paul Mueller and Luca Massaron,</b> coauthors of <i>Python for Data Science For Dummies</i> and <i>Machine Learning For Dummies;</i> and <b>Barry Burd,</b> author of<i> Flutter For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9070"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118657201&quot;]}]\" id=\"du-slot-63221b30725c1\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118657201&quot;]}]\" id=\"du-slot-63221b307303a\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":163158,"title":"Named Colors and Hex Values in HTML","slug":"named-colors-and-hex-values-in-html","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163158"}},{"articleId":163220,"title":"Know Your Elements!","slug":"know-your-elements","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163220"}},{"articleId":163221,"title":"CSS Property Reference","slug":"css-property-reference","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/163221"}}],"content":[{"title":"Named colors and hex values in HTML","thumb":null,"image":null,"content":"<p>The following table contains a list of named colors you can use in HTML and CSS code to create a more colorful website. The colors are shown with their corresponding RGB hexcode values along with a representative color swatch.</p>\n<table>\n<tbody>\n<tr>\n<th></th>\n<th>Name</th>\n<th>Hexcode</th>\n</tr>\n<tr>\n<td bgcolor=\"#00FFFF\"></td>\n<td>Aqua</td>\n<td>#00FFFF</td>\n</tr>\n<tr>\n<td bgcolor=\"#000000\"></td>\n<td>Black</td>\n<td>#000000</td>\n</tr>\n<tr>\n<td bgcolor=\"#0000FF\"></td>\n<td>Blue</td>\n<td>#0000FF</td>\n</tr>\n<tr>\n<td bgcolor=\"#FF00FF\"></td>\n<td>Fuchsia</td>\n<td>#FF00FF</td>\n</tr>\n<tr>\n<td bgcolor=\"#808080\"></td>\n<td>Gray</td>\n<td>#808080</td>\n</tr>\n<tr>\n<td bgcolor=\"#008000\"></td>\n<td>Green</td>\n<td>#008000</td>\n</tr>\n<tr>\n<td bgcolor=\"#00FF00\"></td>\n<td>Lime</td>\n<td>#00FF00</td>\n</tr>\n<tr>\n<td bgcolor=\"#800000\"></td>\n<td>Maroon</td>\n<td>#800000</td>\n</tr>\n<tr>\n<td bgcolor=\"#000080\"></td>\n<td>Navy</td>\n<td>#000080</td>\n</tr>\n<tr>\n<td bgcolor=\"#808000\"></td>\n<td>Olive</td>\n<td>#808000</td>\n</tr>\n<tr>\n<td bgcolor=\"#800080\"></td>\n<td>Purple</td>\n<td>#800080</td>\n</tr>\n<tr>\n<td bgcolor=\"#FF0000\"></td>\n<td>Red</td>\n<td>#FF0000</td>\n</tr>\n<tr>\n<td bgcolor=\"#C0C0C0\"></td>\n<td>Silver</td>\n<td>#C0C0C0</td>\n</tr>\n<tr>\n<td bgcolor=\"#008080\"></td>\n<td>Teal</td>\n<td>#008080</td>\n</tr>\n<tr>\n<td bgcolor=\"#FFFFFF\"></td>\n<td>White</td>\n<td>#FFFFFF</td>\n</tr>\n<tr>\n<td bgcolor=\"#FFFF00\"></td>\n<td>Yellow</td>\n<td>#FFFF00</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Know your elements!","thumb":null,"image":null,"content":"<p>Appearing in alphabetical order is a list of all the HTML5 elements contained in the current HTML5 specification. A brief description is included as a quick reference when looking for the perfect element.</p>\n<table border=\"0\">\n<tbody>\n<tr>\n<th>Element</th>\n<th>Description</th>\n</tr>\n<tr>\n<td><span class=\"code\">A</span></td>\n<td>Use to create hyperlinks</td>\n</tr>\n<tr>\n<td><span class=\"code\">Abbr</span></td>\n<td>Use for abbreviations</td>\n</tr>\n<tr>\n<td><span class=\"code\">address</span></td>\n<td>Contact information</td>\n</tr>\n<tr>\n<td><span class=\"code\">Area</span></td>\n<td>Hyperlink in an image-map</td>\n</tr>\n<tr>\n<td><span class=\"code\">article*</span></td>\n<td>Provides section formatting for short expository items like articles, blogs, etc.</td>\n</tr>\n<tr>\n<td><span class=\"code\">aside*</span></td>\n<td>Slightly related piece of content for host page</td>\n</tr>\n<tr>\n<td><span class=\"code\">audio</span> *</td>\n<td>Used to add audio for playback associated with web page</td>\n</tr>\n<tr>\n<td><span class=\"code\">b</span></td>\n<td>Bold text</td>\n</tr>\n<tr>\n<td><span class=\"code\">base</span></td>\n<td>Base URL</td>\n</tr>\n<tr>\n<td><span class=\"code\">bdi*</span></td>\n<td>Isolate text that might be formatted in a different direction from text around it</td>\n</tr>\n<tr>\n<td><span class=\"code\">bdo</span></td>\n<td>Use to specify the direction of text</td>\n</tr>\n<tr>\n<td><span class=\"code\">blockquote</span></td>\n<td>Block quotation</td>\n</tr>\n<tr>\n<td><span class=\"code\">body</span></td>\n<td>Document body</td>\n</tr>\n<tr>\n<td><span class=\"code\">br</span></td>\n<td>Line break</td>\n</tr>\n<tr>\n<td><span class=\"code\">button</span></td>\n<td>Creates a button.</td>\n</tr>\n<tr>\n<td><span class=\"code\">canvas*</span></td>\n<td>Use to define a page region in which drawing can occur</td>\n</tr>\n<tr>\n<td><span class=\"code\">caption</span></td>\n<td>Table title</td>\n</tr>\n<tr>\n<td><span class=\"code\">cite</span></td>\n<td>Cited title of a work</td>\n</tr>\n<tr>\n<td><span class=\"code\">code</span></td>\n<td>Code fragment</td>\n</tr>\n<tr>\n<td><span class=\"code\">col</span></td>\n<td>Column in a table</td>\n</tr>\n<tr>\n<td><span class=\"code\">colgroup</span></td>\n<td>Group of table columns</td>\n</tr>\n<tr>\n<td><span class=\"code\">command*</span></td>\n<td>Use to define user GUI elements</td>\n</tr>\n<tr>\n<td><span class=\"code\">datalist*</span></td>\n<td>Use to create a list of <span class=\"code\">input</span> elements for pull-down menus</td>\n</tr>\n<tr>\n<td><span class=\"code\">dd</span></td>\n<td>Description</td>\n</tr>\n<tr>\n<td><span class=\"code\">del</span></td>\n<td>Deleted text</td>\n</tr>\n<tr>\n<td><span class=\"code\">details*</span></td>\n<td>Provides additional information or controls to users on demand</td>\n</tr>\n<tr>\n<td><span class=\"code\">dfn</span></td>\n<td>Defining instance</td>\n</tr>\n<tr>\n<td><span class=\"code\">div</span></td>\n<td>Generic container</td>\n</tr>\n<tr>\n<td><span class=\"code\">dl</span></td>\n<td>Description list</td>\n</tr>\n<tr>\n<td><span class=\"code\">dt</span></td>\n<td>Term or name</td>\n</tr>\n<tr>\n<td><span class=\"code\">em</span></td>\n<td>Emphasis</td>\n</tr>\n<tr>\n<td><span class=\"code\">embed</span> *</td>\n<td>Links to external application or interactive content</td>\n</tr>\n<tr>\n<td><span class=\"code\">fieldset</span></td>\n<td>Related form controls</td>\n</tr>\n<tr>\n<td><span class=\"code\">figcaption*</span></td>\n<td>Provide a caption for a <span class=\"code\">figure</span> element</td>\n</tr>\n<tr>\n<td><span class=\"code\">figure*</span></td>\n<td>Standalone flow content element; may be static or dynamic</td>\n</tr>\n<tr>\n<td><span class=\"code\">footer*</span></td>\n<td>Concluding information for a document section</td>\n</tr>\n<tr>\n<td><span class=\"code\">form</span></td>\n<td>Defines a user-submittable form</td>\n</tr>\n<tr>\n<td><span class=\"code\">h1 &#8211; h6</span></td>\n<td>Headings</td>\n</tr>\n<tr>\n<td><span class=\"code\">head</span></td>\n<td>Container for metadata about the document, scripts, and styles</td>\n</tr>\n<tr>\n<td><span class=\"code\">header*</span></td>\n<td>Header for the document</td>\n</tr>\n<tr>\n<td><span class=\"code\">hgroup*</span></td>\n<td>Heading group</td>\n</tr>\n<tr>\n<td><span class=\"code\">hr</span></td>\n<td>Horizontal rule / thematic break</td>\n</tr>\n<tr>\n<td><span class=\"code\">html</span></td>\n<td>Root element</td>\n</tr>\n<tr>\n<td><span class=\"code\">i</span></td>\n<td>Italic text</td>\n</tr>\n<tr>\n<td><span class=\"code\">iframe</span></td>\n<td>Nested browsing content</td>\n</tr>\n<tr>\n<td><span class=\"code\">img</span></td>\n<td>Image</td>\n</tr>\n<tr>\n<td><span class=\"code\">input</span></td>\n<td>Input control</td>\n</tr>\n<tr>\n<td><span class=\"code\">ins</span></td>\n<td>Inserted text</td>\n</tr>\n<tr>\n<td><span class=\"code\">kbd</span></td>\n<td>User input</td>\n</tr>\n<tr>\n<td><span class=\"code\">keygen*</span></td>\n<td>User-accessible control to generate key pairs for security or encryption</td>\n</tr>\n<tr>\n<td><span class=\"code\">label</span></td>\n<td>Caption for a form control</td>\n</tr>\n<tr>\n<td><span class=\"code\">legend</span></td>\n<td>Explanatory caption</td>\n</tr>\n<tr>\n<td><span class=\"code\">li</span></td>\n<td>List item</td>\n</tr>\n<tr>\n<td><span class=\"code\">link</span></td>\n<td>Metadata for linking external documents</td>\n</tr>\n<tr>\n<td><span class=\"code\">map</span></td>\n<td>Define an image-map</td>\n</tr>\n<tr>\n<td><span class=\"code\">mark*</span></td>\n<td>Mark or highlight a run of text in one document, for reference in another document</td>\n</tr>\n<tr>\n<td><span class=\"code\">menu</span></td>\n<td>List of commands</td>\n</tr>\n<tr>\n<td><span class=\"code\">meta</span></td>\n<td>Metadata</td>\n</tr>\n<tr>\n<td><span class=\"code\">meter*</span></td>\n<td>Define a visual indicator for some type of measurement</td>\n</tr>\n<tr>\n<td><span class=\"code\">nav*</span></td>\n<td>Use to define a navigation bar or area in a web page</td>\n</tr>\n<tr>\n<td><span class=\"code\">noscript</span></td>\n<td>Define content to display in case the script can’t be run</td>\n</tr>\n<tr>\n<td><span class=\"code\">object</span></td>\n<td>External content</td>\n</tr>\n<tr>\n<td><span class=\"code\">ol</span></td>\n<td>Ordered list</td>\n</tr>\n<tr>\n<td><span class=\"code\">optgroup</span></td>\n<td>Define a group of options</td>\n</tr>\n<tr>\n<td><span class=\"code\">output*</span></td>\n<td>Some kind of output from script calculation or API call</td>\n</tr>\n<tr>\n<td><span class=\"code\">p</span></td>\n<td>Paragraph</td>\n</tr>\n<tr>\n<td><span class=\"code\">param</span></td>\n<td>Use to provide parameters to plugins</td>\n</tr>\n<tr>\n<td><span class=\"code\">pre</span></td>\n<td>Preformatted text</td>\n</tr>\n<tr>\n<td><span class=\"code\">progress*</span></td>\n<td>A visual meter for task completion (progress bar)</td>\n</tr>\n<tr>\n<td><span class=\"code\">q</span></td>\n<td>Quoted text</td>\n</tr>\n<tr>\n<td><span class=\"code\">rp*</span></td>\n<td>Use for putting parentheses around ruby annotations</td>\n</tr>\n<tr>\n<td><span class=\"code\">rt*</span></td>\n<td>Use to mark the text of a ruby annotation</td>\n</tr>\n<tr>\n<td><span class=\"code\">ruby*</span></td>\n<td>Use to annotate ideographic languages like Chinese or Japanese</td>\n</tr>\n<tr>\n<td><span class=\"code\">s</span></td>\n<td>Mark text as removed, with strike through formatting.</td>\n</tr>\n<tr>\n<td><span class=\"code\">samp</span></td>\n<td>Sample output</td>\n</tr>\n<tr>\n<td><span class=\"code\">script</span></td>\n<td>Embedded script</td>\n</tr>\n<tr>\n<td><span class=\"code\">section*</span></td>\n<td>Generic document or application section</td>\n</tr>\n<tr>\n<td><span class=\"code\">select</span></td>\n<td>Option selection form control</td>\n</tr>\n<tr>\n<td><span class=\"code\">small</span></td>\n<td>Small text</td>\n</tr>\n<tr>\n<td><span class=\"code\">source*</span></td>\n<td>Use to specify multiple sources for audio and video</td>\n</tr>\n<tr>\n<td><span class=\"code\">span</span></td>\n<td>A generic text wrapper</td>\n</tr>\n<tr>\n<td><span class=\"code\">strong</span></td>\n<td>Important text. Is usually formatted as bold</td>\n</tr>\n<tr>\n<td><span class=\"code\">style</span></td>\n<td>Presentation information, typically CSS</td>\n</tr>\n<tr>\n<td><span class=\"code\">sub</span></td>\n<td>Subscript text</td>\n</tr>\n<tr>\n<td><span class=\"code\">summary*</span></td>\n<td>Summary, legend, or caption for input details information</td>\n</tr>\n<tr>\n<td><span class=\"code\">sup</span></td>\n<td>Superscript text</td>\n</tr>\n<tr>\n<td><span class=\"code\">table</span></td>\n<td>Table</td>\n</tr>\n<tr>\n<td><span class=\"code\">tbody</span></td>\n<td>Group of table rows</td>\n</tr>\n<tr>\n<td><span class=\"code\">td</span></td>\n<td>Table cell</td>\n</tr>\n<tr>\n<td><span class=\"code\">textarea</span></td>\n<td>Text input area</td>\n</tr>\n<tr>\n<td><span class=\"code\">tfoot</span></td>\n<td>Table footer row group</td>\n</tr>\n<tr>\n<td><span class=\"code\">th</span></td>\n<td>Table header cell</td>\n</tr>\n<tr>\n<td><span class=\"code\">thead</span></td>\n<td>Table heading row group</td>\n</tr>\n<tr>\n<td><span class=\"code\">time*</span></td>\n<td>Value for representing date and/or time</td>\n</tr>\n<tr>\n<td><span class=\"code\">title</span></td>\n<td>Document title</td>\n</tr>\n<tr>\n<td><span class=\"code\">tr</span></td>\n<td>Table row</td>\n</tr>\n<tr>\n<td><span class=\"code\">track*</span></td>\n<td>Specify a supplementary media track</td>\n</tr>\n<tr>\n<td><span class=\"code\">u</span></td>\n<td>Underline</td>\n</tr>\n<tr>\n<td><span class=\"code\">ul</span></td>\n<td>Unordered list</td>\n</tr>\n<tr>\n<td><span class=\"code\">var</span></td>\n<td>Use to specify a mathematical or programming variable, or a placeholder</td>\n</tr>\n<tr>\n<td><span class=\"code\">video</span> *</td>\n<td>Use to playback video content in web page</td>\n</tr>\n<tr>\n<td><span class=\"code\">wbr</span> *</td>\n<td>Use to denote possible line break point for text flow</td>\n</tr>\n</tbody>\n</table>\n<p>* <em>New in HTML5</em></p>\n"},{"title":"CSS property reference","thumb":null,"image":null,"content":"<p>The following table shows CSS properties that are supported by most browsers today, along with their allowed values. Some of these properties are part of CSS3 specifications and are still experimental, so be sure to check with the <a href=\"http://www.caniuse.com\" target=\"_blank\" rel=\"noopener\">Can I Use</a> site for the latest information on browser support. (For help reading the Values column of this chart, see the article <a href=\"http://www.dummies.com/extras/beginninghtml5css3\" target=\"_blank\" rel=\"noopener\">A Quick Guide to the CSS Value Definition Syntax</a>)</p>\n<table border=\"0\">\n<tbody>\n<tr>\n<th>Name</th>\n<th>Values</th>\n</tr>\n<tr>\n<td><span class=\"code\">animation</span></td>\n<td>&lt;single-animation-name&gt; || &lt;time&gt; || &lt;timing-function&gt; || &lt;time&gt; || &lt;single-animation-iteration-count&gt; || &lt;single-animation-direction&gt; || &lt;single-animation-fill-mode&gt;</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-delay</span></td>\n<td>&lt;time&gt;</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-direction</span></td>\n<td>normal | alternate | reverse | alternate reverse</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-duration</span></td>\n<td>&lt;time&gt;</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-fill-mode</span></td>\n<td>none | forwards | backwards | both</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-iteration-count</span></td>\n<td>infinite | &lt;number&gt;</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-name</span></td>\n<td>none | &lt;identifier&gt;</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-play-state</span></td>\n<td>running | paused</td>\n</tr>\n<tr>\n<td><span class=\"code\">animation-timing-function</span></td>\n<td>&lt;timingfunction&gt;</td>\n</tr>\n<tr>\n<td><span class=\"code\">backface-visibility</span></td>\n<td>visible | hidden</td>\n</tr>\n<tr>\n<td>background-attachment</td>\n<td>scroll | fixed | inherit</td>\n</tr>\n<tr>\n<td>background-clip</td>\n<td>border-box | padding-box | content-box | inherit</td>\n</tr>\n<tr>\n<td>background-color</td>\n<td>&lt;color&gt; | inherit</td>\n</tr>\n<tr>\n<td>background-image</td>\n<td>&lt;uri&gt; | none | inherit</td>\n</tr>\n<tr>\n<td>background-origin</td>\n<td>border-box | padding-box | content-box | inherit</td>\n</tr>\n<tr>\n<td>background-position</td>\n<td>[ [ &lt;percentage&gt; | &lt;length&gt; | left | center | right ] [ &lt;percentage&gt; | &lt;length&gt; | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | inherit</td>\n</tr>\n<tr>\n<td>background-repeat</td>\n<td>repeat | repeat-x | repeat-y | no-repeat | inherit</td>\n</tr>\n<tr>\n<td>background-size</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | cover | contain</td>\n</tr>\n<tr>\n<td>background</td>\n<td>[‘background-color’ || ‘background-image’ ||‘background-repeats’ ||‘background-attachment’ ||background-position] | inherit</td>\n</tr>\n<tr>\n<td>border-collapse</td>\n<td>collapse | separate | inherit</td>\n</tr>\n<tr>\n<td>border-color</td>\n<td>[ &lt;color&gt; ]{1,4} | inherit</td>\n</tr>\n<tr>\n<td>border-image</td>\n<td>none | &lt;image&gt;</td>\n</tr>\n<tr>\n<td>border-image-outset</td>\n<td>[&#8216;sides&#8217; || &#8216;horizontal&#8217; || &#8216;vertical&#8217; || &#8216;top&#8217; || &#8216;bottom&#8217; || &#8216;right&#8217; || &#8216;left&#8217;] | inherit</td>\n</tr>\n<tr>\n<td>border-image-repeat</td>\n<td>[&#8216;type&#8217; || &#8216;horizontal&#8217; || &#8216;vertical&#8217; || &#8216;stretch&#8217; || &#8216;repeat&#8217; || &#8217;round&#8217;] | inherit</td>\n</tr>\n<tr>\n<td>border-image-source</td>\n<td>none | &lt;image&gt;</td>\n</tr>\n<tr>\n<td>border-image-slice</td>\n<td>[&lt;number&gt; | &lt;percentage&gt;]{1,4} &amp;&amp; fill?</td>\n</tr>\n<tr>\n<td>border-image-width</td>\n<td>[ &lt;length&gt; | &lt;percentage&gt; | &lt;number&gt; | auto ]{1,4}</td>\n</tr>\n<tr>\n<td>border-radius</td>\n<td>[ &lt;length&gt; | &lt;percentage&gt; ]{1,4} [ / [ &lt;length&gt; | &lt;percentage&gt; ]{1,4} ]?</td>\n</tr>\n<tr>\n<td>border-spacing</td>\n<td>&lt;length&gt; &lt;length&gt;? | inherit</td>\n</tr>\n<tr>\n<td>border-style</td>\n<td>&lt;border-style&gt;{1,4} | inherit</td>\n</tr>\n<tr>\n<td>border-top border-right border-bottom border-left</td>\n<td>[ &lt;border-width&gt; || &lt;border-style&gt; ||border-top-color ] | inherit</td>\n</tr>\n<tr>\n<td>border-top-color border-right-color border-bottom-color border-left-color</td>\n<td>&lt;color&gt; | inherit</td>\n</tr>\n<tr>\n<td>border-top-left-radius border-top-right-radius border-bottom-left-radius border-bottom-right-radius</td>\n<td>[ &lt;length&gt; | &lt;percentage&gt; ]{1,2}</td>\n</tr>\n<tr>\n<td>border-top-style border-right-style border-bottom-style border-left-style</td>\n<td>&lt;border-style&gt; | inherit</td>\n</tr>\n<tr>\n<td>border-top-width border-right-width border-bottom-width border-left-width</td>\n<td>&lt;border-width&gt; | inherit</td>\n</tr>\n<tr>\n<td>border-width</td>\n<td>&lt;border-width&gt;{1,4} | inherit</td>\n</tr>\n<tr>\n<td>border</td>\n<td>[ &lt;border-width&gt; || &lt;border-style&gt; ||border-top-color ] | inherit</td>\n</tr>\n<tr>\n<td>bottom</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>box-shadow</td>\n<td>none | [inset? &amp;&amp; [ &lt;offset-x&gt; &lt;offset-y&gt; &lt;blur-radius&gt;? &lt;spread-radius&gt;? &lt;color&gt;? ] ]#</td>\n</tr>\n<tr>\n<td>break-after</td>\n<td>auto | always | avoid | left | right | page | column | avoid-page | avoid-column</td>\n</tr>\n<tr>\n<td>break-before</td>\n<td>auto | always | avoid | left | right | page | column | avoid-page | avoid-column</td>\n</tr>\n<tr>\n<td>caption-side</td>\n<td>top | bottom | inherit</td>\n</tr>\n<tr>\n<td>clear</td>\n<td>none | left | right | both | inherit</td>\n</tr>\n<tr>\n<td>clip</td>\n<td>&lt;shape&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>color</td>\n<td>&lt;color&gt; | inherit</td>\n</tr>\n<tr>\n<td>columns</td>\n<td>&lt;&#8216;column-width&#8217;&gt; || &lt;&#8216;column-count&#8217;&gt;</td>\n</tr>\n<tr>\n<td>column-count</td>\n<td>&lt;number&gt; | auto</td>\n</tr>\n<tr>\n<td>column-fill</td>\n<td>auto | balance</td>\n</tr>\n<tr>\n<td>column-gap</td>\n<td>&lt;length&gt; | normal</td>\n</tr>\n<tr>\n<td>column-rule</td>\n<td>&lt;&#8216;column-rule-width&#8217;&gt; || &lt;&#8216;column-rule-style&#8217;&gt; || &lt;&#8216;column-rule-color&#8217;&gt;</td>\n</tr>\n<tr>\n<td>column-rule-color</td>\n<td>&lt;color&gt;</td>\n</tr>\n<tr>\n<td>column-rule-style</td>\n<td>[none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset] | inherit</td>\n</tr>\n<tr>\n<td>column-rule-width</td>\n<td>&lt;length&gt; | [thin | medium | thick]</td>\n</tr>\n<tr>\n<td>column-span</td>\n<td>none | all | inherit</td>\n</tr>\n<tr>\n<td>column-width</td>\n<td>&lt;length&gt; | auto</td>\n</tr>\n<tr>\n<td>content</td>\n<td>normal | none | [ &lt;string&gt; | &lt;uri&gt; | &lt;counter&gt; | attr(&lt;identifier&gt;) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit</td>\n</tr>\n<tr>\n<td>counter-increment</td>\n<td>[ &lt;identifier&gt; &lt;integer&gt;? ]+ | none | inherit</td>\n</tr>\n<tr>\n<td>counter-reset</td>\n<td>[ &lt;identifier&gt; &lt;integer&gt;? ]+ | none | inherit</td>\n</tr>\n<tr>\n<td>cursor</td>\n<td>[ [&lt;uri&gt; ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | inherit</td>\n</tr>\n<tr>\n<td>direction</td>\n<td>ltr | rtl | inherit</td>\n</tr>\n<tr>\n<td>display</td>\n<td>inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit</td>\n</tr>\n<tr>\n<td>empty-cells</td>\n<td>show | hide | inherit</td>\n</tr>\n<tr>\n<td>float</td>\n<td>left | right | none | inherit</td>\n</tr>\n<tr>\n<td>font-family</td>\n<td>[ [ &lt;family-name&gt; | &lt;generic-family&gt; ] [,&lt;family-name&gt;| &lt;generic-family&gt; ]* ] | inherit</td>\n</tr>\n<tr>\n<td>font-size</td>\n<td>&lt;absolute-size&gt; | &lt;relative-size&gt; | &lt;length&gt; |&lt;percentage&gt; | inherit</td>\n</tr>\n<tr>\n<td>font-style</td>\n<td>normal | italic | oblique | inherit</td>\n</tr>\n<tr>\n<td>font-variant</td>\n<td>normal | small-caps | inherit</td>\n</tr>\n<tr>\n<td>font-weight</td>\n<td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit</td>\n</tr>\n<tr>\n<td>font</td>\n<td>[ [ ‘font-style’ || ‘font-variant’ || ‘font-weight’ ]?‘ font-size’ [ / ‘line-height’ ]? font-family ] | caption | icon | menu | message-box | small-caption | status-bar | inherit</td>\n</tr>\n<tr>\n<td>height</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>@keyframes</td>\n<td>[ [ from | to | &lt;percentage&gt; ] [, from | to | &lt;percentage&gt; ]* block ]*</td>\n</tr>\n<tr>\n<td>left</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>letter-spacing</td>\n<td>normal | &lt;length&gt; | inherit</td>\n</tr>\n<tr>\n<td>line-height</td>\n<td>normal | &lt;number&gt; | &lt;length&gt; | &lt;percentage&gt;| inherit</td>\n</tr>\n<tr>\n<td>list-style-image</td>\n<td>&lt;uri&gt; | none | inherit</td>\n</tr>\n<tr>\n<td>list-style-position</td>\n<td>inside | outside | inherit</td>\n</tr>\n<tr>\n<td>list-style-type</td>\n<td>disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit</td>\n</tr>\n<tr>\n<td>list-style</td>\n<td>[ ‘list-style-type’ || ‘list-style-position’ ||list-style-image ] | inherit</td>\n</tr>\n<tr>\n<td>margin-right margin-left</td>\n<td>&lt;margin-width&gt; | inherit</td>\n</tr>\n<tr>\n<td>margin-top margin-bottom</td>\n<td>&lt;margin-width&gt; | inherit</td>\n</tr>\n<tr>\n<td>margin</td>\n<td>&lt;margin-width&gt;{1,4} | inherit</td>\n</tr>\n<tr>\n<td>max-height</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | none | inherit</td>\n</tr>\n<tr>\n<td>max-width</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | none | inherit</td>\n</tr>\n<tr>\n<td>min-height</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | inherit</td>\n</tr>\n<tr>\n<td>min-width</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | inherit</td>\n</tr>\n<tr>\n<td>opacity</td>\n<td>&lt;number&gt; | inherit</td>\n</tr>\n<tr>\n<td>orphans</td>\n<td>&lt;integer&gt; | inherit</td>\n</tr>\n<tr>\n<td>outline-color</td>\n<td>&lt;color&gt; | invert | inherit</td>\n</tr>\n<tr>\n<td>outline-style</td>\n<td>&lt;border-style&gt; | inherit</td>\n</tr>\n<tr>\n<td>outline-width</td>\n<td>&lt;border-width&gt; | inherit</td>\n</tr>\n<tr>\n<td>outline</td>\n<td>[ ‘outline-color’ || ‘outline-style’ || outline-width] | inherit</td>\n</tr>\n<tr>\n<td>overflow</td>\n<td>visible | hidden | scroll | auto | inherit</td>\n</tr>\n<tr>\n<td>overflow-wrap</td>\n<td>normal | break-word | inherit</td>\n</tr>\n<tr>\n<td>overflow-x</td>\n<td>visible | hidden | scroll | auto | inherit</td>\n</tr>\n<tr>\n<td>overflow-y</td>\n<td>visible | hidden | scroll | auto | inherit</td>\n</tr>\n<tr>\n<td>padding-top padding-right padding-bottom padding-left</td>\n<td>&lt;padding-width&gt; | inherit</td>\n</tr>\n<tr>\n<td>padding</td>\n<td>&lt;padding-width&gt;{1,4} | inherit</td>\n</tr>\n<tr>\n<td>page-break-after</td>\n<td>auto | always | avoid | left | right | inherit</td>\n</tr>\n<tr>\n<td>page-break-before</td>\n<td>auto | always | avoid | left | right | inherit</td>\n</tr>\n<tr>\n<td>page-break-inside</td>\n<td>avoid | auto | inherit</td>\n</tr>\n<tr>\n<td>perspective</td>\n<td>none | &lt;length&gt;</td>\n</tr>\n<tr>\n<td>perspective-origin</td>\n<td>[ &lt;percentage&gt; | &lt;length&gt; | left | center | right | top | bottom] | [ [ &lt;percentage&gt; | &lt;length&gt; | left | center | right ] &amp;&amp; [ &lt;percentage&gt; | &lt;length&gt; | top | center | bottom ] ]</td>\n</tr>\n<tr>\n<td>position</td>\n<td>static | relative | absolute | fixed | inherit</td>\n</tr>\n<tr>\n<td>quotes</td>\n<td>[&lt;string&gt; &lt;string&gt;]+ | none | inherit</td>\n</tr>\n<tr>\n<td>right</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>table-layout</td>\n<td>auto | fixed | inherit</td>\n</tr>\n<tr>\n<td>text-align</td>\n<td>left | right | center | justify | inherit</td>\n</tr>\n<tr>\n<td>text-decoration</td>\n<td>none | [ underline || overline || line-through || blink ] | inherit</td>\n</tr>\n<tr>\n<td>text-indent</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | inherit</td>\n</tr>\n<tr>\n<td>text-transform</td>\n<td>capitalize | uppercase | lowercase | none |inherit</td>\n</tr>\n<tr>\n<td>top</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>transform</td>\n<td>none | &lt;transform-function&gt;+</td>\n</tr>\n<tr>\n<td>transform-origin</td>\n<td>[ &lt;percentage&gt; | &lt;length&gt; | left | center | right | top | bottom] | [ [ &lt;percentage&gt; | &lt;length&gt; | left | center | right ] &amp;&amp; [ &lt;percentage&gt; | &lt;length&gt; | top | center | bottom ] ] &lt;length&gt;?</td>\n</tr>\n<tr>\n<td>transform-style</td>\n<td>flat | preserve-3d</td>\n</tr>\n<tr>\n<td>transition</td>\n<td>[ none | &lt;single-transition-property&gt; ] || &lt;time&gt; || &lt;timing-function&gt; || &lt;time&gt;</td>\n</tr>\n<tr>\n<td>transition-delay</td>\n<td>&lt;time&gt;</td>\n</tr>\n<tr>\n<td>transition-duration</td>\n<td>&lt;time&gt;</td>\n</tr>\n<tr>\n<td>transition-timing-function</td>\n<td>&lt;timing-function&gt;</td>\n</tr>\n<tr>\n<td>transition-property</td>\n<td>none | &lt;single-transition-property&gt;# [ ‘,’ &lt;single-transition-property&gt;# ]*</td>\n</tr>\n<tr>\n<td>unicode-bidi</td>\n<td>normal | embed | bidi-override | inherit</td>\n</tr>\n<tr>\n<td>vertical-align</td>\n<td>baseline | sub | super | top | text-top | middle | bottom | text-bottom | &lt;percentage&gt; |&lt;length&gt; | inherit</td>\n</tr>\n<tr>\n<td>visibility</td>\n<td>visible | hidden | collapse | inherit</td>\n</tr>\n<tr>\n<td>white-space</td>\n<td>normal | pre | nowrap | pre-wrap | pre-line |inherit</td>\n</tr>\n<tr>\n<td>widows</td>\n<td>&lt;integer&gt; | inherit</td>\n</tr>\n<tr>\n<td>width</td>\n<td>&lt;length&gt; | &lt;percentage&gt; | auto | inherit</td>\n</tr>\n<tr>\n<td>word-spacing</td>\n<td>normal | &lt;length&gt; | inherit</td>\n</tr>\n<tr>\n<td>z-index</td>\n<td>auto | &lt;integer&gt; | inherit</td>\n</tr>\n</tbody>\n</table>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"One year","lifeExpectancySetFrom":"2022-03-18T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207867},{"headers":{"creationTime":"2016-03-27T16:48:31+00:00","modifiedTime":"2022-02-28T16:15:46+00:00","timestamp":"2022-09-14T18:19:18+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","strippedTitle":"html5 and css3 all-in-one for dummies cheat sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Check out these helpful templates and attributes for HTML5, CSS3, JavaScript, and MySQL.","noIndex":0,"noFollow":0},"content":"Check out these handy references on an HTML5 template you can use to start every document, selected MySQL commands, useful JavaScript syntax and CSS attributes, and selected HTML syntax.","description":"Check out these handy references on an HTML5 template you can use to start every document, selected MySQL commands, useful JavaScript syntax and CSS attributes, and selected HTML syntax.","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}},{"articleId":203854,"title":"How to Calculate Date Values in SQL Data for HTML5and CSS3 Programming","slug":"how-to-calculate-date-values-in-sql-data-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203854"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}},{"articleId":204301,"title":"10 Stellar Web Resources for HTML5 and CSS3","slug":"10-stellar-web-resources-for-html5-and-css3","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204301"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-63221b2607b2b\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-63221b2608578\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":159571,"title":"HTML5 Template","slug":"html5-template","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/159571"}},{"articleId":159569,"title":"Selected MySQL Commands","slug":"selected-mysql-commands","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/159569"}},{"articleId":159574,"title":"Selected JavaScript Syntax","slug":"selected-javascript-syntax","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/159574"}},{"articleId":159566,"title":"Selected CSS Attributes","slug":"selected-css-attributes","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/159566"}},{"articleId":159575,"title":"Selected HTML Syntax","slug":"selected-html-syntax","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/159575"}}],"content":[{"title":"HTML5 Template","thumb":null,"image":null,"content":"<p>This is the basic HTML5 template. Use it as the starting place for all your of HTML5 documents. Some editors allow you to add a template file for quickly creating a file. If your editor does not already have an HTML5 template, you can use this one. You can also keep it someplace convenient to copy and paste from if you wish.</p>\n<pre class=\"code\">&lt;!doctype html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n &lt;meta charset=\"UTF-8\"&gt;\r\n &lt;title&gt;&lt;/title&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;</pre>\n"},{"title":"Selected MySQL commands","thumb":null,"image":null,"content":"<p>MySQL is very helpful when building a database. The following table contains the minimal commands needed to create, populate, and query a database using MySQL.</p>\n<table>\n<tbody>\n<tr>\n<th>Command</th>\n<th>Discussion</th>\n</tr>\n<tr>\n<td>USE databaseName;</td>\n<td>Set the databaseName as the default database</td>\n</tr>\n<tr>\n<td>DROP TABLE IF EXISTS tableName;</td>\n<td>Delete the entire table</td>\n</tr>\n<tr>\n<td>CREATE TABLE tableName (</p>\n<p>fieldName type modifiers,</p>\n<p>);</td>\n<td>Create a table called tableName with the fields defined by the<br />\nfield lines.Modifiers: PRIMARY KEY, AUTO_INCREMENT</td>\n</tr>\n<tr>\n<td>INSERT INTO tableName VALUES ( &#8230;) ;</td>\n<td>Insert a new record into tableName. Values must be correct type<br />\nin correct order.</td>\n</tr>\n<tr>\n<td>SELECT * FROM tableName WHERE condition ORDER BY field</td>\n<td>Select all fields from tableName which meet the condition. Sort<br />\naccording to the given field.</td>\n</tr>\n<tr>\n<td>UPDATE tableName SET field = value WHERE condition;</td>\n<td>Modify an existing record. Use condition to specify which<br />\nrecord is modified, and set given value(s) to specified<br />\nfield(s)</td>\n</tr>\n<tr>\n<td>DELETE FROM tableName WHERE condition</td>\n<td>Delete any records from the tableName table that satisfy the<br />\ncondition</td>\n</tr>\n<tr>\n<td>CREATE VIEW viewName AS query</td>\n<td>Create a virtual table containing the results of a complex<br />\nquery (often an inner join or link table join)</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Selected JavaScript syntax","thumb":null,"image":null,"content":"<p>JavaScript is still one of the most used programming languages, especially for client-side programming, and the following table offers a summary of the most useful functions and what they do.</p>\n<p><img loading=\"lazy\" src=\"https://www.dummies.com/wp-content/uploads/221808.image0.jpg\" alt=\"image0.jpg\" width=\"439\" height=\"974\" /></p>\n"},{"title":"Selected CSS attributes","thumb":null,"image":null,"content":"<p>This table highlights the most commonly used CSS attributes. Each of these attributes can be applied to any container element in a page. The container can be a single element denoted by the ID attribute, a member of a class, or all the elements in a page of a certain type.</p>\n<table>\n<tbody>\n<tr>\n<th>Attribute</th>\n<th>Discussion</th>\n</tr>\n<tr>\n<td>margin</td>\n<td>Defines space between element border and parent (left, right,<br />\ntop, bottom variations)</td>\n</tr>\n<tr>\n<td>padding</td>\n<td>Defines space between contents and border (with variants)</td>\n</tr>\n<tr>\n<td>border: size color style</td>\n<td>Defines a border. Styles: none, dotted, dashed, solid, double,<br />\ngroove, ridge, inset, and outset.</td>\n</tr>\n<tr>\n<td>color</td>\n<td>Foreground color: color name or hex value</td>\n</tr>\n<tr>\n<td>background-color</td>\n<td>Background color: color name or hex value</td>\n</tr>\n<tr>\n<td>background-image: url(filename)</td>\n<td>Sets image indicated by filename as background image</td>\n</tr>\n<tr>\n<td>background-repeat</td>\n<td>Indicates how background will repeat: repeat, repeat-x,<br />\nrepeat-y, and no-repeat</td>\n</tr>\n<tr>\n<td>font-family</td>\n<td>Font name: sans-serif, serif, monospace, cursive, and<br />\nfantasy</td>\n</tr>\n<tr>\n<td>font-size</td>\n<td>Font size (best specified in ems or percent)</td>\n</tr>\n<tr>\n<td>font-style</td>\n<td>Set italics: none, italic, and oblique</td>\n</tr>\n<tr>\n<td>font-weight</td>\n<td>Set boldness: lighter, normal, bold, and bolder (100-900)</td>\n</tr>\n<tr>\n<td>text-align</td>\n<td>Alignment: left, right, center, and justify. Works on<br />\n<i>content</i>, not a block</td>\n</tr>\n<tr>\n<td>text-decoration</td>\n<td>Adds decoration to text: none, underline, overline,<br />\nline-through, and blink</td>\n</tr>\n<tr>\n<td>display</td>\n<td>Defines how element is displayed: none, block, and inline</td>\n</tr>\n<tr>\n<td>position</td>\n<td>Describes positioning scheme: absolute and relative</td>\n</tr>\n<tr>\n<td>left, top, right, bottom</td>\n<td>Indicates position of element (must set position absolute or<br />\nrelative first)</td>\n</tr>\n<tr>\n<td>float</td>\n<td>Removes element from normal layout and floats it in a<br />\ndirection: left and right</td>\n</tr>\n<tr>\n<td>height, width</td>\n<td>Specifies the height and width of an element. Important for<br />\nfloated elements.</td>\n</tr>\n<tr>\n<td>clear</td>\n<td>Force this floated element to position: left, right, and<br />\nboth</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Selected HTML syntax","thumb":null,"image":null,"content":"<p>Despite all the new programming languages and technology, HTML remains the basic building block for a lot of websites. This table contains the most commonly-used HTML tags.</p>\n<table>\n<tbody>\n<tr>\n<th>Tag</th>\n<th>Comments</th>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;html&gt;&lt;/html&gt;</span></td>\n<td>Required for all pages.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;head&gt;&lt;/head&gt;</span></td>\n<td>Required for all pages — must be inside HTML tags.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;title&gt;&lt;/title&gt;</span></td>\n<td>Must be in head.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;body&gt;&lt;/body&gt;</span></td>\n<td>Required for all pages — must be inside HTML tags.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;link rel = “stylesheet” type =<br />\n“text/css” href = “address” /&gt;</span></td>\n<td>Link to external style sheet. Replace address with URL of style<br />\nsheet.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;style type =<br />\n“text/css”&gt;&lt;/style&gt;</span></td>\n<td>Page-level style sheet declaration.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;h1&gt;&lt;/h1&gt; ..<br />\n&lt;h6&gt;..&lt;/h6&gt;</span></td>\n<td>Defines headline from most prominent (h1) to least prominent<br />\n(h6).</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;p&gt;&lt;/p&gt;</span></td>\n<td>Paragraph.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;div&gt;&lt;/div&gt;</span></td>\n<td>Generic block-level component.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;span&gt;&lt;/span&gt;</span></td>\n<td>Generic inline component.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;em&gt;&lt;/em&gt;</span></td>\n<td>Emphasis (default: italics).</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;strong&gt;&lt;/strong&gt;</span></td>\n<td>Strong emphasis (default: bold).</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;br /&gt;</span></td>\n<td>Line break.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;ol&gt;&lt;/ol&gt;</span></td>\n<td>Defines an ordered list.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;ul&gt;&lt;/ul&gt;</span></td>\n<td>Defines an unordered list.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;li&gt;&lt;/li&gt;</span></td>\n<td>List item — must be inside ol or ul pair.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;dl&gt;&lt;/dl&gt;</span></td>\n<td>Definition list — a list of terms and definitions.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;dt&gt;&lt;/dt&gt;</span></td>\n<td>Definition term — found in dl groups.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;dd&gt;&lt;/dd&gt;</span></td>\n<td>Definition data — usually paired with a dt set inside a<br />\ndl.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;a href =<br />\n“address”&gt;content&lt;/a&gt;</span></td>\n<td>Displays content as a link, and sends browser to address when<br />\nactivated.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;img src = “filename” alt =<br />\n“alternative text” /&gt;</span></td>\n<td>Displays image referenced by filename. Alternative text is<br />\nrequired for non-visual browsers.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;table&gt;&lt;/table&gt;</span></td>\n<td>Define an HTML table.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;tr&gt;&lt;/tr&gt;</span></td>\n<td>Table row.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;th&gt;&lt;/th&gt;</span></td>\n<td>Table header — must be inside tr.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;td&gt;&lt;/td&gt;</span></td>\n<td>Table data — must be inside tr.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;script&gt;&lt;/script&gt;</span></td>\n<td>Internal JavaScript code.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;script src =<br />\n“filename”&gt;&lt;/script&gt;</span></td>\n<td>Load external JavaScript code.</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;!&#8211;[if<br />\nIE]&gt;&lt;![endif]→</span></td>\n<td>Conditional comment. Code inside these tags will only be<br />\nexecuted by Internet Explorer. It’s possible to indicate<br />\nspecific versions as well (<span class=\"code\">&lt;!—[if IE<br />\n&lt; 7]&gt;</span>).</td>\n</tr>\n</tbody>\n</table>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-02-28T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207788},{"headers":{"creationTime":"2016-03-26T13:16:14+00:00","modifiedTime":"2021-10-29T19:57:46+00:00","timestamp":"2022-09-14T18:18:44+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"How to Use an External Style Sheet for HTML5 and CSS3 Programming","strippedTitle":"how to use an external style sheet for html5 and css3 programming","slug":"how-to-use-an-external-style-sheet-for-html5-and-css3-programming","canonicalUrl":"","seo":{"metaDescription":"CSS3 supports external style sheets. This technique allows you to define a style sheet as a separate document and import it into your web pages. To see why this","noIndex":0,"noFollow":0},"content":"CSS3 supports <i>external style sheets.</i> This technique allows you to define a style sheet as a separate document and import it into your web pages. To see why this might be attractive, take a look at the example.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412513.image0.jpg\" alt=\"image0.jpg\" width=\"533\" height=\"400\" />\r\n\r\nWhen you look at the code for <span class=\"code\">externalStyle.html</span>, you might be surprised to see no obvious style information at all!\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en-US\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;externalStyle.html&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"myStyle.css\" /&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;External Style&lt;/h1&gt;\r\n &lt;p&gt;\r\n This page has styles set for paragraphs, body, and header 1.\r\n &lt;/p&gt;\r\n &lt;p&gt;\r\n The styles are defined in an external style sheet.\r\n &lt;/p&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nWhere you normally see style tags (in the header), there is no style. Instead, you see a <span class=\"code\"><link></span> tag. This special tag is used to connect the current document with another document.\r\n<h2 id=\"tab1\" >How to define the external style</h2>\r\nWhen you use an external style, the style elements aren’t embedded in the page header but in an entirely separate document.\r\n\r\nIn this case, the page is connected to a special file called <span class=\"code\">myStyle.css</span>. This file contains all the CSS rules:\r\n<pre class=\"code\">/* myStyle.css */\r\nbody {\r\n background-color: #333300;\r\n color: #FFFFFF;\r\n}\r\nh1 {\r\n color: #FFFF33;\r\n text-align: center;\r\n font: italic 200% fantasy;\r\n}\r\np {\r\n background-color: #FFFF33;\r\n color: #333300;\r\n text-align: right;\r\n border: 3px groove #FFFF33;\r\n}</pre>\r\nThe style sheet looks just like a page-level style, except for a few key differences:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The style sheet rules are contained in a separate file.</b> The style is no longer part of the HTML page but is an entirely separate file stored on the server. CSS files usually end with the <span class=\"code\">.css</span> extension.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>There are no </b><span class=\"code\"><style></style></span><b> tags. </b>These aren’t needed because the style is no longer embedded in HTML.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The code begins with a comment.</b> The <span class=\"code\">/* */</span> pair indicates a comment in CSS. Truthfully, you can put comments in CSS in the page level. External CSS files frequently have comments in them.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The style document has no HTML.</b> CSS documents contain nothing but CSS. This comes closer to the goal of separating style (in the CSS document) and content (in the HTML document).</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The document isn’t tied to any particular page.</b> The great advantage of external CSS is reuse. The CSS document isn’t part of any particular page, but any page can use it.</p>\r\n</li>\r\n</ul>\r\n<h2 id=\"tab2\" >How to reuse an external CSS style</h2>\r\nExternal style sheets are really fun when you have more than one page that needs the same style. Most websites today use multiple pages, and they should share a common style sheet to keep consistency.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412514.image1.jpg\" alt=\"image1.jpg\" width=\"533\" height=\"400\" />\r\n\r\nThe code shows how easily this is done:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en-US\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;SecondPage.html&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"myStyle.css\" /&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;Second Page&lt;/h1&gt;\r\n &lt;p&gt;\r\n This page uses the same style as\r\n &lt;a href = \"externalStyle.html\"&gt;externalStyle.html&lt;/a&gt;.\r\n &lt;/p&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nExternal style sheets have some tremendous advantages:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>One style sheet can control many pages:</b> Generally, you have a large number of different pages in a website that all share the same general style. You can define the style sheet in one document and have all the HTML files refer to the CSS file.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Global changes are easier:</b> If you’re using external styles, you make a change in one place and it’s automatically propagated to all the pages in the system.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Separation of content and design:</b> With external CSS, all the design is housed in the CSS, and the data is in HTML.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Easy upgrades:</b> Because the design parameters of the entire site are defined in one file, you can easily change the site without having to mess around with individual HTML files.</p>\r\n</li>\r\n</ul>\r\n<h2 id=\"tab3\" >The link tag</h2>\r\nThe <span class=\"code\"><link></span> tag is the key to adding a CSS reference to an HTML document. The <span class=\"code\"><link></span> tag has the following characteristics:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><link></span><b> tag is part of the HTML page. </b>Use a <span class=\"code\"><link></span> tag in your HTML document to specify which CSS document will be used by the HTML page.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><link></span><b> tag only occurs in the header.</b> Unlike the <span class=\"code\"><a></span> tag, the <span class=\"code\"><link></span> tag can occur only in the header.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The tag has no visual presence.</b> The user can’t see the <span class=\"code\"><link></span> tag, only its effects.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The <</b><span class=\"code\">link></span><b> tag is used to relate the document with another document.</b> You use the <span class=\"code\"><link></span> tag to describe the relationship between documents.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The</b><span class=\"code\"> <link></span><b> tag has a </b><span class=\"code\">rel</span><b> attribute,</b> <b>which defines the type of relationship. </b>For now, the only relationship you’ll use is the <span class=\"code\">stylesheet</span> attribute.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><link></span><b> tag also has an </b><span class=\"code\">href</span> <b>attribute, which describes the location of the other document.</b></p>\r\n</li>\r\n</ul>\r\n<p class=\"Tip\">Link tags are often used to connect a page to an externally defined style document.</p>\r\n<p class=\"Warning\">Most people refer to the hyperlinks created by the anchor (<span class=\"code\"><a></span>) tag as hyperlinks or links. This can lead to some confusion because, in this sense, the link tag doesn’t create that type of link.</p>\r\n\r\n<h2 id=\"tab4\" >How to specify an external link</h2>\r\nTo use the <span class=\"code\"><link></span> tag to specify an external style sheet, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Define the style sheet.</p>\r\n<p class=\"child-para\">External style sheets are very similar to the ones you already know. Just put all the styles in a separate text document without the <span class=\"code\"><style></span> and <span class=\"code\"></style></span> tags.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Create a <span class=\"code\">link</span> element in the HTML page’s head area to define the link between the HTML and CSS pages.</p>\r\n<p class=\"child-para\">My link element looks like this:</p>\r\n\r\n<pre class=\"code\"> &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"myStyle.css\" /&gt;</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Set the <span class=\"code\">link</span>’s relationship by setting the <span class=\"code\">rel = </span>\"<span class=\"code\">stylesheet</span>\" attribute.</p>\r\n<p class=\"child-para\"><b></b>Honestly, <span class=\"code\">stylesheet</span> is almost the only relationship you’ll ever use, so this should become automatic.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Specify the type of style by setting <span class=\"code\">type = </span>\"<span class=\"code\">text/css</span>\".</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Determine the location of the style sheet with the <span class=\"code\">href</span> attribute.</p>\r\n</li>\r\n</ol>","description":"CSS3 supports <i>external style sheets.</i> This technique allows you to define a style sheet as a separate document and import it into your web pages. To see why this might be attractive, take a look at the example.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412513.image0.jpg\" alt=\"image0.jpg\" width=\"533\" height=\"400\" />\r\n\r\nWhen you look at the code for <span class=\"code\">externalStyle.html</span>, you might be surprised to see no obvious style information at all!\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en-US\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;externalStyle.html&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"myStyle.css\" /&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;External Style&lt;/h1&gt;\r\n &lt;p&gt;\r\n This page has styles set for paragraphs, body, and header 1.\r\n &lt;/p&gt;\r\n &lt;p&gt;\r\n The styles are defined in an external style sheet.\r\n &lt;/p&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nWhere you normally see style tags (in the header), there is no style. Instead, you see a <span class=\"code\"><link></span> tag. This special tag is used to connect the current document with another document.\r\n<h2 id=\"tab1\" >How to define the external style</h2>\r\nWhen you use an external style, the style elements aren’t embedded in the page header but in an entirely separate document.\r\n\r\nIn this case, the page is connected to a special file called <span class=\"code\">myStyle.css</span>. This file contains all the CSS rules:\r\n<pre class=\"code\">/* myStyle.css */\r\nbody {\r\n background-color: #333300;\r\n color: #FFFFFF;\r\n}\r\nh1 {\r\n color: #FFFF33;\r\n text-align: center;\r\n font: italic 200% fantasy;\r\n}\r\np {\r\n background-color: #FFFF33;\r\n color: #333300;\r\n text-align: right;\r\n border: 3px groove #FFFF33;\r\n}</pre>\r\nThe style sheet looks just like a page-level style, except for a few key differences:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The style sheet rules are contained in a separate file.</b> The style is no longer part of the HTML page but is an entirely separate file stored on the server. CSS files usually end with the <span class=\"code\">.css</span> extension.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>There are no </b><span class=\"code\"><style></style></span><b> tags. </b>These aren’t needed because the style is no longer embedded in HTML.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The code begins with a comment.</b> The <span class=\"code\">/* */</span> pair indicates a comment in CSS. Truthfully, you can put comments in CSS in the page level. External CSS files frequently have comments in them.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The style document has no HTML.</b> CSS documents contain nothing but CSS. This comes closer to the goal of separating style (in the CSS document) and content (in the HTML document).</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The document isn’t tied to any particular page.</b> The great advantage of external CSS is reuse. The CSS document isn’t part of any particular page, but any page can use it.</p>\r\n</li>\r\n</ul>\r\n<h2 id=\"tab2\" >How to reuse an external CSS style</h2>\r\nExternal style sheets are really fun when you have more than one page that needs the same style. Most websites today use multiple pages, and they should share a common style sheet to keep consistency.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/412514.image1.jpg\" alt=\"image1.jpg\" width=\"533\" height=\"400\" />\r\n\r\nThe code shows how easily this is done:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en-US\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;SecondPage.html&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"myStyle.css\" /&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;Second Page&lt;/h1&gt;\r\n &lt;p&gt;\r\n This page uses the same style as\r\n &lt;a href = \"externalStyle.html\"&gt;externalStyle.html&lt;/a&gt;.\r\n &lt;/p&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nExternal style sheets have some tremendous advantages:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>One style sheet can control many pages:</b> Generally, you have a large number of different pages in a website that all share the same general style. You can define the style sheet in one document and have all the HTML files refer to the CSS file.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Global changes are easier:</b> If you’re using external styles, you make a change in one place and it’s automatically propagated to all the pages in the system.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Separation of content and design:</b> With external CSS, all the design is housed in the CSS, and the data is in HTML.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>Easy upgrades:</b> Because the design parameters of the entire site are defined in one file, you can easily change the site without having to mess around with individual HTML files.</p>\r\n</li>\r\n</ul>\r\n<h2 id=\"tab3\" >The link tag</h2>\r\nThe <span class=\"code\"><link></span> tag is the key to adding a CSS reference to an HTML document. The <span class=\"code\"><link></span> tag has the following characteristics:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><link></span><b> tag is part of the HTML page. </b>Use a <span class=\"code\"><link></span> tag in your HTML document to specify which CSS document will be used by the HTML page.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><link></span><b> tag only occurs in the header.</b> Unlike the <span class=\"code\"><a></span> tag, the <span class=\"code\"><link></span> tag can occur only in the header.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The tag has no visual presence.</b> The user can’t see the <span class=\"code\"><link></span> tag, only its effects.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The <</b><span class=\"code\">link></span><b> tag is used to relate the document with another document.</b> You use the <span class=\"code\"><link></span> tag to describe the relationship between documents.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The</b><span class=\"code\"> <link></span><b> tag has a </b><span class=\"code\">rel</span><b> attribute,</b> <b>which defines the type of relationship. </b>For now, the only relationship you’ll use is the <span class=\"code\">stylesheet</span> attribute.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><link></span><b> tag also has an </b><span class=\"code\">href</span> <b>attribute, which describes the location of the other document.</b></p>\r\n</li>\r\n</ul>\r\n<p class=\"Tip\">Link tags are often used to connect a page to an externally defined style document.</p>\r\n<p class=\"Warning\">Most people refer to the hyperlinks created by the anchor (<span class=\"code\"><a></span>) tag as hyperlinks or links. This can lead to some confusion because, in this sense, the link tag doesn’t create that type of link.</p>\r\n\r\n<h2 id=\"tab4\" >How to specify an external link</h2>\r\nTo use the <span class=\"code\"><link></span> tag to specify an external style sheet, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Define the style sheet.</p>\r\n<p class=\"child-para\">External style sheets are very similar to the ones you already know. Just put all the styles in a separate text document without the <span class=\"code\"><style></span> and <span class=\"code\"></style></span> tags.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Create a <span class=\"code\">link</span> element in the HTML page’s head area to define the link between the HTML and CSS pages.</p>\r\n<p class=\"child-para\">My link element looks like this:</p>\r\n\r\n<pre class=\"code\"> &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"myStyle.css\" /&gt;</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Set the <span class=\"code\">link</span>’s relationship by setting the <span class=\"code\">rel = </span>\"<span class=\"code\">stylesheet</span>\" attribute.</p>\r\n<p class=\"child-para\"><b></b>Honestly, <span class=\"code\">stylesheet</span> is almost the only relationship you’ll ever use, so this should become automatic.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Specify the type of style by setting <span class=\"code\">type = </span>\"<span class=\"code\">text/css</span>\".</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Determine the location of the style sheet with the <span class=\"code\">href</span> attribute.</p>\r\n</li>\r\n</ol>","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[{"label":"How to define the external style","target":"#tab1"},{"label":"How to reuse an external CSS style","target":"#tab2"},{"label":"The link tag","target":"#tab3"},{"label":"How to specify an external link","target":"#tab4"}],"relatedArticles":{"fromBook":[{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected].","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-63221b0416ac0\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-63221b041734e\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Six months","lifeExpectancySetFrom":"2021-10-29T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":156994},{"headers":{"creationTime":"2016-03-26T14:52:16+00:00","modifiedTime":"2017-03-24T16:45:02+00:00","timestamp":"2022-09-14T18:17:57+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"How to Display XML with JavaScript on an HTML5 Page","strippedTitle":"how to display xml with javascript on an html5 page","slug":"how-to-display-xml-with-javascript-on-an-html5-page","canonicalUrl":"","seo":{"metaDescription":"XML is a great way to store data with JavaScript. However, it isn’t the easiest way to see the data. All of the tags tend to hide the data rather than make it e","noIndex":0,"noFollow":0},"content":"<p>XML is a great way to store data with JavaScript. However, it isn’t the easiest way to see the data. All of the tags tend to hide the data rather than make it easy to understand. A generated XML file tends to lack whitespace, which makes viewing it even more difficult.</p>\r\n<p>Some developers use a <a href=\"http://www.htmlgoodies.com/beyond/css/displaying-xml-files-using-css.html\">Cascading Style Sheet (CSS) method</a>, but most developers prefer to use XML Stylesheet Language for Transformations (XSLT). Using XSLT has some significant advantages in flexibility and the ability to work with complex data over CSS, but XSLT is also a little harder to learn. Check here for an <a href=\"https://www.w3schools.com/xml/xsl_intro.asp\">XSLT tutorial</a>.</p>\r\n<p>Nothing works quite so well as a quick example to demonstrate how XSLT works. To use XSLT with an XML file, you need to add a processing instruction to the XML file. The following processing instruction tells the browser displaying the <span class=\"code\">Customer2.XML</span> file to use the <span class=\"code\">CustomerOut.XSLT</span> file to format the information. This is the only difference between the <span class=\"code\">Customers2.XML</span> file and the <span class=\"code\">Customers.XML</span> file.</p>\r\n<pre class=\"code\">&lt;?xml-stylesheet type=\"text/xsl\" href=\"CustomerOut.xslt\"?&gt;</pre>\r\n<p>To transform an XML document into a document you can see, you build an HTML document from it. The following code provides a typical example of XSLT code that you might use for transformation purposes:</p>\r\n<pre class=\"code\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;xsl:stylesheet\r\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\r\n version=\"1.0\"&gt;\r\n &lt;xsl:template match=\"/\"&gt;\r\n &lt;html&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;Customer Listing&lt;/h1&gt;\r\n &lt;table border=\"1\"&gt;\r\n &lt;tr&gt;\r\n &lt;th&gt;Name&lt;/th&gt;\r\n &lt;th&gt;Age&lt;/th&gt;\r\n &lt;th&gt;Favorite Color&lt;/th&gt;\r\n &lt;/tr&gt;\r\n &lt;xsl:for-each select=\"Customers/Customer\"&gt;\r\n &lt;tr&gt;\r\n &lt;td&gt;\r\n &lt;xsl:value-of select=\"Name\" /&gt;\r\n &lt;/td&gt;\r\n &lt;td&gt;\r\n &lt;xsl:value-of select=\"Age\" /&gt;\r\n &lt;/td&gt;\r\n &lt;td&gt;\r\n &lt;xsl:value-of\r\n select=\"FavoriteColor\" /&gt;\r\n &lt;/td&gt;\r\n &lt;/tr&gt;\r\n &lt;/xsl:for-each&gt;\r\n &lt;/table&gt;\r\n &lt;/body&gt;\r\n &lt;/html&gt;\r\n &lt;/xsl:template&gt;\r\n&lt;/xsl:stylesheet&gt;</pre>\r\n<p>That’s right: XSLT is actually another form of XML, so it starts out with the XML declaration. The <span class=\"code\"><xsl:stylesheet></span> root node defines the document as providing XSLT support. It includes a namespace attribute that tells the browser where to find information on how to interpret XSLT. Check here to find out more about <a href=\"http://www.w3schools.com/xml/xml_namespaces.asp\">namespaces</a>.</p>\r\n<p>The <span class=\"code\"><xsl:template></span> tag tells the browser what information to retrieve from the XML file for display purposes. This document retrieves everything in the XML file.</p>\r\n<p>The next steps begin creating the HTML document, complete with the tags required to do so. This is an abbreviated page. Normally, you’d include all the required tags. The page includes a heading and the start of a table.</p>\r\n<p>The <span class=\"code\"><xsl:for-each></span> tag processes each of the <span class=\"code\"><Customer></span> entries in the file. The file then builds the rows and data cells for the table. The <span class=\"code\"><xsl:value-of></span> tag retrieves the data values of the <span class=\"code\"><Name></span>, <span class=\"code\"><Age></span>, and <span class=\"code\"><FavoriteColor></span> elements.</p>\r\n<img src=\"https://www.dummies.com/wp-content/uploads/377616.image0.jpg\" width=\"459\" height=\"400\" alt=\"image0.jpg\"/>\r\n<p class=\"Tip\">Some browsers encounter problems using the example from the local drive. For example, Chrome displays a blank page when you access <span class=\"code\">Customers2.XML</span> from the local drive. To test this technique in a way that works for most browsers, copy the files to your web server and then access the XML file from the web server.</p>","description":"<p>XML is a great way to store data with JavaScript. However, it isn’t the easiest way to see the data. All of the tags tend to hide the data rather than make it easy to understand. A generated XML file tends to lack whitespace, which makes viewing it even more difficult.</p>\r\n<p>Some developers use a <a href=\"http://www.htmlgoodies.com/beyond/css/displaying-xml-files-using-css.html\">Cascading Style Sheet (CSS) method</a>, but most developers prefer to use XML Stylesheet Language for Transformations (XSLT). Using XSLT has some significant advantages in flexibility and the ability to work with complex data over CSS, but XSLT is also a little harder to learn. Check here for an <a href=\"https://www.w3schools.com/xml/xsl_intro.asp\">XSLT tutorial</a>.</p>\r\n<p>Nothing works quite so well as a quick example to demonstrate how XSLT works. To use XSLT with an XML file, you need to add a processing instruction to the XML file. The following processing instruction tells the browser displaying the <span class=\"code\">Customer2.XML</span> file to use the <span class=\"code\">CustomerOut.XSLT</span> file to format the information. This is the only difference between the <span class=\"code\">Customers2.XML</span> file and the <span class=\"code\">Customers.XML</span> file.</p>\r\n<pre class=\"code\">&lt;?xml-stylesheet type=\"text/xsl\" href=\"CustomerOut.xslt\"?&gt;</pre>\r\n<p>To transform an XML document into a document you can see, you build an HTML document from it. The following code provides a typical example of XSLT code that you might use for transformation purposes:</p>\r\n<pre class=\"code\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;xsl:stylesheet\r\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\r\n version=\"1.0\"&gt;\r\n &lt;xsl:template match=\"/\"&gt;\r\n &lt;html&gt;\r\n &lt;body&gt;\r\n &lt;h1&gt;Customer Listing&lt;/h1&gt;\r\n &lt;table border=\"1\"&gt;\r\n &lt;tr&gt;\r\n &lt;th&gt;Name&lt;/th&gt;\r\n &lt;th&gt;Age&lt;/th&gt;\r\n &lt;th&gt;Favorite Color&lt;/th&gt;\r\n &lt;/tr&gt;\r\n &lt;xsl:for-each select=\"Customers/Customer\"&gt;\r\n &lt;tr&gt;\r\n &lt;td&gt;\r\n &lt;xsl:value-of select=\"Name\" /&gt;\r\n &lt;/td&gt;\r\n &lt;td&gt;\r\n &lt;xsl:value-of select=\"Age\" /&gt;\r\n &lt;/td&gt;\r\n &lt;td&gt;\r\n &lt;xsl:value-of\r\n select=\"FavoriteColor\" /&gt;\r\n &lt;/td&gt;\r\n &lt;/tr&gt;\r\n &lt;/xsl:for-each&gt;\r\n &lt;/table&gt;\r\n &lt;/body&gt;\r\n &lt;/html&gt;\r\n &lt;/xsl:template&gt;\r\n&lt;/xsl:stylesheet&gt;</pre>\r\n<p>That’s right: XSLT is actually another form of XML, so it starts out with the XML declaration. The <span class=\"code\"><xsl:stylesheet></span> root node defines the document as providing XSLT support. It includes a namespace attribute that tells the browser where to find information on how to interpret XSLT. Check here to find out more about <a href=\"http://www.w3schools.com/xml/xml_namespaces.asp\">namespaces</a>.</p>\r\n<p>The <span class=\"code\"><xsl:template></span> tag tells the browser what information to retrieve from the XML file for display purposes. This document retrieves everything in the XML file.</p>\r\n<p>The next steps begin creating the HTML document, complete with the tags required to do so. This is an abbreviated page. Normally, you’d include all the required tags. The page includes a heading and the start of a table.</p>\r\n<p>The <span class=\"code\"><xsl:for-each></span> tag processes each of the <span class=\"code\"><Customer></span> entries in the file. The file then builds the rows and data cells for the table. The <span class=\"code\"><xsl:value-of></span> tag retrieves the data values of the <span class=\"code\"><Name></span>, <span class=\"code\"><Age></span>, and <span class=\"code\"><FavoriteColor></span> elements.</p>\r\n<img src=\"https://www.dummies.com/wp-content/uploads/377616.image0.jpg\" width=\"459\" height=\"400\" alt=\"image0.jpg\"/>\r\n<p class=\"Tip\">Some browsers encounter problems using the example from the local drive. For example, Chrome displays a blank page when you access <span class=\"code\">Customers2.XML</span> from the local drive. To test this technique in a way that works for most browsers, copy the files to your web server and then access the XML file from the web server.</p>","blurb":"","authors":[{"authorId":9109,"name":"John Paul Mueller","slug":"john-paul-mueller","description":" <p><b>John Mueller</b> has produced 114 books and more than 600 articles on topics ranging from functional programming techniques to working with Amazon Web Services &#40;AWS&#41;. <b>Luca Massaron,</b> a Google Developer Expert &#40;GDE&#41;,??interprets big data and transforms it into smart data through simple and effective data mining and machine learning techniques. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9109"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":0,"slug":null,"isbn":null,"categoryList":null,"amazon":null,"image":null,"title":null,"testBankPinActivationLink":null,"bookOutOfPrint":false,"authorsInfo":null,"authors":null,"_links":null},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[null]}]\" id=\"du-slot-63221ad545a18\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[null]}]\" id=\"du-slot-63221ad545ff7\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":165855}],"_links":{"self":{"self":"https://dummies-api.dummies.com/v2/categories/33601/categoryArticles?sortField=time&sortOrder=1&size=10&offset=0"},"next":{"self":"https://dummies-api.dummies.com/v2/categories/33601/categoryArticles?sortField=time&sortOrder=1&size=10&offset=10"},"last":{"self":"https://dummies-api.dummies.com/v2/categories/33601/categoryArticles?sortField=time&sortOrder=1&size=10&offset=255"}}},"objectTitle":"","status":"success","pageType":"article-category","objectId":"33601","page":1,"sortField":"time","sortOrder":1,"categoriesIds":[],"articleTypes":[],"filterData":{"categoriesFilter":[{"itemId":0,"itemName":"All Categories","count":265}],"articleTypeFilter":[{"articleType":"All Types","count":265},{"articleType":"Articles","count":254},{"articleType":"Cheat Sheet","count":3},{"articleType":"Step by Step","count":8}]},"filterDataLoadedStatus":"success","pageSize":10},"adsState":{"pageScripts":{"headers":{"timestamp":"2025-04-17T15:50:01+00:00"},"adsId":0,"data":{"scripts":[{"pages":["all"],"location":"header","script":"<!--Optimizely Script-->\r\n<script src=\"https://cdn.optimizely.com/js/10563184655.js\"></script>","enabled":false},{"pages":["all"],"location":"header","script":"<!-- comScore Tag -->\r\n<script>var _comscore = _comscore || [];_comscore.push({ c1: \"2\", c2: \"15097263\" });(function() {var s = document.createElement(\"script\"), el = document.getElementsByTagName(\"script\")[0]; s.async = true;s.src = (document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\") + \".scorecardresearch.com/beacon.js\";el.parentNode.insertBefore(s, el);})();</script><noscript><img src=\"https://sb.scorecardresearch.com/p?c1=2&c2=15097263&cv=2.0&cj=1\" /></noscript>\r\n<!-- / comScore Tag -->","enabled":true},{"pages":["all"],"location":"footer","script":"<!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->\r\n<script type='text/javascript'>\r\n(function(){var g=function(e,h,f,g){\r\nthis.get=function(a){for(var a=a+\"=\",c=document.cookie.split(\";\"),b=0,e=c.length;b<e;b++){for(var d=c[b];\" \"==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};\r\nthis.set=function(a,c){var b=\"\",b=new Date;b.setTime(b.getTime()+6048E5);b=\"; expires=\"+b.toGMTString();document.cookie=a+\"=\"+c+b+\"; path=/; \"};\r\nthis.check=function(){var a=this.get(f);if(a)a=a.split(\":\");else if(100!=e)\"v\"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(\":\"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case \"v\":return!1;case \"r\":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(\":\")),!c}return!0};\r\nthis.go=function(){if(this.check()){var a=document.createElement(\"script\");a.type=\"text/javascript\";a.src=g;document.body&&document.body.appendChild(a)}};\r\nthis.start=function(){var t=this;\"complete\"!==document.readyState?window.addEventListener?window.addEventListener(\"load\",function(){t.go()},!1):window.attachEvent&&window.attachEvent(\"onload\",function(){t.go()}):t.go()};};\r\ntry{(new g(100,\"r\",\"QSI_S_ZN_5o5yqpvMVjgDOuN\",\"https://zn5o5yqpvmvjgdoun-wiley.siteintercept.qualtrics.com/SIE/?Q_ZID=ZN_5o5yqpvMVjgDOuN\")).start()}catch(i){}})();\r\n</script><div id='ZN_5o5yqpvMVjgDOuN'><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>\r\n<!--END WEBSITE FEEDBACK SNIPPET-->","enabled":false},{"pages":["all"],"location":"header","script":"<!-- Hotjar Tracking Code for http://www.dummies.com -->\r\n<script>\r\n (function(h,o,t,j,a,r){\r\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\r\n h._hjSettings={hjid:257151,hjsv:6};\r\n a=o.getElementsByTagName('head')[0];\r\n r=o.createElement('script');r.async=1;\r\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\r\n a.appendChild(r);\r\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\r\n</script>","enabled":false},{"pages":["article"],"location":"header","script":"<!-- //Connect Container: dummies --> <script src=\"//get.s-onetag.com/bffe21a1-6bb8-4928-9449-7beadb468dae/tag.min.js\" async defer></script>","enabled":true},{"pages":["homepage"],"location":"header","script":"<meta name=\"facebook-domain-verification\" content=\"irk8y0irxf718trg3uwwuexg6xpva0\" />","enabled":true},{"pages":["homepage","article","category","search"],"location":"footer","script":"<!-- Facebook Pixel Code -->\r\n<noscript>\r\n<img height=\"1\" width=\"1\" src=\"https://www.facebook.com/tr?id=256338321977984&ev=PageView&noscript=1\"/>\r\n</noscript>\r\n<!-- End Facebook Pixel Code -->","enabled":true}]}},"pageScriptsLoadedStatus":"success"},"navigationState":{"navigationCollections":[{"collectionId":287568,"title":"BYOB (Be Your Own Boss)","hasSubCategories":false,"url":"/collection/for-the-entry-level-entrepreneur-287568"},{"collectionId":293237,"title":"Be a Rad Dad","hasSubCategories":false,"url":"/collection/be-the-best-dad-293237"},{"collectionId":295890,"title":"Career Shifting","hasSubCategories":false,"url":"/collection/career-shifting-295890"},{"collectionId":294090,"title":"Contemplating the Cosmos","hasSubCategories":false,"url":"/collection/theres-something-about-space-294090"},{"collectionId":287563,"title":"For Those Seeking Peace of Mind","hasSubCategories":false,"url":"/collection/for-those-seeking-peace-of-mind-287563"},{"collectionId":287570,"title":"For the Aspiring Aficionado","hasSubCategories":false,"url":"/collection/for-the-bougielicious-287570"},{"collectionId":291903,"title":"For the Budding Cannabis Enthusiast","hasSubCategories":false,"url":"/collection/for-the-budding-cannabis-enthusiast-291903"},{"collectionId":299891,"title":"For the College Bound","hasSubCategories":false,"url":"/collection/for-the-college-bound-299891"},{"collectionId":291934,"title":"For the Exam-Season Crammer","hasSubCategories":false,"url":"/collection/for-the-exam-season-crammer-291934"},{"collectionId":301547,"title":"For the Game Day Prepper","hasSubCategories":false,"url":"/collection/big-game-day-prep-made-easy-301547"}],"navigationCollectionsLoadedStatus":"success","navigationCategories":{"books":{"0":{"data":[{"categoryId":33512,"title":"Technology","hasSubCategories":true,"url":"/category/books/technology-33512"},{"categoryId":33662,"title":"Academics & The Arts","hasSubCategories":true,"url":"/category/books/academics-the-arts-33662"},{"categoryId":33809,"title":"Home, Auto, & Hobbies","hasSubCategories":true,"url":"/category/books/home-auto-hobbies-33809"},{"categoryId":34038,"title":"Body, Mind, & Spirit","hasSubCategories":true,"url":"/category/books/body-mind-spirit-34038"},{"categoryId":34224,"title":"Business, Careers, & Money","hasSubCategories":true,"url":"/category/books/business-careers-money-34224"}],"breadcrumbs":[],"categoryTitle":"Level 0 Category","mainCategoryUrl":"/category/books/level-0-category-0"}},"articles":{"0":{"data":[{"categoryId":33512,"title":"Technology","hasSubCategories":true,"url":"/category/articles/technology-33512"},{"categoryId":33662,"title":"Academics & The Arts","hasSubCategories":true,"url":"/category/articles/academics-the-arts-33662"},{"categoryId":33809,"title":"Home, Auto, & Hobbies","hasSubCategories":true,"url":"/category/articles/home-auto-hobbies-33809"},{"categoryId":34038,"title":"Body, Mind, & Spirit","hasSubCategories":true,"url":"/category/articles/body-mind-spirit-34038"},{"categoryId":34224,"title":"Business, Careers, & Money","hasSubCategories":true,"url":"/category/articles/business-careers-money-34224"}],"breadcrumbs":[],"categoryTitle":"Level 0 Category","mainCategoryUrl":"/category/articles/level-0-category-0"}}},"navigationCategoriesLoadedStatus":"success"},"searchState":{"searchList":[],"searchStatus":"initial","relatedArticlesList":[],"relatedArticlesStatus":"initial"},"routeState":{"name":"ArticleCategory","path":"/category/articles/html5-33601/","hash":"","query":{},"params":{"category":"html5-33601"},"fullPath":"/category/articles/html5-33601/","meta":{"routeType":"category","breadcrumbInfo":{"suffix":"Articles","baseRoute":"/category/articles"},"prerenderWithAsyncData":true},"from":{"name":null,"path":"/","hash":"","query":{},"params":{},"fullPath":"/","meta":{}}},"profileState":{"auth":{},"userOptions":{},"status":"success"}}
Logo
  • Articles Open Article Categories
  • Books Open Book Categories
  • Collections Open Collections list
  • Custom Solutions

Article Categories

Book Categories

Collections

Explore all collections
BYOB (Be Your Own Boss)
Be a Rad Dad
Career Shifting
Contemplating the Cosmos
For Those Seeking Peace of Mind
For the Aspiring Aficionado
For the Budding Cannabis Enthusiast
For the College Bound
For the Exam-Season Crammer
For the Game Day Prepper
Log In
  • Home
  • Technology Articles
  • Programming & Web Design Articles
  • HTML5 Articles

HTML5 Articles

HTML5 is like the DNA of the worldwide web. Yeah, it's that important. Learn how it works and what it can do, here.

Articles From HTML5

page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
page 10
page 11
page 12
page 13
page 14
page 15
page 16
page 17
page 18
page 19
page 20
page 21
page 22
page 23
page 24
page 25
page 26
page 27

Filter Results

265 results
265 results
HTML5 Making AJAX Requests with jQuery for HTML5 and CSS3

Article / Updated 07-10-2023

The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with jQuery. How to include a text file with AJAX Check out this clean code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ajax.html</title> <script type = "text/javascript" src = "jquery-1.10.2.min.js"></script> <script type = "text/javascript"> $(document).ready(getAJAX); function getAJAX(){ $("#output").load("hello.txt"); } </script> </head> <body> <div id = "output"></div> </body> </html> The HTML is very clean. It simply creates an empty div called output. This example does use AJAX, so if it isn't working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request. The load() mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages. Building a poor man's CMS with AJAX AJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content. Although nothing is all that shocking about the page from the user's perspective, a look at the code can show some surprises: <!DOCTYPE html> <html lang = "en"> <head> <meta charset = "UTF-8"> <title>CMS Using AJAX</title> <link rel = "stylesheet" type = "text/css" href = "cmsStd.css" /> <script type = "text/javascript" src = "jquery-1.10.2.min.js"></script> <script type = "text/javascript"> $(init); function init(){ $("#heading").load("head.html"); $("#menu").load("menu.html"); $("#content1").load("story1.html"); $("#content2").load("story2.html"); $("#footer").load("footer.html"); }; </script> </head> <body> <div id = "all"> <!-- This div centers a fixed-width layout → <div id = "heading"> </div><!-- end heading div → <div id = "menu"> </div> <!-- end menu div → <div class = "content" id = "content1"> </div> <!-- end content div → <div class = "content" id = "content2"> </div> <!-- end content div → <div id = "footer"> </div> <!-- end footer div → </div> <!-- end all div → </body> </html> Look over the code, and you can see these interesting features: The page has no content! All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically. The page consists of empty named divs. Rather than any particular content, the page consists of placeholders with IDs. It uses jQuery. The jQuery library is used to vastly simplify loading data through AJAX calls. All contents are in separate files. Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this: <h2>Book I - Creating the HTML Foundation</h3> <ol> <li>Sound HTML Foundations</li> <li>It's All About Validation</li> <li>Choosing your Tools</li> <li>Managing Information with Lists and Tables</li> <li>Making Connections with Links</li> <li>Adding Images</li> <li>Creating forms</li> </ol> The init() method runs on document.ready. When the document is ready, the page runs the init() method. The init() method uses AJAX calls to dynamically load content. It's nothing more than a series of jQuery load() methods. This approach may seem like a lot of work, but it has some very interesting characteristics: If you're building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly. Also, you'll probably have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages. The advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it. Here's how you use this sort of approach: Create a single template for your entire site. Build basic HTML and CSS to manage the overall look and feel for your entire site. Don't worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want. Add jQuery support. Make a link to the jQuery library, and make a default init() method. Put in code to handle populating those parts of the page that will always be consistent. Duplicate the template. After you have a sense of how the template will work, make a copy for each page of your site. Customize each page by changing the init() function. The only part of the template that changes is the init() function. All your pages will be identical, except they have customized init() functions that load different content. Load custom content into the divs with AJAX. Use the init()function to load content into each div. This is a great way to manage content, but it isn't quite a full-blown content-management system. Even AJAX can't quite allow you to store content on the web. More complex content management systems also use databases rather than files to handle content. You'll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this kind of work.

View Article
HTML5 How to Create Page Styles for Your HTML5 & CSS3 Template

Article / Updated 06-28-2023

With an HTML framework in place, you can start working on the CSS to create page styles on your site. The best way to incorporate CSS3 is by following these steps: Begin with the page template diagram. It should have all the information you need. Test your CSS in a browser. Begin with a simple CSS implementation that ensures you have the right names for all the page elements. Then modify each element according to your design document, testing as you go. Implement the CSS from your diagram. You should be implementing the design you already created, not designing the page. (That already happened in the diagramming process.) Save the design. For multi-page projects, external CSS in a separate file is definitely the way to go. As you work, save the CSS in the normal way so the browser will be able to read it. Test and tweak. Things are never quite what they seem with CSS because browsers don't conform to standards equally. You need to test and tweak on other browsers. If users with older technologies are a concern, you may have to use a secondary style sheet for older versions of IE. You may also want to make a mobile version. Repeat for other templates. Repeat this process for each of the other templates you identified in your site diagram. The result of this process should be a number of CSS files that you can readily reuse across your site. Here's the CSS code for the primary page: body { background-color: #000000; } h1 { text-align: center; font-family: sans-serif; color: white; text-shadow: 0 0 10px black; } #all { background-color: white; border: 1px solid black; width: 800px; margin-top:2em; margin-left: auto; margin-right: auto; min-height: 600px; } #heading { background-color: #A11204; background-image: url("cbBackground.png"); color: #FFFFFF; height: 100px; font-size: 2em; padding-left: 1em; border-bottom: 3px solid black; margin-top: -1.5em; } #menu { background-image: url("cbBackground.png"); background-color: #A11204; color: #FFFFFF; float: left; width: 100px; min-height: 500px; } #menu li { list-style-type: none; margin-left: -2em; margin-right: .5em; text-align: center; } #menu a { color: #FFFFFF; display: block; border: #A11204 3px outset; text-decoration: none; } #menu a:hover { border: #A11204 3px inset; } .content { border: 3px double #A11204; margin: 1em; margin-left: 110px; padding-left: 1em; padding-bottom: 1em; padding-right: 1em; border-radius: 5px; box-shadow: 5px 5px 5px gray; } .content h2 { background-color: #A11204; background-image: url("cbBackground.png"); color: #FFFFFF; text-align: right; } #footer { color: #FFFFFF; background-color: #000000; border: 1px solid #A11204; float: left; clear: both; width: 100%; text-align: center; }

View Article
HTML5 Setting the Font on HTML5 and CSS3 Web Pages

Article / Updated 05-03-2023

To assign a font family to part of your page, use some new CSS. As an example, this page has the heading set to Comic Sans MS. If this page is viewed on a Windows machine, it generally displays the font correctly because Comic Sans MS is installed with most versions of Windows. If you're on another type of machine, you may get something else. Look at the simple case. Here's the code: <!DOCTYPE html> <html lang = "en-US"> <head> <meta charset = "UTF-8"> <title>comicHead.html</title> <style type = "text/css"> h1 { font-family: "Comic Sans MS"; } </style> </head> <body> <h1>This is a heading</h1> <p> This is ordinary text. </p> </body> </html> The secret to this page is the CSS attribute. Like most CSS elements, this can be applied to any HTML tag on your page. In this particular case, it was applied it to the level one heading. h1 { font-family: "Comic Sans MS"; } You can then attach any font name you wish, and the browser attempts to use that font to display the element. Even though a font may work perfectly fine on your computer, it may not work if that font isn't installed on the user's machine. If you run exactly the same page on an iPad, you might see this result. The specific font Comic Sans MS is installed on Windows machines, but the MS stands for Microsoft. This font isn't always installed on Linux or Mac. (Sometimes it's there, and sometimes it isn't.) You can't count on users having any particular fonts installed. The Comic Sans font is fine for an example, but it has been heavily over-used in web development. Serious web developers avoid using it in real applications because it tends to make your page look amateurish.

View Article
HTML5 How to Build a Basic Array in JavaScript for HTML5 and CSS3 Programming

Article / Updated 09-19-2022

Arrays are groups of variables in JavaScript with a name. Arrays are similar to functions because they're used to manage complexity for HTML5 and CSS3 programming. An array is a special kind of variable. Use an array whenever you want to work with a list of similar data types. The following code shows a basic demonstration of arrays: <script type = "text/javascript"> //from genres.html //creating an empty array var genre = new Array(5); //storing data in the array genre[0] = "flight simulation"; genre[1] = "first-person shooters"; genre[2] = "driving"; genre[3] = "action"; genre[4] = "strategy"; //returning data from the array alert ("I like " + genre[4] + " games."); //]]> </script> The variable is a special variable because it contains many values. Essentially, it's a list of genres. The array(5) construct creates space in memory for five variables, all named genre. Accessing array data After you specify an array, you can work with the individual elements using square-bracket syntax. An integer identifies each element of the array. The index usually begins with. genre[0] = "flight simulation"; The preceding code assigns the text value “flight simulation” to the genre array variable at position 0. Most languages require all array elements to be the same type. JavaScript is very forgiving. You can combine all kinds of stuff in a JavaScript array. This flexibility can sometimes be useful, but be aware that this trick doesn't work in all languages. Generally, try to keep all the members of an array the same type. After you store the data in the array, you can use the same square-bracket syntax to read the information. The line alert ("I like " + genre[4] + " games."); finds element 4 of the genre array and includes it in an output message. Using arrays with for loops The main reason to use arrays is convenience. When you have a lot of information in an array, you can write code to work with the data quickly. Whenever you have an array of data, you commonly want to do something with each element in the array. Take a look at to see how you can do so: <script type = "text/javascript"> //from games.html //pre-loading an array var gameList = new Array("Flight Gear", "Sauerbraten", "Future Pinball", "Racer", "TORCS", "Orbiter", "Step Mania", "NetHack", "Marathon", "Crimson Fields"); var text = "; for (i = 0; i < gameList.length; i++){ text += "I love " + gameList[i] + "n"; } // end for loop alert(text); </script> Notice several things in this code: The array called gameList. This array contains the names of some great freeware games. The array is preloaded with values. If you provide a list of values when creating an array, JavaScript simply preloads the array with the values you indicate. You don't need to specify the size of the array if you preload it. A for loop steps through the array. Arrays and for loops are natural companions. The for loop steps through each element of the array. The array's length is used in the for loop condition. Rather than specifying the value 10, the array's length property was used in the loop. This practice is good because the for loop automatically adjusts to the size of the array when you add or remove elements. Do something with each element. Because goes from 0 to 9 (the array indices), you can easily print each value of the array. In this example, an output string was added to. Note the newline characters. The n combination is a special character that tells JavaScript to add a carriage return, such as you get by pressing the Enter key. If you want to completely ruin your productivity, Google some of these game names. They're absolutely incredible, and every one of them is free. You can't beat that.

View Article
HTML5 How to Create Definition Lists in HTML5

Article / Updated 08-11-2022

Lists are powerful tools for grouping similar elements, and lists give visitors to your site an easy way to zoom in on groups of information. Just about anything fits in a list, from sets of instructions to collections of links. Definition lists group terms and definitions into a single list and require three elements to complete the list: : Holds the list definitions (dl = definition list) : Defines a term in the list (dt = definition term) : Defines a definition for a term (dd = definition list definition) You can have as many terms (defined by ) in a list () as you need. Each term can have one or more definitions (defined by ). Creating a definition list with two items requires tags and content in the following order: First term name Content for the definition of the first item Second term name Content for the definition of the second item The following definition list includes three terms, one of which has two definitions: <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Definition Lists</title> </head> <body> <h1>Markup Language Definitions</h1> <dl> <dt>SGML</dt> <dd>The Standard Generalized Markup Language</dd> <dt>HTML</dt> <dd>The Hypertext Markup Language</dd> <dd>The markup language you use to create web pages.</dd> <dt>XML</dt> <dd>The Extensible Markup Language</dd> </dl> </body> </html> The figure shows how a browser displays this HTML. If you think items in a list are too close together, you can use CSS styles to carefully control all aspects of list appearance. Note that definition lists often display differently inside different browsers, and they aren’t always handled the same by search engines or text-to-speech translators. About.com has a nice discussion of definition lists on their Web Design / HTML page. Alas, this means that definition lists may not be the best choice of formatting for lists you create (even lists of definitions). For a more detailed discussion, see the excellent coverage of this topic on Max Design.

View Article
HTML5 Mobile First Web Design

Article / Updated 08-02-2022

Two big categories of strategies have been employed over the years to support web design for mobile devices: graceful degradation and progressive enhancement. Much of the web is currently nearly unusable on mobile devices because it was designed for desktop browsers and doesn't adapt well to small screens. Mobile web users are often forced to zoom, scroll, pinch, squint, and make their fingers as small as possible to use the majority of websites designed more than a couple years ago. Graceful degradation web design strategy for mobile devices The idea behind graceful degradation is to design your website primarily for desktop users, but to also design it in such a way that features of the desktop site that won't work or fit on mobile devices will still be usable — if not pretty or as functional — on mobile devices. Graceful degradation was a good design philosophy in the days before smartphones with full-featured browsers existed. However, graceful degradation does have major problems. Most importantly, graceful degradation forces the user to download your whole website, only to be shown a degraded version of it. On mobile devices, which often have limited bandwidth, this is not a good thing. Progressive enhancement web design strategy for mobile devices As a result of graceful degradation's limitations, a new strategy called progressive enhancement has become popular. Progressive enhancement starts with the very most basic website and adds on features depending on what the user's browser supports. Progressive enhancement enables websites to be usable even when using a very basic mobile phone. The mobile browser doesn't need to download a lot of CSS and JavaScript code (for example) that it doesn't know what to do with. One way to visualize progressive enhancement is as a system that adds layers onto a website depending on the size of the browser or the features the browser supports. Here's a simple example of how two style sheet links can be used to enhance a mobile webpage for larger browsers: <link rel="stylesheet" type="text/css" href="style.css" media="screen, handheld" /> <link rel="stylesheet" type="text/css" href="enhanced.css" media="screen and (min-width: 800px)" /> The first link includes style.css for any screen or handheld device. In this case, style.css contains styles that are optimized for a mobile device. The second link is for a style sheet called enhanced.css. If you look at the media attribute for this link, you'll notice that it has a min-width condition. The enhanced.css file will only be included if the device is larger than 800px. Inside enhanced.css, the web designer can override properties from the style.css style sheet to make the browser scale up for larger browser widths. Mobile first design solves the browser size issue Mobile first is a design philosophy that employs the ideas of progressive enhancement to build mobile websites first and then enhance them for desktop. The great thing about mobile first design is that when you build the mobile site first, as opposed to the other way around, you get a functional desktop site for free! Think about all the websites you've seen that don't fit in mobile browsers. Now, imagine visiting a mobile website with a desktop computer. A website that is optimized for a small screen will always work on a desktop browser — even if it does end up not filling the entire browser window.

View Article
HTML5 Beginning HTML5 & CSS3 For Dummies Cheat Sheet

Cheat Sheet / Updated 03-18-2022

Hypertext Markup Language (HTML) and the Cascading Style Sheet (CSS) language are the lifeblood of web pages. Even experienced web designers and authors need help sometimes. This Cheat Sheet provides a quick color code guide, a table of HTML5 elements, and a table of CSS properties.

View Cheat Sheet
HTML5 HTML5 and CSS3 All-in-One For Dummies Cheat Sheet

Cheat Sheet / Updated 02-28-2022

Check out these handy references on an HTML5 template you can use to start every document, selected MySQL commands, useful JavaScript syntax and CSS attributes, and selected HTML syntax.

View Cheat Sheet
HTML5 How to Use an External Style Sheet for HTML5 and CSS3 Programming

Article / Updated 10-29-2021

CSS3 supports external style sheets. This technique allows you to define a style sheet as a separate document and import it into your web pages. To see why this might be attractive, take a look at the example. When you look at the code for externalStyle.html, you might be surprised to see no obvious style information at all! <!DOCTYPE html> <html lang = "en-US"> <head> <meta charset = "UTF-8"> <title>externalStyle.html</title> <link rel = "stylesheet" type = "text/css" href = "myStyle.css" /> </head> <body> <h1>External Style</h1> <p> This page has styles set for paragraphs, body, and header 1. </p> <p> The styles are defined in an external style sheet. </p> </body> </html> Where you normally see style tags (in the header), there is no style. Instead, you see a tag. This special tag is used to connect the current document with another document. How to define the external style When you use an external style, the style elements aren’t embedded in the page header but in an entirely separate document. In this case, the page is connected to a special file called myStyle.css. This file contains all the CSS rules: /* myStyle.css */ body { background-color: #333300; color: #FFFFFF; } h1 { color: #FFFF33; text-align: center; font: italic 200% fantasy; } p { background-color: #FFFF33; color: #333300; text-align: right; border: 3px groove #FFFF33; } The style sheet looks just like a page-level style, except for a few key differences: The style sheet rules are contained in a separate file. The style is no longer part of the HTML page but is an entirely separate file stored on the server. CSS files usually end with the .css extension. There are no tags. These aren’t needed because the style is no longer embedded in HTML. The code begins with a comment. The /* */ pair indicates a comment in CSS. Truthfully, you can put comments in CSS in the page level. External CSS files frequently have comments in them. The style document has no HTML. CSS documents contain nothing but CSS. This comes closer to the goal of separating style (in the CSS document) and content (in the HTML document). The document isn’t tied to any particular page. The great advantage of external CSS is reuse. The CSS document isn’t part of any particular page, but any page can use it. How to reuse an external CSS style External style sheets are really fun when you have more than one page that needs the same style. Most websites today use multiple pages, and they should share a common style sheet to keep consistency. The code shows how easily this is done: <!DOCTYPE html> <html lang = "en-US"> <head> <meta charset = "UTF-8"> <title>SecondPage.html</title> <link rel = "stylesheet" type = "text/css" href = "myStyle.css" /> </head> <body> <h1>Second Page</h1> <p> This page uses the same style as <a href = "externalStyle.html">externalStyle.html</a>. </p> </body> </html> External style sheets have some tremendous advantages: One style sheet can control many pages: Generally, you have a large number of different pages in a website that all share the same general style. You can define the style sheet in one document and have all the HTML files refer to the CSS file. Global changes are easier: If you’re using external styles, you make a change in one place and it’s automatically propagated to all the pages in the system. Separation of content and design: With external CSS, all the design is housed in the CSS, and the data is in HTML. Easy upgrades: Because the design parameters of the entire site are defined in one file, you can easily change the site without having to mess around with individual HTML files. The link tag The tag is the key to adding a CSS reference to an HTML document. The tag has the following characteristics: The tag is part of the HTML page. Use a tag in your HTML document to specify which CSS document will be used by the HTML page. The tag only occurs in the header. Unlike the tag, the tag can occur only in the header. The tag has no visual presence. The user can’t see the tag, only its effects. The <link> tag is used to relate the document with another document. You use the tag to describe the relationship between documents. The tag has a rel attribute, which defines the type of relationship. For now, the only relationship you’ll use is the stylesheet attribute. The tag also has an href attribute, which describes the location of the other document. Link tags are often used to connect a page to an externally defined style document. Most people refer to the hyperlinks created by the anchor () tag as hyperlinks or links. This can lead to some confusion because, in this sense, the link tag doesn’t create that type of link. How to specify an external link To use the tag to specify an external style sheet, follow these steps: Define the style sheet. External style sheets are very similar to the ones you already know. Just put all the styles in a separate text document without the </span> and <span class="code"> tags. Create a link element in the HTML page’s head area to define the link between the HTML and CSS pages. My link element looks like this: <link rel = "stylesheet" type = "text/css" href = "myStyle.css" /> Set the link’s relationship by setting the rel = "stylesheet" attribute. Honestly, stylesheet is almost the only relationship you’ll ever use, so this should become automatic. Specify the type of style by setting type = "text/css". Determine the location of the style sheet with the href attribute.

View Article
HTML5 How to Display XML with JavaScript on an HTML5 Page

Article / Updated 03-24-2017

XML is a great way to store data with JavaScript. However, it isn’t the easiest way to see the data. All of the tags tend to hide the data rather than make it easy to understand. A generated XML file tends to lack whitespace, which makes viewing it even more difficult. Some developers use a Cascading Style Sheet (CSS) method, but most developers prefer to use XML Stylesheet Language for Transformations (XSLT). Using XSLT has some significant advantages in flexibility and the ability to work with complex data over CSS, but XSLT is also a little harder to learn. Check here for an XSLT tutorial. Nothing works quite so well as a quick example to demonstrate how XSLT works. To use XSLT with an XML file, you need to add a processing instruction to the XML file. The following processing instruction tells the browser displaying the Customer2.XML file to use the CustomerOut.XSLT file to format the information. This is the only difference between the Customers2.XML file and the Customers.XML file. <?xml-stylesheet type="text/xsl" href="CustomerOut.xslt"?> To transform an XML document into a document you can see, you build an HTML document from it. The following code provides a typical example of XSLT code that you might use for transformation purposes: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <body> <h1>Customer Listing</h1> <table border="1"> <tr> <th>Name</th> <th>Age</th> <th>Favorite Color</th> </tr> <xsl:for-each select="Customers/Customer"> <tr> <td> <xsl:value-of select="Name" /> </td> <td> <xsl:value-of select="Age" /> </td> <td> <xsl:value-of select="FavoriteColor" /> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> That’s right: XSLT is actually another form of XML, so it starts out with the XML declaration. The root node defines the document as providing XSLT support. It includes a namespace attribute that tells the browser where to find information on how to interpret XSLT. Check here to find out more about namespaces. The tag tells the browser what information to retrieve from the XML file for display purposes. This document retrieves everything in the XML file. The next steps begin creating the HTML document, complete with the tags required to do so. This is an abbreviated page. Normally, you’d include all the required tags. The page includes a heading and the start of a table. The tag processes each of the entries in the file. The file then builds the rows and data cells for the table. The tag retrieves the data values of the , , and elements. Some browsers encounter problems using the example from the local drive. For example, Chrome displays a blank page when you access Customers2.XML from the local drive. To test this technique in a way that works for most browsers, copy the files to your web server and then access the XML file from the web server.

View Article
page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
page 10
page 11
page 12
page 13
page 14
page 15
page 16
page 17
page 18
page 19
page 20
page 21
page 22
page 23
page 24
page 25
page 26
page 27

Quick Links

  • About For Dummies
  • Contact Us
  • Activate Online Content

Connect

About Dummies

Dummies has always stood for taking on complex concepts and making them easy to understand. Dummies helps everyone be more knowledgeable and confident in applying what they know. Whether it's to pass that big test, qualify for that big promotion or even master that cooking technique; people who rely on dummies, rely on it to learn the critical skills and relevant information necessary for success.

Copyright @ 2000-2024 by John Wiley & Sons, Inc., or related companies. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.

Terms of Use
Privacy Policy
Cookies Settings
Do Not Sell My Personal Info - CA Only