Small HTML WTF



  • Doing some maintenance on a client's site today and ran across this little gem:

    <center align="left">
    </center>

    Damn Dreamweaver jockeys.  I'll be sad when Adobe finally euthanizes Homesite.



  • You owe me a new keyboard.
     



  • I'm not an HTML jockey. Is [i]align=left[/i] even a valid tag for [i]center[/i], and if so, what on earth is it supposed to do?



  • @snoofle said:

    I'm not an HTML jockey. Is [i]align=left[/i] even a valid tag for [i]center[/i], and if so, what on earth is it supposed to do?

    No, it's certainly not.  <center> is Netscape-introduced shorthand for <div align="center"> (in the neighborhood of HTML 3.0), so this is the equivalent of saying <div align="center" align="left">

     



  • This is so weird that I'm inclined to think it might be a copyright trap. Bit dumb because it's liable to be interpreted differently by different browsers. Firefox 1.5. centers the contents, ignoring the invalid align attribute.



  • Knowing the client and staff, it's not a copyright trap.  It's just another case of a WYSIWYG POS doing whatever the "developer" asks for.  And I've rarely seen one of those jockeys give a second thought to standards or browser compatibility.  If it works in IE, it must be good!

     



  • Just slightly left of center.



  • div align="center"

    argh i so hate people whom use that to "center" there page.
    and then keep wondering why everything is centered. 

     
    This because  it doesn't center the div, but everything in that div.

    A IMHO much more sane approach would be to just add margin: 0 auto;
    which will center the block level element you added it too.
     



  • @stratos said:

    A IMHO much more sane approach would be to just add margin: 0 auto;
    which will center the block level element you added it too.

    Just remember that your centered element must have a set width smaller than its containing block, and that IE must have a valid DTD. :)



  • Man, what's next, <br style="display: inline">?



  • Yes, or perhaps <blockquote style="margin-left: 0px;">



  • <b style="font-weight: normal">



  • @RevEng said:

    <b style="font-weight: normal">

    Let's just get these out of the way.

    <i style="font-style: normal">
    <u style="text-decoration: none">
    <big style="font-size: smaller">
    <small style="font-size: larger">
    <sub style="vertical-align: sup">
    <sup style="vertical-align: sub">
    <blink>  <--- enough of a WTF on its own.
    


  • @fennec said:

    @RevEng said:
    <b style="font-weight: normal">
    Let's just get these out of the way.
    <i style="font-style: normal">
    <u style="text-decoration: none">
    <big style="font-size: smaller">
    <small style="font-size: larger">
    <sub style="vertical-align: sup">
    <sup style="vertical-align: sub">
    <blink> <--- enough of a WTF on its own.


    <FONT face=tahoma,arial,helvetica,sans-serif>At least my favorite <marquee> tag is not on your list... :)

    But I'll add it as well... <marquee direction="left"><marquee direction="right">why am I not scrolling?</marquee></marquee>



    </FONT>


  • @RevEng said:

    <b style="font-weight: normal">

    That may be dumb but the CSS equivalent has its uses. Imagine your page uses a font that looks horrible in bold. You might want to use CSS to force the font-weight of "bold" text to be normal and use some other attribute to emphasize the text.
     

       b, strong {
           font-weight: normal;
           text-decoration: underline;
       }

    I do agree however that doing it in HTML is a WTF, and the OP of this thread is certainly a WTF.



  • Hey that could be my code you are maintaining, I've been doing that for years (without a wysiwyg).

    Using obsolete or odd tags like <center>, <tt> or <blink> instead of using <div> is making me laugh, and it's the only way for me not to fall asleep when I am faced with the unpleasant task of doing HTML. Also I always use the same 2 or 3 ugly colors I know (like c0c0c0) and crappy table-based layout (with border-style: ridge), and I frequently use the <pre> tag.I am not a web designer, most of the web pages I write are utilities, like password reset or logs viewing pages, so nobody really care.

    It's ugly but the code is very easy to read (compared to dreaded absolute-positioned divs).

     

     



  • @president_ch0ice said:

    Hey that could be my code you are maintaining, I've been doing that for years (without a wysiwyg).

    Using obsolete or odd tags like <center>, <tt> or <blink> instead of using <div> is making me laugh, and it's the only way for me not to fall asleep when I am faced with the unpleasant task of doing HTML. Also I always use the same 2 or 3 ugly colors I know (like c0c0c0) and crappy table-based layout (with border-style: ridge), and I frequently use the <pre> tag.I am not a web designer, most of the web pages I write are utilities, like password reset or logs viewing pages, so nobody really care.

    It's ugly but the code is very easy to read (compared to dreaded absolute-positioned divs).

    You that divs are not special, right? You can slap position:absolute on any element, and you don't have to position divs.



  • @Licky Lindsay said:

    @RevEng said:

    <b style="font-weight: normal">

    That may be dumb but the CSS equivalent has its uses. Imagine your page uses a font that looks horrible in bold. You might want to use CSS to force the font-weight of "bold" text to be normal and use some other attribute to emphasize the text.
     

       b, strong {
           font-weight: normal;
           text-decoration: underline;
       }


    Putting an underline on anything that isn't a hyperlink is a WTF in its own right.



  • @Carnildo said:


    Putting an underline on anything that isn't a hyperlink is a WTF in its own right.

    I agree... and even worse is changing the style of links so they don't look like links in the main content of a page. I've already seen links that were almost the same color as the text and they were not underlined. I've just been lucky to spot the small color difference. I think I've also seen a menu that was styled almost exactly like the actual contents of the page.

    I've also seen <span style="font-weight: normal"> and <span style="font-style: normal">, within <b>/<strong> and <i>/<em> tags respectively, when I used FrontPage (which I don't use anymore for obvious reasons...).

    Changing the CSS of <strong> and <em> elements is fine for me, but <b> and <i> shouldn't be changed. They have different semantics.



  • @codemoose said:

    Yes, or perhaps <blockquote style="margin-left: 0px;">

    I often do that, no issue there, a blockquote indicates a quote not a left-margin.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.