10 Replies Latest reply: Feb 11, 2013 12:56 PM by hans-g. RSS

    Auto-Indentation Dreamweaver

    theCodeMonsters

      Hello all, I searched these forums for an answer and found something but it didn't help. Is there a way to make it so that when I do a return in Dreamweavers edtior, it keeps the same tabbed indentation from the line previous to it?

        • 1. Re: Auto-Indentation Dreamweaver
          mytaxsite.co.uk MVP

          theCodeMonsters wrote:

           

          Hello all, I searched these forums for an answer and found something but it didn't help. Is there a way to make it so that when I do a return in Dreamweavers edtior, it keeps the same tabbed indentation from the line previous to it?

           

          It always does exactly what you want by default.  What version of DW are you using?  I have just checked in DW6 and it works in it.

           

          Have you tried opening a new document from scratch and then trying it out?

          • 2. Re: Auto-Indentation Dreamweaver
            Nancy O. MVP

            If you want indented paragraphs throughout your site, add this rule to your CSS code.

             

            p {

            text-indent: 45px;  /**adjust value as req'd**/

            }

             

             

            Nancy O.

            • 3. Re: Auto-Indentation Dreamweaver
              hans-g. MVP

              Hi,

               

              I tried this approach (something similar to Nancy O. 's proposal):

               

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
              <html><head>
              <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
              <title>text-indent</title>
              </head>
              <body>

               

              <p style="text-indent:1em;">This text has a text indentation of 1em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 1em. This text has a text indentation of 1em. This text has a text indentation of 1em. Dieser Textabsatz hat eine Texteinrückung von 1em. This text has a text indentation of 1em. This text has a text indentation of 1em.Dieser Textabsatz hat eine Texteinrückung von 1em. This text has a text indentation of 1em. This text has a text indentation of 1em. Dieser Textabsatz hat eine Texteinrückung von 1em.</p>


              <p style="text-indent:1em;">This text has a text indentation of 1em. This text has a text indentation of 1em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 1em. This text has a text indentation of 1em. This text has a text indentation of 1em. Dieser Textabsatz hat eine Texteinrückung von 1em. This text has a text indentation of 1em. This text has a text indentation of 1em.Dieser Textabsatz hat eine Texteinrückung von 1em. This text has a text indentation of 1em. This text has a text indentation of 1em. Dieser Textabsatz hat eine Texteinrückung von 1em. This text has a text indentation of 1em. </p>

               

              <p style="text-indent:2em">This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em. This text has a text indentation of 1em. This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em. This text has a text indentation of 1em. This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em. This text has a text indentation of 1em. This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em.</p>


              <p style="text-indent:2em">This text has a text indentation of 1em. This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em. This text has a text indentation of 1em. This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em. This text has a text indentation of 1em. This text has a text indentation of 2em. Dieser Textabsatz hat eine Texteinr&uuml;ckung von 2em. This text has a text indentation of 1em.</p>


              <p style="text-indent:-2em;margin-left:2em">This text has a negative text indentation of -2em. Dieser Textabsatz hat eine negative Texteinr&uuml;ckung von -2em. This text has a negative text indentation of -2em. This text has a negative text indentation of -2em. Dieser Textabsatz hat eine negative Texteinr&uuml;ckung von -2em. This text has a negative text indentation of -2em.This text has a negative text indentation of -2em. Dieser Textabsatz hat eine negative Texteinr&uuml;ckung von -2em. This text has a negative text indentation of -2em.</p>
              <p style="text-indent:-2em;margin-left:2em">This text has a negative text indentation of -2em. Dieser Textabsatz hat eine negative Texteinr&uuml;ckung von -2em. This text has a negative text indentation of -2em.This text has a negative text indentation of -2em. Dieser Textabsatz hat eine negative Texteinr&uuml;ckung von -2em. This text has a negative text indentation of -2em.</p>

               

              </body>
              </html>

               

              To change or insert new paragraphs you only need to click into it in design view.

               

              Hans-Günter

              • 4. Re: Auto-Indentation Dreamweaver
                Nancy O. MVP

                Hans, why would you want to use inline styles for this? 

                 

                 

                Nancy O.

                • 5. Re: Auto-Indentation Dreamweaver
                  hans-g. MVP

                  Hi Nancy,

                   

                  I used this as an alternative to add it CSS rules, so to speak as a child of "inside" elements. Not so wise?

                   

                  Hans-Günter

                   

                  P.S.

                  My solution does not look all too bad, or?

                  • 6. Re: Auto-Indentation Dreamweaver
                    mytaxsite.co.uk MVP

                    I hope you were asking about DW editor indentation and not some superficial styling issues.  Styling issues is a completely different matter.

                    • 7. Re: Auto-Indentation Dreamweaver
                      Nancy O. MVP

                      If this is in fact a question about code indentation & not style indentation, apply Command > Apply Source Formatting. 

                       

                      Source formatting is under Edit > Preferences > Code Format.

                       

                       

                      Nancy O.

                      • 8. Re: Auto-Indentation Dreamweaver
                        mytaxsite.co.uk MVP

                        As I understand it, the OP is writing the code in code view and by pressing ENTER key he wants to go to the next line but exactly below the line before it.  Now this, on my machine, is automatic.

                         

                        Either the OPs configuration is messed up or the installation has being corrupted.  However, the question is not about auto format or styling.  The OP needs to post back to confirm.

                         

                        End of story.  I am currently watching "African Cup of Nations" and that is more important to me at the present point in time.

                         

                        <http://www.itv.com/itv4/>

                        • 9. Re: Auto-Indentation Dreamweaver
                          hans-g. MVP

                          Hi,

                           

                          please have a look here (it's made with my code from above):

                           

                          drIn.JPG

                           

                          AND, at every place of this text you can use ENTER or as I said above too: "To change or insert new paragraphs you only need to click into it in design view." What I didn't say you can use code view so too! You will get this: "<br>".

                           

                          Hans-Günter

                          • 10. Re: Auto-Indentation Dreamweaver
                            hans-g. MVP

                            Hi,

                             

                            where is "CodeMonster" to enlighten us?

                             

                            Hans-Günter