parent
7a51e7b931
commit
db5ce093c6
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Padding And Margin | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <article> <header> <h1 class="post-title">Padding And Margin</h1> <time datetime="20-01-22" class="post-date">Wednesday, January 22 2020</time> </header> <hr> <p>Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.</p> <p>Here is an image from the World Wide Web Consortium (W3C) who sets the standards for the web.</p> <p><img src="/assets/img/w3c-padding-margin.png" alt="The W3C standard for padding, margin, borders and width. Width encompases the inner element + padding; the border then encompases it. The margin is the space beyond the border and in between other elements." title="W3C border, padding, margin standard."/></p> <p>Now although this image shows all the different types of spacing as equal, the majority of the time these will mostly be padding (inner) and margin (outer). Padding is the inner space between the element and its border; margin is the outer space between two different elements.</p> <p>Within the margin the user is unable to press any links or execute any javascript code. It is <em>empty</em> space. If each <code class="language-plaintext highlighter-rouge"><link></code> on your navigation bar has 10 pixels of margin, then there would be 20 pixels in between each <code class="language-plaintext highlighter-rouge"><link></code> that would <em>not</em> be clickable by the user.</p> <p>If you have <code class="language-plaintext highlighter-rouge"><link></code>s on your navigation bar with <em>padding</em> set to 20 pixels, however, then there will be 20 pixels on each side of the <code class="language-plaintext highlighter-rouge"><link></code> text where the user <em>is</em> able to click.</p> <p>If that part is confusing, try thinking about it in terms of whether <code class="language-plaintext highlighter-rouge">background-color</code> would apply.</p> <table> <thead> <tr> <th>Attribute</th> <th><strong>Padding</strong></th> <th><strong>Margin</strong></th> </tr> </thead> <tbody> <tr> <td>Spacing</td> <td>within element</td> <td>between elements</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">background-color</code> applies</td> <td>Yes</td> <td>No</td> </tr> </tbody> </table> <p>In summary:</p> <ul> <li><strong>Padding</strong>: the space within a tag which is still part of the same tag. <code class="language-plaintext highlighter-rouge">background-color</code> applies.</li> <li><strong>Margin</strong>: the space in between two seperate tags. <code class="language-plaintext highlighter-rouge">background-color</code> does not apply; it is empty space.</li> <li><strong>Border</strong>: the space in between the two; it surrounds the padding, but is not the margin. It looks nice somtimes, but it has no non-visual function. <code class="language-plaintext highlighter-rouge">background-color</code> does not apply.</li> </ul> <p>I hope this covers the basics of margin and padding! Happy coding!</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/01/22/padding-and-margin.html">beta.tait.tech</a>. </footer> </div> </body> </html>
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Padding And Margin | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <article> <header> <h1 class="post-title">Padding And Margin</h1> <time datetime="20-01-22" class="post-date">Wednesday, January 22 2020</time> </header> <hr> <p>Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.</p> <p>Here is an image from the World Wide Web Consortium (W3C) who sets the standards for the web.</p> <p><img src="/assets/img/w3c-padding-margin.png" alt="The W3C standard for padding, margin, borders and width. Width encompases the inner element + padding; the border then encompases it. The margin is the space beyond the border and in between other elements." title="W3C border, padding, margin standard."/></p> <p>Now although this image shows all the different types of spacing as equal, the majority of the time these will mostly be padding (inner) and margin (outer). Padding is the inner space between the element and its border; margin is the outer space between two different elements.</p> <p>Within the margin the user is unable to press any links or execute any javascript code. It is <em>empty</em> space. If each <code class="language-plaintext highlighter-rouge"><link></code> on your navigation bar has 10 pixels of margin, then there would be 20 pixels in between each <code class="language-plaintext highlighter-rouge"><link></code> that would <em>not</em> be clickable by the user.</p> <p>If you have <code class="language-plaintext highlighter-rouge"><link></code>s on your navigation bar with <em>padding</em> set to 20 pixels, however, then there will be 20 pixels on each side of the <code class="language-plaintext highlighter-rouge"><link></code> text where the user <em>is</em> able to click.</p> <p>If that part is confusing, try thinking about it in terms of whether <code class="language-plaintext highlighter-rouge">background-color</code> would apply.</p> <table> <thead> <tr> <th>Attribute</th> <th><strong>Padding</strong></th> <th><strong>Margin</strong></th> </tr> </thead> <tbody> <tr> <td>Spacing</td> <td>within element</td> <td>between elements</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">background-color</code> applies</td> <td>Yes</td> <td>No</td> </tr> </tbody> </table> <p>In summary:</p> <ul> <li><strong>Padding</strong>: the space within a tag which is still part of the same tag. <code class="language-plaintext highlighter-rouge">background-color</code> applies.</li> <li><strong>Margin</strong>: the space in between two seperate tags. <code class="language-plaintext highlighter-rouge">background-color</code> does not apply; it is empty space.</li> <li><strong>Border</strong>: the space in between the two; it surrounds the padding, but is not the margin. It looks nice somtimes, but it has no non-visual function. <code class="language-plaintext highlighter-rouge">background-color</code> does not apply.</li> </ul> <p>I hope this covers the basics of margin and padding! Happy coding!</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/01/22/padding-and-margin/">beta.tait.tech</a>. </footer> </div> </body> </html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Site Update | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <article> <header> <h1 class="post-title">Site Update</h1> <time datetime="20-06-04" class="post-date">Thursday, June 04 2020</time> </header> <hr> <p>I updated the site with some easier to identify information about me and my projects :)</p> <p>Also, Clue has been delayed due to my partner in crime on the project wokring too many hours.</p> <p>I also posted a new project called <em><a href="https://github.com/TTWNO/caesar-cipher">Caesar Cipher</a></em> in C. It will be an intermediate example of how to use build systems like <code class="language-plaintext highlighter-rouge">make</code>.</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/06/04/site-update.html">beta.tait.tech</a>. </footer> </div> </body> </html>
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Site Update | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <article> <header> <h1 class="post-title">Site Update</h1> <time datetime="20-06-04" class="post-date">Thursday, June 04 2020</time> </header> <hr> <p>I updated the site with some easier to identify information about me and my projects :)</p> <p>Also, Clue has been delayed due to my partner in crime on the project wokring too many hours.</p> <p>I also posted a new project called <em><a href="https://github.com/TTWNO/caesar-cipher">Caesar Cipher</a></em> in C. It will be an intermediate example of how to use build systems like <code class="language-plaintext highlighter-rouge">make</code>.</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/06/04/site-update/">beta.tait.tech</a>. </footer> </div> </body> </html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>/2020/01/22/padding-and-margin.html</loc> <lastmod>2020-01-22T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/01/26/rsa1.html</loc> <lastmod>2020-01-26T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/02/19/rsa2.html</loc> <lastmod>2020-02-19T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/04/02/rsa3.html</loc> <lastmod>2020-04-02T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/06/rsa4.html</loc> <lastmod>2020-04-06T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/12/nas1.html</loc> <lastmod>2020-04-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/21/rfi.html</loc> <lastmod>2020-04-21T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/25/xss.html</loc> <lastmod>2020-04-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/01/nginx-socket-io-projects.html</loc> <lastmod>2020-05-01T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/19/clue-announcement.html</loc> <lastmod>2020-05-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/04/site-update.html</loc> <lastmod>2020-06-04T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/25/tmux-minecraft.html</loc> <lastmod>2020-06-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/12/independence.html</loc> <lastmod>2020-07-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/19/multicraft-php-gentoo.html</loc> <lastmod>2020-07-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/30/canadian-parliament.html</loc> <lastmod>2020-07-30T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/15/openbsd1.html</loc> <lastmod>2020-08-15T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/18/django-deployment.html</loc> <lastmod>2020-08-18T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/09/lamegames.html</loc> <lastmod>2020-09-09T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/12/minesweeper.html</loc> <lastmod>2020-09-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/10/26/curiosity.html</loc> <lastmod>2020-10-26T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/11/15/nas2.html</loc> <lastmod>2020-11-15T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/01/pacaur-rpi.html</loc> <lastmod>2020-12-01T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/14/orca-raspberry-pi-manjaro.html</loc> <lastmod>2020-12-14T00:00:00-07:00</lastmod> </url> <url> <loc>/2020-04-27-quiz-your-friends-xss.html</loc> </url> <url> <loc>/blog/</loc> </url> <url> <loc>/tests/live-label/</loc> </url> <url> <loc>/tests/chess/</loc> </url> <url> <loc>/</loc> </url> <url> <loc>/tutoring/</loc> </url> <url> <loc>/cover-letters/bloombase/</loc> </url> <url> <loc>/resume/</loc> </url> <url> <loc>/links/</loc> </url> <url> <loc>/cover-letter-vcc/</loc> </url> <url> <loc>/contact/</loc> </url> <url> <loc>/about/</loc> </url> <url> <loc>/scholarships/2020/cnib/</loc> </url> <url> <loc>/test.html</loc> </url> <url> <loc>/test2.html</loc> </url> </urlset>
|
||||
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>/2020/01/22/padding-and-margin/</loc> <lastmod>2020-01-22T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/01/26/rsa1/</loc> <lastmod>2020-01-26T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/02/19/rsa2/</loc> <lastmod>2020-02-19T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/04/02/rsa3/</loc> <lastmod>2020-04-02T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/06/rsa4/</loc> <lastmod>2020-04-06T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/12/nas1/</loc> <lastmod>2020-04-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/21/rfi/</loc> <lastmod>2020-04-21T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/25/xss/</loc> <lastmod>2020-04-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/01/nginx-socket-io-projects/</loc> <lastmod>2020-05-01T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/19/clue-announcement/</loc> <lastmod>2020-05-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/04/site-update/</loc> <lastmod>2020-06-04T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/25/tmux-minecraft/</loc> <lastmod>2020-06-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/12/independence/</loc> <lastmod>2020-07-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/19/multicraft-php-gentoo/</loc> <lastmod>2020-07-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/30/canadian-parliament/</loc> <lastmod>2020-07-30T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/15/openbsd1/</loc> <lastmod>2020-08-15T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/18/django-deployment/</loc> <lastmod>2020-08-18T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/09/lamegames/</loc> <lastmod>2020-09-09T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/12/minesweeper/</loc> <lastmod>2020-09-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/10/26/curiosity/</loc> <lastmod>2020-10-26T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/11/15/nas2/</loc> <lastmod>2020-11-15T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/01/pacaur-rpi/</loc> <lastmod>2020-12-01T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/14/orca-raspberry-pi-manjaro/</loc> <lastmod>2020-12-14T00:00:00-07:00</lastmod> </url> <url> <loc>/2020-04-27-quiz-your-friends-xss/</loc> </url> <url> <loc>/blog/</loc> </url> <url> <loc>/tests/live-label/</loc> </url> <url> <loc>/tests/chess/</loc> </url> <url> <loc>/</loc> </url> <url> <loc>/tutoring/</loc> </url> <url> <loc>/cover-letters/bloombase/</loc> </url> <url> <loc>/resume/</loc> </url> <url> <loc>/links/</loc> </url> <url> <loc>/cover-letter-vcc/</loc> </url> <url> <loc>/contact/</loc> </url> <url> <loc>/about/</loc> </url> <url> <loc>/scholarships/2020/cnib/</loc> </url> <url> <loc>/test/</loc> </url> <url> <loc>/test2/</loc> </url> </urlset>
|
@ -1 +1 @@
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Alert Test | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <p>Paragraph #1</p> <p role="alert">Paragraph #2</p> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/test.html">beta.tait.tech</a>. </footer> </div> </body> </html>
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Alert Test | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <p>Paragraph #1</p> <p role="alert">Paragraph #2</p> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/test/">beta.tait.tech</a>. </footer> </div> </body> </html>
|
@ -1 +1 @@
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Test Alert blank | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <p>Paragraph #1</p> <p role="alert"></p> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/test2.html">beta.tait.tech</a>. </footer> </div> </body> </html>
|
||||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Test Alert blank | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">☰</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <p>Paragraph #1</p> <p role="alert"></p> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/test2/">beta.tait.tech</a>. </footer> </div> </body> </html>
|
Loading…
Reference in new issue