How can you indent multiple lines all at once?

Following the principles of white-spacing and indenting, if I needed to wrap multiple already written lines in a new tag/element, how do I add additional indentation to all those lines simultaneously?

This is very late, but for anyone who comes across this: You can indent multiple things by selecting everything you want to indent, and then press [Tab].

(this is also the reason i prefer always using [Tab] instead of [spacebar] for indenting)


That’s really helpful, thanks!

1 Like

Great tip. I had the problem when I copied an example to my existing text but could not indent them to fit in at once. This tip is good. Thanks.

1 Like

Oh man…
What a helpful tip!!

1 Like

wow, exactly what I needed
thank you

Thanks for this awesome tip.

I discovered this today before we got to this question, mostly because I didn’t want to tab each row individually. By trial I selected all the rows and hit tab and Wahlah!

If you prefer using [spacebar] to indent your code rather than using [tab], you can select multiple lines by holding the [alt] key and clicking on the beginning of each line you want to indent. Then, you can press [spacebar] and all the selected lines will be affected.


select the lines you want to indent and press ‘tab’ for forward indent and ‘shift+tab’ for backward indent


omg it moves! thank you!

1 Like

thanks @zormus as a newbie i found this extremely helpful!

There are also shortcuts that can be useful for formatting code in Codecademy editor:

  1. Select lines above/below cursor: Ctrl + Shift + up/down arrow
  2. Duplicate line: Shift + Alt + up/down arrow
    • You can also select a few lines and then use this shortcut to duplicate some bigger parts of your code!
  3. Multiple cursors (two shortcuts for this one):
    • Alt + click left mouse button in the place you want to set an additional cursor
    • Alt + Ctrl + up/down arrow (put a cursor above/below current one)

I hope these shortcuts will speed up your work with code :wink:


Discovered this article right after doing it line by line :joy:. Anyways, good to know for the future. Thanks!

But I used to read about a topic here on the forum that discourages using tab as it renders differently on different browsers. I can’t find that post so I’ll just attach this one.