Introduction: How to Enhance Your Instructables Using HTML

About: I am a master's student studying Electrical Engineering and an alumni of FIRST robotics. I also love to tinker on my own, which is mostly inspired by the amazing people on this website!

Instructables are an awesome way to share your knowledge and learn from others. Sometimes, a lot of text in an Instructablecan 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 :-(

Step 1: 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:

Use this as encouragement to make an Instructable if you haven't already! =)

Step 2: 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.

Code
<pre style="font-family:Monaco; width:600px; height:300px; font-size:11.0px; border:1.0px solid #6E6E6E; overflow-y:auto; background-color:#F2F2F2;">
PUT CODE HERE
NOTE: Remove the space between the "/" and the "pre" below
</ pre>

If the height is defined, a scrollbar will be created automatically if the code extends beyond the shaded area. Otherwise, the shaded area will wrap around all of the text, no matter how big or small.

Step 3: Tables

Tables are super useful as a materials organizer or to display data. HTML organizes tables using a variety of tags:

TagDescription
<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):

PartSource
2x 10KΩ resistorsSparkfun, RadioShack
2x 220Ω resistors

Sparkfun, RadioShack

2x 10-47µF capacitors

Sparkfun, RadioShack

2x LEDs

Sparkfun, RadioShack

2x PNP transistors

Sparkfun, RadioShack

~~ = This common part can be salvaged from almost anything

~~ = You can salvage this, or if it's bought, there will be leftovers

Code
<table border="1" style="border-color: rgb(189,189,189);border: 1.0px solid rgb(189,189,189);">
         <tbody>
            <tr>
               <th>Part</th>
               <th>Source</th>
            </tr>
            <tr>
               <td style="background-color: rgb(212,255,215);">2x 10KΩ resistors</td>
               <td><a href="https://www.sparkfun.com/products/10969" rel="nofollow">Sparkfun</a>, <a href="http://www.radioshack.com/product/index.jsp?productId=2062330" rel="nofollow">RadioShack</a></td>
            </tr>
            <tr>
               <td style="background-color: rgb(212,255,215);">2x 220Ω resistors</td>
               <td>
                  <p><a href="https://www.sparkfun.com/products/10969" rel="nofollow">Sparkfun</a>, <a href="http://www.radioshack.com/product/index.jsp?productId=2062317" rel="nofollow">RadioShack</a></p>
               </td>
            </tr>
            <tr>
               <td style="background-color: rgb(231,222,255);">2x 10-47µF capacitors</td>
               <td>
                  <p><a href="https://www.sparkfun.com/products/523" rel="nofollow">Sparkfun</a>, <a href="http://www.radioshack.com/product/index.jsp?productId=12448323" rel="nofollow">RadioShack</a></p>
               </td>
            </tr>
            <tr>
               <td style="background-color: rgb(231,222,255);">2x LEDs</td>
               <td>
                  <p><a href="https://www.sparkfun.com/products/10969" rel="nofollow">Sparkfun</a>, <a href="http://www.radioshack.com/product/index.jsp?productId=12611319" rel="nofollow">RadioShack</a></p>
               </td>
            </tr>
            <tr>
               <td>2x PNP transistors</td>
               <td>
                  <p><a href="https://www.sparkfun.com/products/522" rel="nofollow">Sparkfun</a>, <a href="http://www.radioshack.com/product/index.jsp?productId=2062585" rel="nofollow">RadioShack</a></p>
               </td>
            </tr>
         </tbody>
      </table>

Step 4: Forms

Surprisingly, Instructables lets you integrate a form into your Instructable. If you know a server scripting language like PHP or ASP, you can make a form to get information back from your readers (besides comments of course!).

This is a form made by w3schools that returns the input:

Do you like Instructables.com?

Code
<form action="http://www.w3schools.com/tags/demo_form.asp" id="Do_you_like_the_Instructables">Do you like Instructables.com?         
<select name="Do_you_like_Instructables">    
<option value="Oh_Yeah">I love it!       
<option value="Yes">Yes    
<option value="Maybe">Maybe    
<option value="How_can_you_not_like_Instructables">No</select>
<p><button type="submit">Submit</button></p></form>

Step 5: 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!

InputOutput
<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

Step 6: 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:

Materials
  • Arduino
  • Resistors
  • LEDs
  • Etc.
Tools
  • Pliers
  • Duct tape
  • Soldering iron
  • Etc.
Code
//Code by Nodcah

void setup(){
    Serial.begin(9600);
}
void loop(){
    Serial.println("Code");
    delay(100);
}
< /pre><fieldset>                
<legend>Code</legend><pre style="font-size: 11.0px;width: 600.0px;height: 300.0px;border: 1.0px dotted black;"><fieldset>
	<legend><strong>Materials</strong></legend>
	<ul class="curly">
	<li>Arduino</li><li>Resistors</li><li>LEDs</li><li>Etc.</li></ul>
</fieldset>
<fieldset>
	<legend><strong>Tools</strong></legend>
	<ul class="curly">
	<li>Pliers</li><li>Duct tape</li><li>Soldering iron</li><li>Etc.</li></ul>
</fieldset>
<fieldset>
	<legend><strong>Code</strong></legend>
	<pre style="font-size: 11.0px;width: 600.0px;border: 1.0px dotted black;">//Code by Nodcah

void setup(){
    Serial.begin(9600);
}
void loop(){
    Serial.println("Code");
    delay(100);
}
< /pre></fieldset>

Step 7: 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 NameUseExample
btnStyle text as a buttonButton
img-polaroidPolaroid image
calloutTo comment on something. I can't think of another use for this, but there are definitely moreText

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 FontHow to use it
Complete In Him Pro
<p style="font-family:CompleteInHimPro;">Complete In Him Pro</p>

Step 8: 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: easy..

Code
<p>Difficulty:  
<b style="background-color: grey;color: grey;border: 1.0px solid black;">e</b> 
<b style="background-color: grey;color: grey;border: 1.0px solid black;">a</b> 
<b style="background-color: white;color: white;border: 1.0px solid black;">s</b> 
<b style="background-color: white;color: white;border: 1.0px solid black;">y</b> 
<b style="background-color: white;color: white;border: 1.0px solid black;">..</b></p>

Step 9: 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 TagOutput
<button>
<img>
Robot
<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 text
This text is in a blockquote
<h1>, <h2>, ..., <h6>

h1

h6
<code>
This can be used to show code (see step 2 for another way)
<ul>
  • Unordered list item 1
  • Unordered list item 2
<ol>
  1. Ordered list item 1
  2. Ordered list item 2
<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.

Step 10: 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 CodeExampleDescription 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>

Step 11: 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.

Make a Blinky Circuit

This simple circuit blinks two LEDs.

Difficulty:easy..You need to be able to read a schematic

Step 1: Materials

To make this circuit, you'll need a few components:

PartSource (pictures are clickable!)
2x 10KΩ resistorsSparkfunRadioshack
2x 220Ω resistors

SparkfunRadioshack

2x 10-47µF capacitors

SparkfunRadioshack

2x LEDs

SparkfunRadioshack

2x PNP transistors

SparkfunRadioshack

~~ = This common part can be salvaged from almost anything

~~ = You can salvage this, or if it's bought, there will be leftovers

Tools:

  • Breadboard
  • 3.5-5.5V power supply
  • Jumper wires
Step 2: The Circuit

The circuit consists of resistors, capacitors, and LEDs. The 10KΩ resistors and the capacitors do the job of keeping a steady pace, while the transistors are responsible for turning the LED on/off.

See step 1 for a list of materials required for this circuit.

Step 3: Hooking it Up

Connect all of the components as seen in the schematic and watch it blink away! =)

Step 12: 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:


Thanks for reading! =D