Making a staircase using HTML and CSS
It's hard to comment when the original question was very vague, the Original-OP (O-OP) failed to answer questions, different interpretations were made by the various respondants, and there's (currently) no accepted answer. Even worse, someone saw fit to remove the jQuery tag, implying that only a CSS solution would suffice - a view that did not come from the O-OP.

None of that was your fault. 

The worst feature of this answer (and possibly others) is that the paradigm is reliant on a particular font size - change it and the step-formation falls apart.

You might consider something like the version below, which goes a long was to fixing that particular issue, and tidies up the code considerably :

$('document').ready(function() {
    function makeEqual($container, dashes, n) {
        var $step, scale = {}, i;

        // Create a single step and proactively measure its width and height in the target container.
        // IIFE allows working member `dashString` to be GC'd. 
        (function(dashString) {
            $step = $("&lt;div/&gt;").html(dashString + "&lt;br/&gt;&lt;br/&gt;" + dashString).css({'position': 'absolute', 'width': 'auto', 'white-space': 'nowrap'}).appendTo($container);
            scale.w = $step.width();
            scale.h = $step.height();
            $step.remove();
        })(Array.apply(null, new Array(dashes)).map(function() {return '- '}).join('')); // pass in the required string of dashes and spaces

        // create staircases - descending and ascending in the same loop
        for(i=0; i&lt;(n-1); i++) {
            $step.clone().css({ 'left': i * scale.w, 'top': i * scale.h }).appendTo($container); // descending steps
            $step.clone().css({ 'left': (2 * n - i) * scale.w, 'top': i * scale.h }).appendTo($container); // ascending steps
        }
        // create bridge-piece
        for(i=0; i&lt;3; i++) {
            $step.clone().css({ 'left': (n - 1 + i) * scale.w, 'top': (n - 1) * scale.h }).appendTo($container); // bridge-piece
        }
    }
    makeEqual($("#main").empty(), 5, 3);
});


DEMO

Notes :


no ids and no rediscovery of freshly appended DOM elements.
no need for the dashStructure() function - instead, positioned clones of the prototype $step are appended.
all steps are absolutely positioned on the same bases using left and top; the vagaries of mixed natural flow and relative positioning are avoided.
the number of assignments is greatly reduced.
consistent indentation!!