Skip to content

Instantly share code, notes, and snippets.

@marcelinaredocindo
marcelinaredocindo / index.html
Created December 14, 2025 14:12
Learn CSS - CSS Position Property
<main>
<div class="wrapper">
<article class="flow">
<h1>CSS Position Property</h1>
<figure class="callout">
<p>
Change the <code>position</code> style to see how the box behaves, both relative to its parent and the viewport.
For <code>position: sticky</code> and <code>position: fixed</code>, make sure you scroll to see the effect.
</p>
<p>
@marcelinaredocindo
marcelinaredocindo / index.html
Created December 14, 2025 14:10
Learn CSS - inline block
<div>
<span>These two elements</span> <span>are normal spans, that are <code>display: inline</code> by default</span>.
<p>This <span>span element</span>, inside a paragraph element is <code>display: inline-block</code>, so its top margin will no longer be ignored.
</div>
@marcelinaredocindo
marcelinaredocindo / index.html
Created December 14, 2025 14:07
Learn CSS - Multi column grid
<main>
<div class="wrapper flow">
<article class="flow">
<h1>Multi column grid</h1>
<figure class="callout">
<p>Each of the items share 1 of 8 portions of the remaining space equally with a consistent <code>1rem</code> gutter between each item.</p>
</figure>
<div class="my-element">
<div class="box">Item 1</div>
<div class="box">Item 2</div>
@marcelinaredocindo
marcelinaredocindo / index.html
Created December 2, 2025 03:08
Learn CSS - Units - Intro
<article>
<h1>Using a <code>ch</code> unit to size text</h1>
<p>The <code>ch</code> unit allows you to control the size of text based on its actual contextual size—the width of a <code>0</code> character.
This means that if you set the max width of some text as <code>70ch</code>: regardless of the size of that text, you can always be sure that it will be at most, 70 characters wide. </p>
<p>Go ahead and change the font sizes and max widths of these elements in the CSS editor to see it working.</p>
</article>
@marcelinaredocindo
marcelinaredocindo / index.html
Created November 29, 2025 16:00
Learn CSS - Sizing - Misc Units
<div></div>
@marcelinaredocindo
marcelinaredocindo / index.html
Created November 29, 2025 16:00
Learn CSS - Sizing - Relative Units
<main>
<div>
This div is 10% of the viewport.
</div>
<p>This paragraph is limited to <code>60ch</code> which is the same width as 60 “0” characters in the rendered font.</p>
</main>
@marcelinaredocindo
marcelinaredocindo / index.html
Created November 29, 2025 15:59
Learn CSS - Sizing - Percentages 3
<div>
<p>The transform is calculated from the elements width, which is 50% of the container’s width.</p>
</div>
@marcelinaredocindo
marcelinaredocindo / index.html
Created November 29, 2025 15:59
Learn CSS - Sizing - Percentages 2
<div>
<p>Both top margin and left padding are 150px.</p>
</div>
@marcelinaredocindo
marcelinaredocindo / index.html
Created November 29, 2025 15:59
Learn CSS - Sizing - Percentages
<div>
<p>This p element is 50% of the div’s width, which is 150px.</p>
</div>