Mindblown: a blog about philosophy.
-
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…
-
Use tables for tabular data, CSS for layout
Tables have traditionally been used to lay out content on the page; however this was never their intended use. They’re really meant to be used for displaying tabular data (such as data from a spreadsheet, for example). With the positioning capabilities of CSS, you can build HTML pages that just contain the page content, and…
-
Non-breaking spaces in HTML
Sometimes you want to keep certain words together so that they’re not split over two lines. The way to do this is with a non-breaking space. In HTML the markup for a non-breaking space looks like this: For example, the following words will wrap if they fall at the end of a line: while this example,…
Got any book recommendations?