Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMaja Vecerina
Courses Plus Student 883 PointsHow to indent the code (windows)?
Hi! In the video (use ID Selectors) is said that we can indent the code by clicking on ctrl + ] (on windows), but nothing happend, only that the <select> part still stayed selected. For making a square bracket I actually have to press ctrl+alt+], but I also tried this way and all selected code was deleted and replaced by the square bracket.
I don't know now how can I indent the code with the shortcut, because this one is not working on my keyboard. Any suggestions?
6 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsHi, Maja.
I'm assuming you have the Slovenian keyboard layout. It should look like the Croatian keyboard, if I remember correctly. If that's the case, Ctrl+? should do the trick.
Jason Anello
Courses Plus Student 94,610 PointsIf I'm indenting a block of code in windows I'll highlight all the code and then press the tab
key.
eck
43,038 PointsSo you want to be able to indent multiple lines of code at once? If that is what you are inquiring about, then I think it might depend on your text editor. For most of the ones I have worked with you simply select all the lines you wish to indent and then press "Tab"
eck
43,038 PointsBy "indent the code", do you mean
div {
width:100px; /* indented */
}
/* VS */
p {
width:100px; /* NOT indented */
}
??
Maja Vecerina
Courses Plus Student 883 PointsOh I'm sorry I wasn't specific enough. I mean, how to indent the long part of the code for one tab to the right. I know I can indent one line after another, but ctrl+] it's suppose to be a shortcut to indent the whole part at once, but it's not working on my keyboard.
Maja Vecerina
Courses Plus Student 883 PointsOh thank you both! I haven't even thought to try this way. It works, and is much easier to click tab key then then ctrl + ] ;) Thank you!
Dino Paškvan
Courses Plus Student 44,108 PointsDino Paškvan
Courses Plus Student 44,108 PointsHeh, Treehouse isn't allowing me to post Slavic diacritics. This is the letter I'm talking about.
Maja Vecerina
Courses Plus Student 883 PointsMaja Vecerina
Courses Plus Student 883 PointsOh yes I do have Slovenian keyboard :) And now it works with that shortcut! Thank you :) Now, I assume that there are also some other shortcuts that are not going to work on Slovenian keyboard?
Dino Paškvan
Courses Plus Student 44,108 PointsDino Paškvan
Courses Plus Student 44,108 PointsIn fact, that happens so often, most people who write any kind of code use the US layout to avoid such complications.
But the trick to deal with this in general is to take a look at the US layout and replace the character in the shortcut with the one that's on the same position on your own layout.
Maja Vecerina
Courses Plus Student 883 PointsMaja Vecerina
Courses Plus Student 883 PointsOh now it all makes more sense. Thank you for this tip, You just saved all my future shortcut wondering. :)