http://www.perlmonks.org?node_id=284898


in reply to Re: Re: My favorite HTML font style tag is...
in thread My favorite HTML font style tag is...

But most of the time I see <div> tags used where a <p> or some other tag that actually has meaning would be better. The problem with (or the point of) <div> and <span>. tags is that they don't have any meaning. This means that you are putting information (content) in a 'block' that appears to have no meaning at all.

Though I can see the use of the construct in some cases, just applying <div> and <span> anywhere you want a layout change is bad practice.

For instance, this:

<p> <span class="bold">Some header</span><br> Some paragraph. </p>

Is much better written:

<h3>Some header</h3> <p> Some paragraph. </p>

- Don't laugh too hard at the above example, I've seen plenty of this in real sites made by supposedly professional companies.

Joost.

-- #!/usr/bin/perl -w use strict;$;= ";Jtunsitr pa;ngo;t1h\$e;r. )p.e(r;ls ;h;a;c.k^e;rs ";$_=$;;do{$..=chop}while(chop);$_=$;;eval$.;

Replies are listed 'Best First'.
Re: My favorite HTML font style tag is...
by cLive ;-) (Prior) on Aug 19, 2003 at 19:46 UTC
    I suggest you go browse CSS Zen Garden.

    Then you will understand the power of one <div> clapping :)

    .02

    cLive;-)

    --

Re: Re: Re: Re: My favorite HTML font style tag is...
by Chady (Priest) on Aug 21, 2003 at 11:07 UTC
    Ok, but what about:
    <h3><span>Some</span> header</h3> <p> Some paragraph. </p>
    with this CSS:
    h3 span { color: red; }
    Some designs need that.
    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/
      You wouldn't write that. You would write:
      <h3><em>Some</em> Header</h3> <p> stuff </p>
      CSS
      h3 em { color: red; }
        This then, :D
        <h3 class="header1"><span>Some Header</span></h3> <p> stuff </p>
        CSS
        h3.header1 span { display: none; } h3.header1 { width: 200px; background: white url('images/header1.png') top left no-repeat; height: 25px; padding: 0px; }
        Fahrner Image Replacement

        P.S: I know about the one without the span ;)


        He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

        Chady | http://chady.net/