I insert the code into the structure

<pre><code><span>some css</span></code></pre> 

Everything works as described in the documentation, but when the tags themselves are tabulated in the file and start with 21 columns, they also leave very far when displayed, added white-space: pre-wrap; everything fell into place, but when there is more than one line in the inserted code and they should be tabulated by structure, all tabs are lost and lines are displayed from one line.

How to style this structure correctly to

  • the code did not leave on the page
  • whenever possible, the tabulation in the html file is preserved
  • when tabs are multi-line, the code is displayed as specified in the structure

http://jsfiddle.net/falkone/npnccung/

This adds a lot of empty space, I understand that this is because of the structure itself in html, but you can’t cut the code in the first column ...!

    2 answers 2

    See, if you remove the extra padding and spaces, they give an unnecessary stop to the left .... right?

    Get rid of the violation of the tabulation structure ... yes, this section of the markup is probably sensitive to spaces

    • I hoped that there is some kind of "magic way", but probably I will. - Andrii

    You can swap <pre> with <code> . And do not sculpt all this into each other almost the same thing.
    I would advise generally to refuse from <code> and take, or even better, white-space: pre or pre-wrap.