diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2021-06-29 09:50:40 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2021-06-29 09:50:40 -0400 |
| commit | 342d70ecdee87c6cdca4bf7ca15d143ff400019f (patch) | |
| tree | f4250be98daea91ebbd2e68b18755e7478a6818d /html.html | |
| parent | 825282fea9102326ad2538e4a98329fbd38c899b (diff) | |
cleanup for publication
Diffstat (limited to 'html.html')
| -rw-r--r-- | html.html | 81 |
1 files changed, 31 insertions, 50 deletions
@@ -49,7 +49,7 @@ Note how this HTML file appears as a webpage: -<table> +<table class=cnp> <tr> <td> <pre><code><!DOCTYPE html> @@ -70,7 +70,7 @@ multiple lines. Observe if we add lines to the end of this file: </p> -<table> +<table class=cnp> <tr> <td> <pre><code><!DOCTYPE html> @@ -116,7 +116,7 @@ Heading tags are for your page's title and section headings in the document: </ul> -<table> +<table class=cnp> <tr> <td> <pre><code><h1>This is a top-level heading.</h1> @@ -149,69 +149,50 @@ If we use these heading tags, when we clear CSS, we can easily style all <code>& to be the size and color and alignment we want. </p> -<<++>> -<<++>> -<<++>> - <h2>A look at a decent template</h2> +<h2>Text formatting</h2> - <p> - It's a good habit to include the same core things in every HTML page. - I have a template file that I use for this website that includes all the basics. - When I make a new page, I just copy the template and add the content. - Here is what the template looks like: - </p> -<code><pre><!DOCTYPE html> -<html lang=en> - <head> - <title><strong>Your page title</strong></title> - <meta charset="utf-8"/> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <link rel='stylesheet' type='text/css' href='style.css'> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel='alternate' type='application/rss+xml' title='<strong>Site Title</strong> RSS' href='/rss.xml'> - </head> -<body> - <header><h1><strong>Your page title</strong></h1></header> - - <nav></nav> - - <main> +<p> +HTML can also be used to do text formatting. +We can make bold, italic, underlined or struck through text with more HTML tags: +</p> - <strong>Put all your page content here in the <main> tag.</strong> +<table class=cnp> + <tr> + <td> +<pre><code><p>This is <b>bold text</b>.</p> - </main> +<p>This is <i>italic text</i>.</p> - <footer></footer> -</body> -</html></code></pre> +<p>This is <u>underlined</u>.</p> - <h3>The - </h3> +<p>This is <s>struck through</s>.</p></code></pre> + </td> + <td> + <img src="pix/html2-01.png" alt="formatted text"> + </td> + </tr> +</table> - <h3>HTML can be broken...</h3> + <h2>Semantic Tags</h2> <p> - HTML is interpreted by browsers very liberally. - If you make mistakes in HTML, browsers will do their best to be forgiving and try to figure out what you meant. + While <code><b></b></code> and <code><i></i></code> + do exist, it's actually better <em>not</em> to use them directly in text. </p> <p> - For example, paragraphs are formatted by the <code><p></code> tag and when the paragraph ends, - <code></p></code> should be included. - However, if you forget or neglect to include a <code></p></code> to close the tag, this isn't a big deal, as if your browser sees another <code><p></code> to start a new paragraph, it will consider the previous paragraphy closed and both paragraphs will be formatted correctly. - In fact, there are some people nowadays that only ever use the opening tag and never close them! + Try using <code><strong></strong></code> instead of <code><b></b></code> and <code><em></em></code> instead of <code><i></i></code>. + By default, they will look exactly the same. + You complain that they require more key presses, but it's thought to be a very bad idea to modify lower-level tags with CSS directly. </p> - <h3>...but not always.</h3> - <p> - That works fine with <code><p></code>, but for other tags like <code><b></code>, it won't work. - Your browser can't guess where you want the bolding to end, so if you fail to close a <code><b></code> with <code></b></code>, - the whole rest of your document will show up bold! + Note that some bold words on this site have <strong>different color for emphasis</strong>. + This is a setting set via CSS for all <code><strong></code> tags. + It would not be a good idea for us to use this for <code><b></code>, since there might be a non-colored situation we want to occasionally use it in. </p> - - <span class=next><a href="html2.html">Next: Text formatting in HTML</a></span> + <span class=next><a href="html2.html">Next: Images and Links in HTML</a></span> </main> <footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><li><a href="index.html"><img src="pix/chad.gif" alt="chad"></a></li><li><a href="rss.xml"><img src="pix/rss.svg" alt="RSS"></a></li><li><a href="pix/btc.png"><img src="pix/btc.svg" alt="BTC"></a></li><li><a href="pix/xmr.png"><img src="pix/xmr.svg" alt="XMR"></a></li><li><a href="https://github.com/lukesmithxyz/landchad"><img src="pix/git.svg" alt="Github"></a></footer> |
