How to Enhance Your Instructables Using HTML
by nodcah in Circuits > Computers
12721 Views, 237 Favorites, 0 Comments
How to Enhance Your Instructables Using HTML
Instructables are an awesome way to share your knowledge and learn from others. Sometimes, a lot of text in an Instructable can be intimidating, or an Instructable just doesn't look very interesting. To solve this, you can use HTML and CSS.
HTML is useful for organizing your instructable into sections (read more on Wikipedia).
This includes things like: lists, simple text formatting, links, tables, and much more.
CSS is used to make the HTML look appealing and easier to read (more info on Wikipedia).
This includes things like: spacing, color, font, alignment, backgrounds, and much more.
Thanks to theedisoneffect for suggesting the creation of this Instructable.
NOTE: Sorry mobile users, most of this stuff only works on a computer :-(
What You'll Need
There is only one requirement for this instructable: an Instructables account.
There are a few ways to get a pro account:
- Getting it gifted to you. Send someone else a pro membership!
- Earning one through a featured Instructable: Get started
Use this as encouragement to make an Instructable if you haven't already! =)
Putting Code Into Your Instructable
The code box with the Arduino blink example sketch:
/* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
This box is formatted using the pre tag to: keep whitespace as is, use the same font Arduino does, set the width to 600px, set the height to 300px, make the font size 11px, create a grey border, and create a light grey fill.
Tables
Tables are super useful as a materials organizer or to display data. HTML organizes tables using a variety of tags:
Tag | Description |
---|---|
<table> | Table: Defines the beginning and end of a table |
<tbody> | Table body: An optional tag to define the body of a table |
<tr> | Table row: Creates a new row in the table |
<th> | Table header: Defines the header of a column |
<td> | Table data: Defines a normal cell |
Example (with a bit of CSS to spice things up):
Part | Source |
---|---|
2x 10KΩ resistors | Sparkfun, RadioShack |
2x 220Ω resistors | |
2x 10-47µF capacitors | |
2x LEDs | |
2x PNP transistors |
~~ = This common part can be salvaged from almost anything
~~ = You can salvage this, or if it's bought, there will be leftovers
Forms
Linking Between Steps
In HTML, there is something called an anchor, which is a link that scrolls to a certain element on the screen. It searches the document for the ID you are looking for and scrolls to it for you!
Input | Output |
---|---|
<p id="hello">This is a paragraph with the id "hello."</p> | This is a paragraph with the id "hello." |
<a href="#hello" rel="nofollow">This link sends you to "#hello"</a> | This link sends you to "#hello" |
Note: Instructables' menu bar cuts off the top 100px of the page.
The most practical use for an anchor is to reference other steps within your (or someone else's) Instructable:
This scrolls to "#comment-list"
This scrolls to "#step10" of my Fingerprint Scanning Garage Door Opener Instructable
Organize Substeps
The fieldset tag is a great way to organize anything from materials to creating a code section at the bottom of a step.
For example:
Using the Premade Stylesheets or Bootstrap
There are many preformatted classes you are allowed to use on Instructables.com's stylesheets (here) or anything from Bootstrap v2.3.2 (documentation here).
Some of the useful classes:
Class Name | Use | Example |
---|---|---|
btn | Style text as a button | Button |
img-polaroid | Polaroid image | |
callout | To comment on something. I can't think of another use for this, but there are definitely more | Text More text |
How to define a class in HTML:
<p class="CLASSNAME">Styled text goes here</p>
Additionally, there is an added font for you to use:
Name of Font | How to use it |
---|---|
Complete In Him Pro | <p style="font-family:CompleteInHimPro;">Complete In Him Pro</p> |
HTML Gauge
If you've ever needed a gauge to show difficulty, cost, some sort of data, etc., this is what you're looking for!
Difficulty: e a s y ..
List of Supported HTML Tags
HTML has many tags, but only a few are allowed to be used in an Instructable. I have done my best to show all of the useful supported tags below, but if I missed any, be sure to let me know!
Input Tag | Output |
---|---|
<button> | |
<img> | |
<samp> | Sample computer output |
<font> | Warning: "Font" is an outdated tag But, this is the only way to color text on mobile |
<fieldset> | See step 6 |
<form>,<select>,<option> | See step 4 |
<pre> | See step 2 for a possible use |
<a href="URL"> | A link to my last Instructable See step 5 for another use |
<sup> | Normal text This text is superscripted |
<sub> | Normal text This text is subscripted |
<strong> or <b> | Normal text This text is strong (bolded) |
<em> or <i> | Normal text This text is emphasized (italicized) |
<u> | Normal text This text is underlined |
<blockquote> | Normal textThis text is in a blockquote |
<h1>, <h2>, ..., <h6> | h1h6 |
<code> | This can be used to show code (see step 2 for another way) |
<ul> |
|
<ol> |
|
<table>, <tr>, <th>, <td> | See step 3 |
<hr> | Some text above the horizontal rule Some text below the horizontal rule |
<span> | This can be used to style something or apply a class to text. But, a class must be defined (it can be one that doesn't exist yet) |
For more information about the tags you should check out w3schools. This gives information about all of the HTML tags and how to use them.
Styling With CSS
CSS is where stuff gets cool! You can do A LOT of different things with CSS, with only a very few being listed here.
CSS Code | Example | Description and Notes |
---|---|---|
cursor:move; | This text is styled | Changes the cursor's look |
color:red; | This text is styled | Changes the color of text Check out this page for predefined color names |
font-size:1.2em; | This text is styled | Sets the size of text Can be used in these formats |
font-family:Lucida Console; | This text is styled | Determines the font of text Click here for more fonts |
height:120px; width:120px; | This text is styled | Defines the dimensions of the element (background is outlined in black) |
padding:5px; | This text is styled | Leaves space around an element (background is outlined in black) |
overflow:auto; height: 10px; | This text is styled | Creates a scrollbar if the text extends beyond the defined height and/or width |
border:2px solid grey; | This text is styled | Creates a border More info about the border property here |
background-color:#C6D7DE; | This text is styled | Changes the background color |
text-align:center; | This text is styled | Aligns the text to the right, center, or left |
text-decoration:underline; | This text is styled | Underlines or overlines text |
text-shadow:2px 2px 1px red; | This text is styled | Creates a shadow based on the text More info on the text-shadow property here |
font-variant: small-caps; | This text is styled | Makes every character uppercase, but smaller. |
Using inline CSS:
<p style="CSS_CODE_HERE">Styled text here</p>
Example Instructable
This mini Instructable uses a few of the items you have learned. The steps are separated using multiple fieldset tags. The pictures are inserted using the img tag.
Downloads
Conclusion and References
Learning everything in this Instructable at once is almost impossible. This was created to inspire the use of HTML/CSS in your Instructable, and as a reference if you do use them.
Because there is so much to cover, I may have missed something or didn't explain something very well, so please ask questions or leave feedback!
References:
- W3schools HTML tag reference
- W3schools CSS property reference
- W3schools TryIt editor (try your code before putting it in an Instructable)
- Instructable.com's stylesheet
- Another stylesheet
Thanks for reading! =D