{"id":8246,"date":"2026-01-13T13:15:14","date_gmt":"2026-01-13T18:15:14","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=8246"},"modified":"2026-01-13T13:15:15","modified_gmt":"2026-01-13T18:15:15","slug":"simulating-crop-marks","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/simulating-crop-marks\/","title":{"rendered":"Simulating Crop Marks"},"content":{"rendered":"\n<p>This is weird, but: I had a dream where I was thinking about crop marks. What are crop marks? They were pretty damn important in my print design and digital prepress days. Designers would hang parts of the design <em>off the edge of the document<\/em> and the expectation is that the ink literally goes to the edge of the paper when printed. Printers can&#8217;t actually print to the edge of the paper though (it would be messy!) so instead, the use a <em>little bit bigger paper<\/em>, <strong>crop marks<\/strong> are added, and the design is printed a bit outside the crop marks. Then the final piece is literally <em>cut<\/em> at those marks, making the design hit the edges as intended.<\/p>\n\n\n\n<p>Design software like InDesign can output files destined for printing this way with these marks. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"531\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.06.35%402x.png?resize=1024%2C531&#038;ssl=1\" alt=\"Screenshot of Adobe InDesign 2026 interface showing export settings for PDF, including options for printer's marks like crop marks, bleed marks, registration marks, and color bars.\" class=\"wp-image-8248\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.06.35%402x.png?resize=1024%2C531&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.06.35%402x.png?resize=300%2C156&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.06.35%402x.png?resize=768%2C398&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.06.35%402x.png?resize=1536%2C797&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.06.35%402x.png?w=1824&amp;ssl=1 1824w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>Then the PDF will be a bit bigger than the designed sheet size and have these marks:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"695\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.07.41%402x.png?resize=1024%2C695&#038;ssl=1\" alt=\"A screenshot of a PDF document showing crop marks in the corner and a large pink shape filling the page.\" class=\"wp-image-8249\" style=\"aspect-ratio:1.473401485460575;width:638px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.07.41%402x.png?resize=1024%2C695&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.07.41%402x.png?resize=300%2C204&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.07.41%402x.png?resize=768%2C521&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/CleanShot-2026-01-12-at-16.07.41%402x.png?w=1126&amp;ssl=1 1126w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>Imagine thousands of printed pages like this all stacked up. The print shop binderies I worked at would have big ol&#8217; cutter machines that would cut the stack of paper <em>right at the crop marks.<\/em> That&#8217;s the point of the crop marks, literally knowing exactly where to cut the paper. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"599\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/40945-Baum_PM55A_Paper_Cutter_1001180313001.jpg?resize=900%2C599&#038;ssl=1\" alt=\"A cutting machine used in print shops, labeled 'BAUM-PM55', with a steel cutting blade and control panel.\" class=\"wp-image-8250\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/40945-Baum_PM55A_Paper_Cutter_1001180313001.jpg?w=900&amp;ssl=1 900w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/40945-Baum_PM55A_Paper_Cutter_1001180313001.jpg?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/40945-Baum_PM55A_Paper_Cutter_1001180313001.jpg?resize=768%2C511&amp;ssl=1 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group learn-more\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>Have you ever heard the term <strong>&#8220;bleed&#8221;<\/strong> in web design? <\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>For example&#8230;<\/summary>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"1024\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-12-at-4.15.36-PM.png?resize=940%2C1024&#038;ssl=1\" alt=\"\" class=\"wp-image-8251\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-12-at-4.15.36-PM.png?resize=940%2C1024&amp;ssl=1 940w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-12-at-4.15.36-PM.png?resize=275%2C300&amp;ssl=1 275w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-12-at-4.15.36-PM.png?resize=768%2C837&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-12-at-4.15.36-PM.png?resize=1410%2C1536&amp;ssl=1 1410w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-12-at-4.15.36-PM.png?w=1652&amp;ssl=1 1652w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p><\/p>\n<\/details>\n\n\n\n<p>This comes directly from print design. It&#8217;s the area <em>outside<\/em> the crop marks. When a part of design has <em>bleed<\/em> it means there are elements of the design that are pulled out into the area that gets cut away. So on the web that means an element of the design touches the edge of the viewport.<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?resize=1024%2C576&#038;ssl=1\" alt=\"Diagram illustrating crop marks, bleed, slug, page edge (trim), and margins in print design.\" class=\"wp-image-8259\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?w=1800&amp;ssl=1 1800w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>In my dream I was thinking about how they looked and how I could add them to a website, just for the aesthetics of it. Could be a worse dream, I guess. It was strong enough of a dream that I woke up and actually felt compelled to do it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Crop Marks on the Web<\/h2>\n\n\n\n<p>To be clear, there is no reason to do this on the web. I&#8217;m just thinking it&#8217;s a neat print design throwback and aesthetic thing. Like color bars or registration marks. <\/p>\n\n\n\n<p>The trick is that there are <em>eight<\/em> of these little lines. Certainly, we could add eight <code>&lt;div&gt;<\/code>s to the page and fix position them and that would do it. But my head always says: this is <em>entirely<\/em> a visual design thing that has nothing to do with the content of the page. So don&#8217;t clutter the HTML!<\/p>\n\n\n\n<p>We can get <em>four<\/em> elements &#8220;for free&#8221; on any given page without touching any HTML:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">html<\/span><span class=\"hljs-selector-pseudo\">::before<\/span> {}\n<span class=\"hljs-selector-tag\">html<\/span><span class=\"hljs-selector-pseudo\">::after<\/span> {}\n<span class=\"hljs-selector-tag\">body<\/span><span class=\"hljs-selector-pseudo\">::before<\/span> {}\n<span class=\"hljs-selector-tag\">body<\/span><span class=\"hljs-selector-pseudo\">::after<\/span> {}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>So if we&#8217;re able to draw two marks with each of those, we should be able to pull this off. Let&#8217;s start by drawing boxes. <\/p>\n\n\n\n<p>We can position a &#8220;bar&#8221; on each edge like so:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_019bb4bc-6716-7498-ba3a-1ff0a7dc327c\" src=\"\/\/codepen.io\/editor\/anon\/embed\/019bb4bc-6716-7498-ba3a-1ff0a7dc327c?height=450&amp;theme-id=1&amp;slug-hash=019bb4bc-6716-7498-ba3a-1ff0a7dc327c&amp;default-tab=css,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed 019bb4bc-6716-7498-ba3a-1ff0a7dc327c\" title=\"CodePen Embed 019bb4bc-6716-7498-ba3a-1ff0a7dc327c\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>But we don&#8217;t have to make these full color background bars, we could make them lines instead.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_019bb4c2-454f-733d-91f7-09b033ea31d0\" src=\"\/\/codepen.io\/editor\/anon\/embed\/019bb4c2-454f-733d-91f7-09b033ea31d0?height=450&amp;theme-id=1&amp;slug-hash=019bb4c2-454f-733d-91f7-09b033ea31d0&amp;default-tab=css,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed 019bb4c2-454f-733d-91f7-09b033ea31d0\" title=\"CodePen Embed 019bb4c2-454f-733d-91f7-09b033ea31d0\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"has-small-font-size\">I tossed <a href=\"https:\/\/codepen.github.io\/slideVars\/\">slideVars<\/a> in there to play with the values a little. <\/p>\n\n\n\n<p>But we also don&#8217;t want <em>full<\/em> lines, we want a little line at the top and bottom. We can do this by using <code>linear-gradient()<\/code> with hard color stops. The big idea is like: <em>draw a little transparent line, <strong>then a solid mark<\/strong>, then a long transparent line, <strong>then a solid mark<\/strong>, then a little transparent line.<\/em><\/p>\n\n\n\n<p>If that was ASCII it would be like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">|---<strong>===<\/strong>----------------------<strong>===<\/strong>---|<\/pre>\n\n\n\n<p>(lolz)<\/p>\n\n\n\n<p>Translated into CSS it&#8217;s like: <\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-comment\">\/* horizontal line *\/<\/span>\n<span class=\"hljs-selector-tag\">html<\/span><span class=\"hljs-selector-pseudo\">::before<\/span> {\n  <span class=\"hljs-attribute\">content<\/span>: <span class=\"hljs-string\">\"\"<\/span>;\n  <span class=\"hljs-attribute\">left<\/span>: <span class=\"hljs-number\">0<\/span>;\n  <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">1px<\/span>;\n  <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100%<\/span>;\n  <span class=\"hljs-attribute\">background<\/span>: <span class=\"hljs-built_in\">linear-gradient<\/span>(\n    to right,\n    transparent\n       <span class=\"hljs-number\">0<\/span>\n       <span class=\"hljs-number\">20px<\/span>,\n    black\n       <span class=\"hljs-number\">20px<\/span>\n       <span class=\"hljs-number\">40px<\/span>,\n    transparent\n       <span class=\"hljs-number\">40px<\/span>\n       calc(<span class=\"hljs-number\">100%<\/span> - <span class=\"hljs-number\">40px<\/span>),\n    black\n       <span class=\"hljs-built_in\">calc<\/span>(<span class=\"hljs-number\">100%<\/span> - <span class=\"hljs-number\">40px<\/span>),\n       <span class=\"hljs-built_in\">calc<\/span>(<span class=\"hljs-number\">100%<\/span> - <span class=\"hljs-number\">20px<\/span>),\n    transparent\n       <span class=\"hljs-built_in\">calc<\/span>(<span class=\"hljs-number\">100%<\/span> - <span class=\"hljs-number\">20px<\/span>)\n  );\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If I abstract that out into custom properties and position the marks like real crop marks, we get:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_019bb52f-9c72-71f8-9458-e533acb0d2c9\" src=\"\/\/codepen.io\/editor\/anon\/embed\/019bb52f-9c72-71f8-9458-e533acb0d2c9?height=450&amp;theme-id=1&amp;slug-hash=019bb52f-9c72-71f8-9458-e533acb0d2c9&amp;default-tab=css,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed 019bb52f-9c72-71f8-9458-e533acb0d2c9\" title=\"CodePen Embed 019bb52f-9c72-71f8-9458-e533acb0d2c9\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>I put a less-fancy version of these crop marks into this more fleshed out design below, then made the areas outside the crop marks have a white partially transparent fill, showing off how perhaps that&#8217;s the part of the design that would be cut away.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_019b50da-ec77-7cb4-b666-f6a4aa79224f\" src=\"\/\/codepen.io\/editor\/anon\/embed\/019b50da-ec77-7cb4-b666-f6a4aa79224f?height=450&amp;theme-id=1&amp;slug-hash=019b50da-ec77-7cb4-b666-f6a4aa79224f&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed 019b50da-ec77-7cb4-b666-f6a4aa79224f\" title=\"CodePen Embed 019b50da-ec77-7cb4-b666-f6a4aa79224f\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>WELL THAT WAS FUN.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Crop marks are an idea that comes from the print design world. Design in the bleed area will be cut away by giant cutter machines, and that bleed area is designated by the crop marks. We can do it on the web too, just for kicks.<\/p>\n","protected":false},"author":1,"featured_media":8259,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[7,436,318],"class_list":["post-8246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-post","tag-css","tag-print","tag-pseudo-elements"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/160359937581220.jpg?fit=1800%2C1012&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/8246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=8246"}],"version-history":[{"count":10,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/8246\/revisions"}],"predecessor-version":[{"id":8266,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/8246\/revisions\/8266"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/8259"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=8246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=8246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=8246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}