Skip to main content

Posts

Showing posts with the label HTML

The Essential HTML Codes Everyone Should Know for the Web

Short answer: a handful of HTML tags cover almost everything you need to format text on the web, headings, paragraphs, bold and italic, links, images, and lists. Knowing these lets you write cleanly in blogs, forums, emails and anywhere HTML is accepted. Here are the essential codes with examples. Text structure <h1>Main heading</h1> <h2>Section heading</h2> <p>A paragraph of text.</p> <br> (a line break) Use one <h1> per page, then <h2> and <h3> for sections. Wrap paragraphs in <p> . Emphasis <strong>bold text</strong> <em>italic text</em> Use <strong> for bold and <em> for italic, they carry meaning (importance/emphasis), which is better than the purely visual <b> and <i> . Links <a href="https://example.com">Link text</a> Add target="_blank" rel="noopener" to open in a new tab safely: <a href="......

How to Link to a Specific Part of a Web Page

Short answer: The cleanest way today is a text fragment . Add #:~:text= plus the words you want to the end of a URL, and the browser scrolls to and highlights that exact text. In Chrome you can generate one automatically by right-clicking a selection and choosing "Copy Link to Highlight." I often want to send someone a long article but point them at one paragraph. The old annotation apps I used to recommend have faded, and browsers now do this natively, which is faster and needs no third-party service. What is a text fragment and how do I make one? A text fragment is a special piece you append to a URL that tells the browser which words to find and highlight. The format looks like this: https://example.com/article#:~:text=the%20exact%20phrase The easiest way to create one is not to type it by hand: In Chrome, Edge, or Safari , select the sentence you care about on the page. Right-click the selection. Choose Copy Link to Highlight (Chrome and Edge) or Copy Link wi...