{"id":38037,"date":"2019-09-16T21:39:04","date_gmt":"2019-09-16T13:39:04","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=38037"},"modified":"2019-09-14T22:07:45","modified_gmt":"2019-09-14T14:07:45","slug":"css-scroll-snap-points","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/","title":{"rendered":"An Introduction to CSS Scroll Snap Points"},"content":{"rendered":"<p>The <strong><a href=\"https:\/\/www.w3.org\/TR\/css-scroll-snap-1\/\" target=\"_blank\" rel=\"nofollow\">CSS Scroll Snap Module<\/a><\/strong> is a  web standard that gives us some control over <strong>scrolling on a web page<\/strong> so that we can make users scroll to certain parts of a page rather than to just anywhere on it.<\/p>\n<p><strong>Scrolling<\/strong> is one of the most performed actions on a website.  Browsers, over the years, have <strong>improved their scrolling performance<\/strong> to match users\u2019 agile finger strength. And, developers have <strong>used scrolling creatively<\/strong> to achieve a better or an out-of-the-box user experience.<\/p>\n<p>However, when it comes to the correlation between <strong>coding and scrolling<\/strong>, only JavaScript seemed to have any amount of control over the latter. This was so for a long period of time, but with the <strong>introduction of scroll snap points<\/strong>, CSS began to catch up.<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/web-design-scrolling\/\">15 Examples Of Scrolling Done Right In Website Designs<\/a><\/p>\n<h2>Scrolling without scroll snap points<\/h2>\n<p>Typically, we don\u2019t scroll very slow, especially on phones. The faster you scroll, the less control you have over <strong>where on the screen you\u2019ll end up<\/strong> when you stopped scrolling.<\/p>\n<p>Imagine you are scrolling through an array of product image on a website, or a gallery of photos, or online slides. What you\u2019d prefer in such applications is to <strong>see the whole product, photo, or slide<\/strong> every time you scroll. Not only a <em>part<\/em> of the product image, photo, or slide.<\/p>\n<p>For example, on the demo below you can see whenever the user stops scrolling, only <strong>about half of the image is visible<\/strong> at the bottom of the screen. However, most users would prefer to see the last image fully.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif\" alt=\"Scrolling without CSS snap points\" width=\"1224\" height=\"872\"><\/figure>\n<h2>Scrolling with scroll snap points<\/h2>\n<p>This is where we bring in <strong>CSS scroll snap points<\/strong>. The name is self-explanatory; it\u2019s a CSS standard that allows us to <strong>snap items into place<\/strong> when scrolling.<\/p>\n<p>There are <strong><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/CSS_Scroll_Snap_Points\" target=\"_blank\">five CSS properties<\/a><\/strong> that constitute this standard:<\/p>\n<ol>\n<li><code>scroll-snap-type<\/code><\/li>\n<li><code>scroll-snap-points-x<\/code><\/li>\n<li><code>scroll-snap-points-y<\/code><\/li>\n<li><code>scroll-snap-coordinate<\/code><\/li>\n<li><code>scroll-snap-destination<\/code><\/li>\n<\/ol>\n<h3>Browser support<\/h3>\n<p>The properties <strong>need <code>-webkit<\/code> and <code>-ms<\/code> prefixes<\/strong> for the relevant browsers. As of writing this article, CSS scroll snap is not supported in Chrome and Opera.<\/p>\n<p>Note that the last four properties are likely to be dropped by user agents in the near future. Instead, <strong>new properties<\/strong>, namely <code>scroll-snap-align<\/code>, <code>scroll-snap-margin<\/code>, and <code>scroll-snap-padding<\/code>, <strong>might be created<\/strong>, as defined in this <a target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/css-scroll-snap-1\/\" rel=\"nofollow\">specification<\/a>.<\/p>\n<p>However, they will <strong>have a similar purpose<\/strong> as the former properties. Currently, the former set of properties will work just fine.<\/p>\n<h3>Properties<\/h3>\n<p>You need to <strong>add the <code>scroll-snap-type<\/code> property to the scroll container<\/strong> (the container element whose children are overflowing while it\u2019s scrolled). It specifies the <strong>strictness of the snap action<\/strong>. It can take three values:<\/p>\n<ol>\n<li><strong><code>mandatory<\/code><\/strong> \u2013 when the scrolling is finished, the scrolling will <strong>snap at a relevant snap point<\/strong><\/li>\n<li><strong><code>proximity<\/code><\/strong> \u2013 less strict than <code>mandatory<\/code>; it will <strong>depend on the judgement of the <abbr title=\"User Agent\">UA<\/abbr><\/strong> whether the element will snap at a given snap point<\/li>\n<li><strong><code>none<\/code><\/strong> \u2013 no snapping is done<\/li>\n<\/ol>\n<p>The <strong><code>scroll-snap-points-x<\/code><\/strong> and <strong><code>scroll-snap-points-y<\/code><\/strong> properties <strong>belong to the scroll container<\/strong>, too. They refer to points on the x- and y-axis where the snap points will exist. Their value is <strong>given by the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/repeat\" target=\"_blank\"><code>repeat()<\/code><\/a> function<\/strong>. For instance, if you want to add snap points along the x-axis at the interval of <code>100px<\/code> you need to use the <code>scroll-snap-points-x: repeat(100px)<\/code> rule.<\/p>\n<p>The <strong><code>scroll-snap-destination<\/code><\/strong> property is also added to the scroll container. It <strong>defines a coordinate on the container<\/strong> where a snap destination lies. It is at this snap destination where the container\u2019s children will snap into place when scrolled.<\/p>\n<p>You can use the <strong><code>scroll-snap-coordinate<\/code><\/strong> property in conjunction with <code>scroll-snap-destination<\/code>. You need to add it to the container\u2019s child elements. It <strong>defines the coordinates of child elements<\/strong>, that will align with the destination coordinates of their scroll container when the user scrolls the screen.<\/p>\n<p>Note you don\u2019t have to use all the properties at once. <strong>Only <code>scroll-snap-type<\/code> is compulsory.<\/strong> Along with that, you can either define individual snap points or use the destination-coordinate combination.<\/p>\n<h3>Code example<\/h3>\n<p>Here is an example code snippet for a <strong>typical scroll container<\/strong>, with <strong>scrolling in vertical direction & some images inside<\/strong>. It outputs the demo you can find in the beginning of this post.<\/p>\n<pre>\r\n&lt;div&gt;\r\n  &lt;img src='Pizza.png' alt='pizza'&gt;\r\n  &lt;img src='Noodle.png' alt='noodle'&gt;\r\n  &lt;img src='Burger.png' alt='burger'&gt;\r\n  &lt;img src='Juice.png' alt='juice'&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<pre>\r\ndiv {\r\n  width: 300px;\r\n  height: 300px;\r\n  overflow: auto;\r\n  ...\r\n}\r\ndiv &gt; img {\r\n  width: 250px;\r\n  height: 150px;\r\n  ...\r\n}\r\n<\/pre>\n<p>Now, we <strong>add some snap points<\/strong> to the scroll container:<\/p>\n<pre>\r\ndiv {\r\n  width: 300px;\r\n  overflow: auto;\r\n  scroll-snap-points-y: repeat(150px);\r\n  scroll-snap-type: mandatory;\r\n}\r\n<\/pre>\n<p>Below, you can see how the output looks like with <strong>CSS snap points added<\/strong>. Notice whenever the scrolling stops while the bottom image is only partially visible, the <strong>full image appears<\/strong> after the scrollport snaps into a snapping point above it.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-2.gif\" alt=\"Scrolling without CSS snap points\" width=\"1312\" height=\"864\"><\/figure>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/scrolling-effects-js-libraries\/\">JavaScript Libraries for Cool Scrolling Effects<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of a page rather than to just anywhere on it. Scrolling is one of the most performed actions on a website. Browsers, over the years,&hellip;<\/p>\n","protected":false},"author":145,"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":[507,4501],"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.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>An Introduction to CSS Scroll Snap Points - Hongkiat<\/title>\n<meta name=\"description\" content=\"The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of\" \/>\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\/css-scroll-snap-points\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An Introduction to CSS Scroll Snap Points\" \/>\n<meta property=\"og:description\" content=\"The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/\" \/>\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-09-16T13:39:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif\" \/>\n<meta name=\"author\" content=\"Preethi Ranjit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Preethi Ranjit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/\"},\"author\":{\"name\":\"Preethi Ranjit\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e981676afae36d1ff5feb75094950ab3\"},\"headline\":\"An Introduction to CSS Scroll Snap Points\",\"datePublished\":\"2019-09-16T13:39:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/\"},\"wordCount\":720,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-scroll-snap-points\\\/css-scroll-snap-1.gif\",\"keywords\":[\"CSS\",\"CSS Tutorials\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/\",\"name\":\"An Introduction to CSS Scroll Snap Points - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-scroll-snap-points\\\/css-scroll-snap-1.gif\",\"datePublished\":\"2019-09-16T13:39:04+00:00\",\"description\":\"The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-scroll-snap-points\\\/css-scroll-snap-1.gif\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-scroll-snap-points\\\/css-scroll-snap-1.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-scroll-snap-points\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"An Introduction to CSS Scroll Snap Points\"}]},{\"@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\\\/e981676afae36d1ff5feb75094950ab3\",\"name\":\"Preethi Ranjit\",\"description\":\"A .NET developer with a JavaScript background, Preethi is expert in front-end coding, JavaScript, HTML, and CSS.\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/preethi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"An Introduction to CSS Scroll Snap Points - Hongkiat","description":"The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of","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\/css-scroll-snap-points\/","og_locale":"en_US","og_type":"article","og_title":"An Introduction to CSS Scroll Snap Points","og_description":"The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of","og_url":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2019-09-16T13:39:04+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif","type":"","width":"","height":""}],"author":"Preethi Ranjit","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Preethi Ranjit","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/"},"author":{"name":"Preethi Ranjit","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e981676afae36d1ff5feb75094950ab3"},"headline":"An Introduction to CSS Scroll Snap Points","datePublished":"2019-09-16T13:39:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/"},"wordCount":720,"commentCount":1,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif","keywords":["CSS","CSS Tutorials"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/","url":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/","name":"An Introduction to CSS Scroll Snap Points - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif","datePublished":"2019-09-16T13:39:04+00:00","description":"The CSS Scroll Snap Module is a web standard that gives us some control over scrolling on a web page so that we can make users scroll to certain parts of","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/css-scroll-snap-points\/css-scroll-snap-1.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/css-scroll-snap-points\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"An Introduction to CSS Scroll Snap Points"}]},{"@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\/e981676afae36d1ff5feb75094950ab3","name":"Preethi Ranjit","description":"A .NET developer with a JavaScript background, Preethi is expert in front-end coding, JavaScript, HTML, and CSS.","url":"https:\/\/www.hongkiat.com\/blog\/author\/preethi\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-9Tv","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/38037","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\/145"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=38037"}],"version-history":[{"count":2,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/38037\/revisions"}],"predecessor-version":[{"id":48701,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/38037\/revisions\/48701"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=38037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=38037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=38037"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=38037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}