{"id":17471,"date":"2019-06-25T23:18:50","date_gmt":"2019-06-25T15:18:50","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=17471"},"modified":"2025-04-24T17:07:14","modified_gmt":"2025-04-24T09:07:14","slug":"html5-fullscreen-api","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/","title":{"rendered":"How to Use HTML5 Fullscreen API"},"content":{"rendered":"<p>We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit <kbd>F11<\/kbd> key in Windows, while in OS X you can hit <kbd>Shift<\/kbd> + <kbd>Command<\/kbd> + <kbd>F<\/kbd>. However, there are times when we, as web developers, want to add a trigger on the webpage to perform the function rather than relying on those keys.<\/p>\n<p>In addition to providing several new elements, <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/series-html5-css3-tuts\/\">HTML5<\/a> also introduced a set of new APIs, including one we are going to discuss in this post: the <strong>Fullscreen API<\/strong>. This API allows us to put our website, or just a particular <strong>element<\/strong> on the webpage, into fullscreen mode (and vice versa) using the browser\u2019s native functionality.<\/p>\n<p>As far as implementation is concerned, this API would be <strong>useful particularly for videos, images, online games, and HTML\/CSS-based slide presentations<\/strong>.<\/p>\n<p>So, let\u2019s see how it works.<\/p>\n<p class=\"note\"><strong>Recommended Reading:<\/strong> <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/series-html5-css3-tuts\/\">More HTML5 \/ CSS3 Tutorials<\/a><\/p>\n<h2>Browser Support<\/h2>\n<p>At the time of writing, this API only works for Google Chrome, Safari, and Firefox. Similar to CSS3, the syntax is prefixed as it is still in an experimental stage.<\/p>\n<table>\n<thead>\n<tr>\n<th><strong>Webkit<\/strong><\/th>\n<th><strong>Firefox<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>webkitRequestFullScreen<\/code><\/td>\n<td><code>mozRequestFullScreen<\/code><\/td>\n<td>The method to send the webpage or specified element fullscreen.<\/td>\n<\/tr>\n<tr>\n<td><code>webkitCancelFullscreen<\/code><\/td>\n<td><code>mozCancelFullscreen<\/code><\/td>\n<td>The method to exit fullscreen mode.<\/td>\n<\/tr>\n<tr>\n<td><code>mozFullScreenElement<\/code><\/td>\n<td><code>webkitFullScreenElement<\/code><\/td>\n<td>The method to check whether the element is in fullscreen mode.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>It is worth noting that the Fullscreen API is subject to change in the future.<\/p>\n<h2>Usage Example<\/h2>\n<p>One of the best ways to learn something new is by example. In this post, we will run a simple project. The idea is to have an image and a button that will put the image fullscreen or change it back to normal view with a click.<\/p>\n<p><strong>HTML<\/strong><\/p>\n<p>Let\u2019s start with the HTML markup. We have a <code>&lt;div&gt;<\/code> element to wrap the image and a <code>&lt;span&gt;<\/code> element for the button.<\/p>\n<pre>\n&lt;div id=\"fullscreen\" class=\"html5-fullscreen-api\"&gt;\n  &lt;img src=\"img\/arokanddedes.jpg\"&gt;\n  &lt;span class=\"fs-button\"&gt;&lt;\/span&gt;\n&lt;\/div&gt;<\/pre>\n<p><strong>CSS<\/strong><\/p>\n<p>Then, we place the image at the center of the window and add a few decorative styles to make it look nicer.<\/p>\n<pre>\n.demo-wrapper {\n  width: 38%;\n  margin: 0 auto;\n}\n.html5-fullscreen-api {\n  position: relative;\n}\n.html5-fullscreen-api img {\n  max-width: 100%;\n  border: 10px solid #fff;\n  box-shadow: 0px 0px 50px #ccc;\n}\n.html5-fullscreen-api .fs-button {\n  z-index: 100;\n  display: inline-block;\n  width: 32px;\n  height: 32px;\n  position: absolute;\n  top: 10px;\n  right: 10px;\n  cursor: pointer;\n}<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg\" alt=\"Example image styles CSS\" width=\"500\" height=\"300\"><\/figure>\n<p>I decided to display the icon in the <code>&lt;span&gt;<\/code> element <a href=\"https:\/\/www.hongkiat.com\/blog\/pseudo-element-before-after\/\">using the <code>:after<\/code> pseudo-element<\/a>, so that later we can change the icon easily through CSS using the <code>content<\/code> attribute.<\/p>\n<pre>\n.html5-fullscreen-api .fs-button:after {\n  display: inline-block;\n  width: 100%;\n  height: 100%;\n  font-size: 32px;\n  font-family: 'ModernPictogramsNormal';\n  color: rgba(255,255,255,.5);\n  cursor: pointer;\n  content: \"v\";\n}\n.html5-fullscreen-api .fs-button:hover:after {\n  color: rgb(255,255,255);\n}<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/fullscreen-icon.jpg\" alt=\"Fullscreen icon example\" width=\"500\" height=\"300\"><\/figure>\n<p><strong>JavaScript<\/strong><\/p>\n<p>We will use jQuery to make the code a little leaner.<\/p>\n<p>As mentioned, we will send the image fullscreen upon a click. We wrap the function under the jQuery <code>.on<\/code> method.<\/p>\n<pre>\n$('.fs-button').on('click', function(){\n\n});<\/pre>\n<p>First, we check whether the element is already in fullscreen mode. If this condition returns true, we will execute <code>webkitCancelFullScreen<\/code> to return it to the normal view. Otherwise, we will turn it fullscreen using the <code>webkitRequestFullScreen<\/code> method, like so:<\/p>\n<pre>\n$('.fs-button').on('click', function(){\n  var elem = document.getElementById('fullscreen');\n  if(document.webkitFullscreenElement) {\n    document.webkitCancelFullScreen();\n  }\n  else {\n    elem.webkitRequestFullScreen();\n  };\n});<\/pre>\n<p>Click on the fullscreen icon, and our image will go fullscreen, as shown in the following screenshot.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/fullscreen-mode.jpg\" alt=\"Image in fullscreen mode\" width=\"500\" height=\"300\"><\/figure>\n<h2>Fullscreen CSS<\/h2>\n<p>Webkit (as well as Firefox) also provides a set of new pseudo-classes that allow us to add style rules when the element is in fullscreen mode. Say we want to change the background; we can write the style rules this way:<\/p>\n<pre>\n#fullscreen:-webkit-full-screen {\n  background-image: url('..\/img\/ios-linen.jpg');\n  width: 100%;\n}<\/pre>\n<p>Now, you should see the iOS linen texture in fullscreen mode.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/ios-linen-texture.jpg\" alt=\"Fullscreen iOS linen texture\" width=\"500\" height=\"300\"><\/figure>\n<p>That\u2019s it. You can head over to the demo page to see it in action. Since we do not specify the function with the Firefox syntax, this demo will only work in Webkit Browsers: Google Chrome and Safari.<\/p>\n<div class=\"button\">\n    <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/html5-fullscreen-api\/\">View Demo<\/a>\n    <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/html5-fullscreen-api\/\">Download<\/a>\n<\/div>\n<h2>Further References<\/h2>\n<ul>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/dvcs.w3.org\/hg\/fullscreen\/raw-file\/tip\/Overview.html\">Fullscreen API Draft<\/a> \u2014 W3C<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/DOM\/Using_fullscreen_mode\">Using Full Screen Mode<\/a> \u2014 MDN<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.sitepoint.com\/html5-full-screen-api\/\">HTML5 Fullscreen API<\/a> \u2014 Sitepoint<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command + F. However, there are times when we, as web developers, want to add a trigger on the webpage to perform the&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392],"tags":[506,2016],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use HTML5 Fullscreen API<\/title>\n<meta name=\"description\" content=\"We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command +\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use HTML5 Fullscreen API\" \/>\n<meta property=\"og:description\" content=\"We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command +\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-25T15:18:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T09:07:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Use HTML5 Fullscreen API\",\"datePublished\":\"2019-06-25T15:18:50+00:00\",\"dateModified\":\"2025-04-24T09:07:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/\"},\"wordCount\":550,\"commentCount\":10,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-fullscreen-api\\\/img-styles.jpg\",\"keywords\":[\"HTML\",\"HTML5 \\\/ CSS3 Tutorials\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/\",\"name\":\"How to Use HTML5 Fullscreen API\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-fullscreen-api\\\/img-styles.jpg\",\"datePublished\":\"2019-06-25T15:18:50+00:00\",\"dateModified\":\"2025-04-24T09:07:14+00:00\",\"description\":\"We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command +\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-fullscreen-api\\\/img-styles.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-fullscreen-api\\\/img-styles.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-fullscreen-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use HTML5 Fullscreen API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use HTML5 Fullscreen API","description":"We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command +","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/","og_locale":"en_US","og_type":"article","og_title":"How to Use HTML5 Fullscreen API","og_description":"We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command +","og_url":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2019-06-25T15:18:50+00:00","article_modified_time":"2025-04-24T09:07:14+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Use HTML5 Fullscreen API","datePublished":"2019-06-25T15:18:50+00:00","dateModified":"2025-04-24T09:07:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/"},"wordCount":550,"commentCount":10,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg","keywords":["HTML","HTML5 \/ CSS3 Tutorials"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/","url":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/","name":"How to Use HTML5 Fullscreen API","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg","datePublished":"2019-06-25T15:18:50+00:00","dateModified":"2025-04-24T09:07:14+00:00","description":"We have always been able to view a whole webpage in fullscreen mode. To do so, you can hit F11 key in Windows, while in OS X you can hit Shift + Command +","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-fullscreen-api\/img-styles.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/html5-fullscreen-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use HTML5 Fullscreen API"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-4xN","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/17471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=17471"}],"version-history":[{"count":5,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/17471\/revisions"}],"predecessor-version":[{"id":74097,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/17471\/revisions\/74097"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=17471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=17471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=17471"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=17471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}