SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Total beginner here... question about inputting HTML/XHTML markup in HTML editor

    Hi there,

    I have a probably very dumb question but I don't see it addressed anywhere so I thought I'd ask.

    I'm using the Build Your Own Website the Right Way book and am plodding along by building the example. I'm using NoteTab Light as an editor.

    Here is my question: what is the convention for inputting indents in the markup? I don't mean indenting the text that will be seen in the web page itself, but in the HTML/XHTML text editor itself?

    I had started just tabbing my lines of markup. But in the example that I'm building, I have to insert several <div> to create divisions in markup that has already been input. In the illustration, all the markup indentation gets moved to the right by one indent... Do I have to manually retype a tab for each line of markup? This method doesn't seem very efficient so I'm thinking I'm not doing it right.

    Or do you all type your markup justified to the left? That wouldn't look very organized... at least to me!

    Thanks for explaining

  2. #2
    SitePoint Zealot Mattinblack's Avatar
    Join Date
    May 2009
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NCC View Post
    Hi there,
    Here is my question: what is the convention for inputting indents in the markup? I don't mean indenting the text that will be seen in the web page itself, but in the HTML/XHTML text editor itself?
    Its not addressed because nobody does it. Tabs and extra spaces waste bandwidth.
    Yes html is not very organised! See html for typical examples. Most pro webmasters have a down on wysiwyg editors simply because they insert extra spaces, tabs, comments, meta-tags and all sorts of other junk the page does not need. This is bad for bandwidth and also seo.

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much for explaining and the link. I guess I thought I was supposed to replicate what I saw in the examples space-for-space, as it were but maybe it's formatted with indents in the book so it's easier for us to read...

    Thanks again.

  4. #4
    SitePoint Zealot Mattinblack's Avatar
    Join Date
    May 2009
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NCC View Post
    Thanks very much for explaining and the link. I guess I thought I was supposed to replicate what I saw in the examples space-for-space, as it were but maybe it's formatted with indents in the book so it's easier for us to read...
    It is human nature to think that new things are much more complicated than they really are. You should have seen some of my first attempts 10 years ago!

  5. #5
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    I generally indent my markup so as to line up opening and closing elements, as such:

    Code HTML4Strict:
    <div id="wrap">
     
     <div id="header">
     
      <ul id="nav">
       <li>item 1</li>
       <li>item 2</li>
      </ul>
     
     </div>
     
        <div id="content">
         <h1>Page Title</h1>
          <p>This is a paragraph</p>
          <p>This is a paragraph</p>
          <p>This is a paragraph</p>
        </div>
     
         <div id="sidebar">   
          <ul>
           <li>...</li>
           <li>...</li>
          </ul>
     
          <ul>
           <li>...</li>
           <li>...</li>
          </ul>
        </div>
     
    </div>
    Though this is mainly for when I am building it, once it goes live, I am indifferent as to how the markup is indented. Though I like to keep it as readable as possible.

  6. #6
    SitePoint Evangelist Karpie's Avatar
    Join Date
    Jul 2007
    Location
    Perth, Australia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I too also indent my HTML when typing it, because a) I come from a programming background and b) it makes it easier to see when you've missed bits and pieces like closing tags.

    If you're using a decent editor, you should just be able to highlight everything you want to move inwards one tab space, and press tab to indent the whole lot. Shift+tab should remove one indent level from the whole lot.

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mattinblack View Post
    Its not addressed because nobody does it.
    Nobody? Who're you calling a nobody?

    Quote Originally Posted by Mattinblack View Post
    Tabs and extra spaces waste bandwidth.
    It's been a negligible problem since 300 baud modems went out of style.

    @NCC: A good text editor will have an autoindent feature that will copy the indention from the previous line when you hit Enter. A really good text editor will even have an intelligent autoindent feature that will increase or decrease the indention as you type start tags and end tags.
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    A good text editor will have an autoindent feature that will copy the indention from the previous line when you hit Enter. A really good text editor will even have an intelligent autoindent feature that will increase or decrease the indention as you type start tags and end tags.
    Could you please recommend a specific editor?? Thank you.

  9. #9
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Dreamweaver for one...Notepad++
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  10. #10
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    What operating system are you using?

    For Linux, vim seems like a very good option.
    For OS X (on the Mac), I'd recommend Textmate.

    Both of these are highly configurable though the latter is commercial.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Distaff_Dreams View Post
    Could you please recommend a specific editor?? Thank you.
    It's difficult to recommend a specific editor, because different people have different preferences. What works for me doesn't necessarily suit you, and vice versa.

    I use vim both on GNU/Linux at home and on Windows at the office. I does everything except make coffee (or maybe I just haven't found the command for that yet ). But if you're not used to the Unix vi edtor, the learning curve can be rather steep.

    Emacs is probably the only real competitor to vim as an all-purpose text editor. It's also extremely capable and extensible, and although the learning curve may not be quite as steep, you need to be a bit of a contortionist to manage some of the key combinations.

    There are lots of editors with a more specific target on HTML or CSS. Although these may be very useful, the downside is that you may have to learn to use at least one other editor for everything that isn't HTML or CSS.
    Birnam wood is come to Dunsinane

  12. #12
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,151
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    bbedit is nice all purpose text editor if your willing to spend the cash and work on a mac.
    The only code I hate more than my own is everyone else's.

  13. #13
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys - I'm currently using a Windows computer, although I've used both Linux, most recently Ubuntu, and Mac in the past. I already have Notepad++ installed so I'll go with that option for the moment.

    I usually just maintain existing websites for my clients - I have a virtual assistant biz - but I did build a couple websites from scratch a few years back... but that's almost ancient history in the speed of the Internet.

    Fortunately, I did use CSS even back then, so as I read about this stuff again, it's all coming back to me fairly quickly. I have the Head First HTML book at my side - I love how that book is written/designed.

    I now have a client who wants me to build her a standards-compliant website from the template website she built using a godaddy template... she has to switch to a different server plan to install the Wordpress design she won in an online contest.

    I have been wanting to also build a couple personal websites with google adsense, so this will give me a chance to get up to speed to get those projects completed sooner rather than later.

    So here we go - I know how I'll be spending my Sunday this weekend! I'm glad I got to spend 4 hours working on my garden yesterday because I am not going to see the sun today!. :-)

  14. #14
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Tommy
    I use vim both on GNU/Linux at home and on Windows at the office. I does everything except make coffee (or maybe I just haven't found the command for that yet ).
    You know, I heard Emacs makes coffee, and I believed it the moment I heard it. : ) Prolly makes it in Lisp.

  15. #15
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (I believe it. (I used Emacs (on VAX/VMS) back in the days (with an extension that made it emulate vim (and I even wrote my own extensions (in Lisp.)))))
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •