aboutsummaryrefslogtreecommitdiff
path: root/build/notice/index.html
diff options
context:
space:
mode:
authorBradley Taunt <bt@btxx.org>2024-06-08 13:43:37 -0400
committerBradley Taunt <bt@btxx.org>2024-06-08 13:43:37 -0400
commit16d28628aca9b2d356de31c319f5e7bc0f5b2b02 (patch)
tree11947abb71e38cbe75116871694a44c33d257763 /build/notice/index.html
parentdcfb172704f3afb68a30425029ec834be2883274 (diff)
Remove incorrectly generated files, fix up markdown articles
Diffstat (limited to 'build/notice/index.html')
-rw-r--r--build/notice/index.html22
1 files changed, 2 insertions, 20 deletions
diff --git a/build/notice/index.html b/build/notice/index.html
index b0aa333..609920f 100644
--- a/build/notice/index.html
+++ b/build/notice/index.html
@@ -3,11 +3,12 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="color-scheme" content="dark light">
<link rel="icon" href="data:,">
<title>RE: Creating a Simple HTML/CSS Notice Box</title>
<link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" />
<link href="/rss.xml" type="application/rss+xml" rel="alternate" title="RSS feed for blog posts" />
-<style>*{box-sizing:border-box;}body{font-family:sans-serif;line-height:1.33;margin:0 auto;max-width:650px;padding:1rem;}img{max-width:100%;}pre{border:1px solid;overflow:auto;padding:5px;}table{text-align:left;width:100%;}.footnotes{font-size:90%;}</style>
+<style>*{box-sizing:border-box;}body{font-family:sans-serif;line-height:1.33;margin:0 auto;max-width:650px;padding:1rem;}blockquote{background:rgba(0,0,0,0.1);border-left:4px solid;padding-left:5px;}img{max-width:100%;}pre{border:1px solid;overflow:auto;padding:5px;}table{text-align:left;width:100%;}.footnotes{font-size:90%;}</style>
</head>
<nav>
@@ -16,27 +17,18 @@
<main>
<h1 id="re-creating-a-simple-htmlcss-notice-box">RE: Creating a Simple HTML&#47;CSS Notice Box</h1>
-
<p>2022-09-22</p>
-
<p>I recently read Kev Quirk&#8217;s post, <a href="https://kevquirk.com/how-to-create-a-simple-html-css-notice-box/">How to Create a Simple HTML&#47;CSS Notice Box</a> and loved the simplicity of it. I&#8217;m a sucker for using pseudo elements in creative ways but still managing to make them useful. Of course, this got me thinking as to whether or not the same style of box could be achieved <em>without</em> the use of static, pseudo elements&#8230;</p>
-
<h2 id="bad-semantics">Bad Semantics</h2>
-
<p>I need to make it clear right away: <strong>these implementations are not semantic</strong>. They are valid HTML, but I am technically using these tags incorrectly. <em>You have been warned!</em></p>
-
<h2 id="setting-fieldsets">Setting Fieldsets</h2>
-
<p>The first approach is to wrap everything inside HTML <code>fieldset</code> tags:</p>
-
<pre><code>&#60;fieldset&#62;
&#60;legend&#62;Notice&#60;&#47;legend&#62;
&#60;p&#62;Lorem ipsum, dolor sit amet consectetur adipisicing elit. Totam nihil velit vitae sed beatae earum assumenda deleniti, inventore repellendus, sequi distinctio delectus porro explicabo quidem hic quo quasi voluptas temporibus.&#60;&#47;p&#62;
&#60;&#47;fieldset&#62;
</code></pre>
-
<p>Then you can include minor styling to closely match the design of Kev&#8217;s notice box:</p>
-
<pre><code>fieldset {
border: 3px solid;
font-family: sans-serif;
@@ -55,19 +47,14 @@ fieldset legend {
text-transform: uppercase;
}
</code></pre>
-
<h2 id="the-devil-is-in-the-details">The Devil is in the Details</h2>
-
<p>The other option is utilizing the HTML <code>details</code> tag:</p>
-
<pre><code>&#60;details open&#62;
&#60;summary&#62;Notice&#60;&#47;summary&#62;
&#60;p&#62;Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda sequi esse reprehenderit facilis aperiam labore optio minus doloremque nesciunt! Voluptatem esse tempore asperiores recusandae rerum facere, reiciendis officia repudiandae similique?&#60;&#47;p&#62;
&#60;&#47;details&#62;
</code></pre>
-
<p>You&#8217;ll obviously want to include the <code>open</code> attribute to avoid users needing to toggle the content manually (unless that is your desired UX). Then add similar styling options to match the <code>fieldset</code> example:</p>
-
<pre><code>details {
border: 3px solid;
font-family: sans-serif;
@@ -83,9 +70,7 @@ details summary {
text-transform: uppercase;
}
</code></pre>
-
<p>Important to note: you can hide the default &#8220;arrow toggle&#8221; on <code>summary</code> elements by including the following:</p>
-
<pre><code>details &#62; summary {
list-style: none;
}
@@ -93,11 +78,8 @@ details &#62; summary::-webkit-details-marker {
display: none;
}
</code></pre>
-
<h2 id="seeing-is-believing">Seeing is Believing</h2>
-
<p>I&#8217;ve put together two versions of each implementation (one custom designed and one using default browser styling). You can check them out in the CodePen below:</p>
-
<p><a href="https://codepen.io/bradleytaunt/pen/jOxLdQP">Live CodePen Example</a></p>
<footer role="contentinfo">
<h2>Menu Navigation</h2>