Mindblown: a blog about philosophy.
-
HTML Page Structure
Below is a visualization of an HTML page structure: <html> <head> <title>Page title</title> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> <p>This is another paragraph.</p> </body> </html>
-
Web Browsers
The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them correctly. A browser does not display the HTML tags, but uses them to determine how to display the document:
-
What is an HTML Element?
An HTML element is defined by a start tag, some content, and an end tag: <tagname> Content goes here… </tagname> The HTML element is everything from the start tag to the end tag: <h1>My First Heading</h1> <p>My first paragraph.</p> Start tag Element content End tag <h1> My First Heading </h1> <p> My first paragraph. </p> <br> none none
-
What is HTML?
-
No More Types for Scripts and Links
You might add the type attribute to your link and script tags. 1 <link rel=”stylesheet” href=”path/to/stylesheet.css” type=”text/css” /> 2 <script type=”text/javascript” src=”path/to/script.js”></script> This is not necessary. It’s implied that both of these tags refer to stylesheets and scripts respectively. As such, we can remove the type attribute altogether. 1 <link rel=”stylesheet” href=”path/to/stylesheet.css” /> 2 <script src=”path/to/script.js”></script>
-
Table Rowspans Made Easy
If you have a cell that spans vertically to the bottom of the table, past rows that might vary in number or are too numerous to easily count, just give it a rowspan that you know is excessively high; in the example below, 99. Browser specification states that browsers shouldn’t create any extra rows. It doesn’t […]
-
HTML Accesskeys
HTML attribute <a href=”” accesskey=””></a> gives your clients the ability to set focus to your defined hyperlinks / values for your allotted definitions. As an example, a site might use this feature, select the Alt-h (Windows) or Cmd-h (Mac) keys simultaneously to set focus for this site’s home page; “h” equates to “home”. Select Alt-m / Cmd-m in […]
-
The HTML Title Tag
The HTML <title> element is designed to provide a short piece of text that should stand for the document in cases such as: Tips for page titles:
-
The spacer GIF trick
For really precise control over page layout, and if you haven’t yet got the hang of CSS positioning, you can’t beat the old spacer GIF trick. This involves using a 1 pixel x 1 pixel transparent GIF, which will be invisible in your Web pages, and using the width and height attributes to control the precise padding between page […]
-
Creating empty table cells
Sometimes you’ll want to create table cells (<td>s) with nothing in them; for example, when a particular row doesn’t have any data for one of its columns. Usually, the best way to create an empty table cell is with a non-breaking space, as follows: Don’t just use <td></td> as this will cause your tables to appear rather […]
Got any book recommendations?