Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Wiki-Style syntax for posting

by koolgirl (Hermit)
on Oct 15, 2008 at 01:34 UTC ( [id://717127]=note: print w/replies, xml ) Need Help??


in reply to Re: Wiki-Style syntax for posting
in thread Wiki-Style syntax for posting

A while ago, a few monks pointed out my mistake in using 'br' tags, not too shorten line length, but to have a single quote between two paragraphs. I only know enough HTML to "get by", using the term rather loosely, so I was grateful for the tips, and have since been using 'blockquote' tags, or even just 'p' tags.

However, just to be curious, why exactly, are 'br' tags considered "bad" HTML? I mean, they do work, so is it sort of the same concept as a "bad programming habit"? Just wondering, I learn quite a bit from having mistakes explained to me :))

P.S. Sorry to go off topic in the thread Monks...please forgive :))

Replies are listed 'Best First'.
Re^3: Wiki-Style syntax for posting
by missingthepoint (Friar) on Oct 15, 2008 at 06:56 UTC

    In addition to what GrandFather just said, <br> tags are considered bad HTML because they confuse structure and presentation. The reason CSS is such a good thing is that it allows you to completely separate your presentation (styles) from your markup (HTML). Having this separation of presentation and structure is good for maintainability. Anyone who's had to work on a website with lots of <font> tags can attest to that.


    email: perl -e 'print reverse map { chr( ord($_)-1 ) } split //, "\x0bufo/hojsfufqAofc";'
    'Under no circumstances should you program the way I say to because I say to; program the way you think expresses best what you're trying to accomplish in the program. And do so consistently and ruthlessly.' --Rob Pike
Re^3: Wiki-Style syntax for posting
by GrandFather (Saint) on Oct 15, 2008 at 02:07 UTC

    br tags are not really bad as such. It's just that they tend to get used by noobs to "format" text to a "nice" length. For example, a noob might "format" this paragraph by inserting judicious br tags and end up with something like this:

    br tags are not really bad as such. It's just that they tend to get
    used by noobs to "format" text to a "nice" length. For example, a noob
    might "format" this paragraph by inserting judicious br tags and end up
    with something like this.

    Now try changing your browser's width (especially make it narrow) and see what happens to the two blocks of text.

    A minor issue is that often </br> is used instead of <br/>. </br> is just plain wrong.


    Perl reduces RSI - it saves typing

      </br> is just plain wrong.

      In HTML, it's "<br>".

      In XHTML, it's "<br></br>" (with nothing in the middle) or the equivalent shortcut "<br/>".

      So "</br>" is not "just plain wrong", only when used improperly.

        Your just "plain wrong" about XHTML.
        The proper way to use that tag in XHTML is this way and only this way.
         <br />
        And here is a link you can learn from.
        http://www.w3schools.com/tags/tag_br.asp
        Spiel auf Hündinnen.
          A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: Wiki-Style syntax for posting
by ikegami (Patriarch) on Oct 15, 2008 at 07:22 UTC

    However, just to be curious, why exactly, are 'br' tags considered "bad" HTML?

    I didn't say they were bad, I said the OP's use of them was. P elements identify paragraphs, not BR elements.

Re^3: Wiki-Style syntax for posting
by blazar (Canon) on Oct 17, 2008 at 12:51 UTC

    I personally believe that they are just as "bad" as \\'s are bad in (La)TeX: because they constitute ad hoc, "visual" formatting, whereas most systems insist nowadays that you separate as much as possible logic and sematic info from formatting. Occasionally, such unconditional line returns are necessary, and good. But in general one should not exaggerate with them.

    --
    If you can't understand the incipit, then please check the IPB Campaign.

      ++. The easiest way to know if the <br/> you've used is bad is if you've used more than one. Two is a guaranteed mistake. I could see special cases like line-breaks in poems and code allowing for one at a time but even with something like that you'll want <span/>s -- this is why I'd like to see the <l/> we're supposed to get one of these days -- because you'll be defining indentation/horizontal spacing too. <br/> is the vertical equivalent of &nbsp;. Just say no.

        this is why I'd like to see the <l/> we're supposed to get one of these days

        I personally believe you left me a little bit behind now: is <l/> a proposal of yours or an existing tag and if so, then in which markup language?

        To put the matter in other terms, I would like to make it clear that I can happily and daily "survive" in the realms of *ML editing, but I'm far from being an expert in any of them, and really only use a well defined subset of all the available tags - incidentally and on a totally OT basis, the little I have seen of HTML 5 already makes me cherish it...

        To bring the discussion back in topic wrt not only PerlMonks but even Perl itself, I wonder whether considerations of the kind of the one you're doing are being taken into account in the development of Perl 6's new POD and in particular if they make sense at all there, given that it's supposed to be a lightweight markup language - but even more so: if few concepts have to be supported in such a restricted environment, it's important that they are thought out very well.

        --
        If you can't understand the incipit, then please check the IPB Campaign.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://717127]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found