{"id":55,"date":"2018-01-23T23:46:33","date_gmt":"2018-01-24T04:46:33","guid":{"rendered":"http:\/\/newmediaproduction.mynmi.net\/?page_id=55"},"modified":"2025-05-14T19:30:27","modified_gmt":"2025-05-14T19:30:27","slug":"linking-to-an-external-stylesheet","status":"publish","type":"page","link":"https:\/\/nmi.cool\/webdev\/linking-to-an-external-stylesheet\/","title":{"rendered":"Linking to an external stylesheet"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1707\" src=\"https:\/\/nmi.cool\/newmediaproduction\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1.jpg\" alt=\"Abstract photo of bright, colorful dots. \" class=\"wp-image-1151\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1.jpg 2560w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1-300x200.jpg 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1-1024x683.jpg 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1-768x512.jpg 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1-1536x1024.jpg 1536w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2020\/01\/thomas-evans-ofEZVY3nzus-unsplash-scaled-1-2048x1366.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><figcaption class=\"wp-element-caption\">Photo by&nbsp;<a href=\"https:\/\/unsplash.com\/@grfxman?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Thomas Evans<\/a>.<\/figcaption><\/figure>\n\n\n\n<p>The link for your external stylesheet must appear in the <code>&lt;head&gt;<\/code> element of your HTML document. The link element should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;link href=\"css\/style.css\" rel=\"stylesheet\"&gt;<\/code><\/pre>\n\n\n\n<p><strong>Note:<\/strong> The <code>href <\/code>value (&#8220;css\/style.css&#8221;) could be different depending on your file path structure and where your style.css file is saved. Need a refresher on file paths? Check out this previous lesson on <a href=\"https:\/\/nmi.cool\/webdev\/files-folders#filepaths\">file paths<\/a>. It could also be different if your CSS file is named something other than <code>style.css<\/code>. <strong>In other words, make sure that you update this value to reflect the actual file name and location of your CSS file!<\/strong><\/p>\n\n\n\n<p>It is best practice to put your css file in a css folder. That set up looks like this: <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"386\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.26.50\u202fPM-1024x386.png\" alt=\"CSS folder structure\" class=\"wp-image-6067\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.26.50\u202fPM-1024x386.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.26.50\u202fPM-300x113.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.26.50\u202fPM-768x289.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.26.50\u202fPM.png 1232w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>And the link to the stylesheet looks like this: <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"528\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.29.57\u202fPM-1024x528.png\" alt=\"\" class=\"wp-image-6069\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.29.57\u202fPM-1024x528.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.29.57\u202fPM-300x155.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.29.57\u202fPM-768x396.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-3.29.57\u202fPM.png 1370w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The link for your external stylesheet must appear in the &lt;head&gt; element of your HTML document. The link element should look like this: Note: The href value (&#8220;css\/style.css&#8221;) could be different depending on your file path structure and where your style.css file is saved. Need a refresher on file paths? Check out this previous lesson [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-55","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":3,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages\/55\/revisions"}],"predecessor-version":[{"id":6070,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages\/55\/revisions\/6070"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/media?parent=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}