Deprecated Items and Newer Constructs

Last post 07-24-2009 3:05 AM by Dhaliwal. 16 replies.

Sort Posts:

  • Deprecated Items and Newer Constructs

    05-20-2006, 8:31 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs

    I am often asked, "What are newer constructs for such and such?", since Visual Studio does HTML validation here it is for everyone to see.

    Deprecated Items and Newer Constructs

    XHTML 1.0 Transitional

    Note: Deprecated attributes are not included for elements that are already deprecated.

    HTML Elements

    <menu />      Newer Construct: Use another list type.

    <dir />           Newer Construct: Use another list type.

    <u />             Newer Construct: Use CSS property “text-decoration” and set its value to “underline”.

    <s />             Newer Construct: Use CSS property “text-decoration” and set its value to “line-through”.

    <strike />      Newer Construct: Use CSS property “text-decoration” and set its value to “line-through”.

    <basefont />  Newer Construct: Use CSS styling and set the “font-family” property to desired font.

    <font />         Newer Construct: Use CSS styling to set the property of the element, such as a DIV or SPAN. The CSS properties include:

    ·         color

    ·         font-family

    ·         font-size

    ·         text-decoration

    ·         text-align

    ·         text-indent

    ·         text-transform

    ·         font-weight

     

    <applet />   Newer Construct: Use the <object /> tag instead.

    <isindex />  Newer Construct: Use the <input /> tag instead.

    <i />*          Newer Construct: Use the <em /> tag instead or use CSS.

    <b />*         Newer Construct: Use the <strong /> tag instead or use CSS.

    Deprecated Attributes

    iframe

    name         Newer Construct: Use the ID attribute instead.

    align          Newer Construct: Use the CSS property “text-align” instead.

    body

    background  Newer Construct: Use the CSS property “background-image” or “background”.

    bgcolor      Newer Construct: Use the CSS property “background-color” or “background”.

    text           Newer Construct: Use the CSS property “color” for the “body” style.

    link            Newer Construct: Use the CSS section “a:link” and set the property “color”.

    vlink          Newer Construct: Use the CSS section “a:visited” and set the property “color”.

    alink          Newer Construct: Use the CSS section “a:hover” and set the property “color”.

    div

    align          Newer Construct: Use the CSS property “text-align”.

    p

    align          Newer Construct: Use the CSS property “text-align”.

    h1, h2, h3, h4, h5, h6

    align          Newer Construct: Use the CSS property “text-align”.

    ul

    type          Newer Construct: Use the CSS property “list-style-type” or “list-style”.

    compact    No newer construct. This attribute has been removed from the HTML DOM 1.0.

    ol

    type          Newer Construct: Use the CSS property “list-style-type” or “list-style”.

     

    compact    No newer construct. This attribute has been removed from the HTML DOM 1.0.

    start          Newer Construct: Use the CSS property “start”.

    li

    type          Newer Construct: Use the CSS property “list-style-type” or “list-style”.

    value         Newer Construct: Set the inner text of the element.

    hr

    align          Newer Construct: Use the CSS property “text-align”.

    noshade    Use the CSS property “color”.

    size           Newer Construct: Use the CSS property “height”.

    width         Newer Construct: Use the CSS property “width”.

    pre

    width         Newer Construct: Use the CSS property “width”.

    name         Newer Construct: Use the attribute “id”.

    br

    clear         Newer Construct: Use the CSS property “clear”.

    object

    align          Newer Construct: Use the CSS property “vertical-align” and “text-align” in the parent tag.

    border       Newer Construct: Use the CSS property “border”.

    hspace      Newer Construct: Use the CSS property “padding”.

    vspace       Newer Construct: Use the CSS property “padding”.

    img

    name         Newer Construct: Use the attribute “id”.

    align          Newer Construct: Use the CSS alignment properties.

    border       Newer Construct: Use the CSS property “border”.

    hspace      Newer Construct: Use the CSS property “padding”.

    vspace       Newer Construct: Use the CSS property “padding”.

    map

    name         Newer Construct: Use the attribute “id”.

    input

    align          Newer Construct: Use the CSS alignment properties.

    legend

    name         Newer Construct: Use the attribute “id”.

    table

    align          Newer Construct: Set table's CSS properties left-margin and right-margin at "auto" for centering, or right-margin to 0 for right alignment, or the left-margin to 0 for left alignment. (Thanks NewToDev)

    bgcolor      Newer Construct: Use the CSS property “background-color”.

    caption

    align          Newer Construct: Use the CSS property “text-align”.

    tr

    bgcolor      Newer Construct: Use the CSS property “background-color”.

    td, th

    nowrap      Newer Construct: Use the CSS property “word-wrap”.

    bgcolor      Newer Construct: Use the CSS property “background-color”.

    width         Newer Construct: Use the CSS property “width”.

    height        Newer Construct: Use the CSS property “height”.

     

     

    * Indicates that the element is not deprecated, but has newer constructs.

    Any corrections I will fix.

    Cheers,
           Kevin Jones


  • Re: Deprecated Items and Newer Constructs

    06-09-2006, 12:21 PM
    • Star
      7,718 point Star
    • thuhue
    • Member since 09-18-2003, 9:54 AM
    • Posts 2,282

    width         Newer Construct: Use the CSS property “width”.

    Is the following the correct new construct for the above?

    <td Style="width:20px;"></td>

    Thanks,

     

    Please mark the post(s) that have helped you as "Answer" and earn your point


  • Re: Deprecated Items and Newer Constructs

    06-09-2006, 5:53 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs
    Correct.
    Cheers,
           Kevin Jones


  • Re: Deprecated Items and Newer Constructs

    11-13-2006, 2:36 PM
    • Member
      5 point Member
    • BradRoberts56
    • Member since 10-19-2006, 2:58 PM
    • GA
    • Posts 1

    Is this also correct?

    style

    ="width:50%"
  • Re: Deprecated Items and Newer Constructs

    11-13-2006, 10:45 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs
    yes that is correct, depending on what element you are applying it to.
    Cheers,
           Kevin Jones


  • Re: Deprecated Items and Newer Constructs

    12-12-2006, 12:13 PM
    • Member
      53 point Member
    • RSewell
    • Member since 01-31-2006, 3:01 PM
    • Posts 41

    What about events?

     I've got a page I've converted from ASP to ASP.NET 2.0 that uses onmouseover and onmouseout events on an anchor tag.  VS2005 tells me "Validation (XHTML 1.0 Transitional) Attribute 'onmouseover' is not a valid attribute of element 'a'" and the events don't fire in the browser.  However, I have the exact same code in an XHTML 1.0 Transitional ASP page and the event fires there.

    Also, the W3C specs for XHTML 1.0 Transitional 1999 (http://www.w3.org/TR/1999/xhtml-modularization-19990406/DTD/doc/xhtml1-t.elt.html) define the onmouseover/out events for an anchor tag.  So why does MS think it's not valid?

     

  • Re: Deprecated Items and Newer Constructs

    12-12-2006, 12:41 PM
    • Member
      53 point Member
    • RSewell
    • Member since 01-31-2006, 3:01 PM
    • Posts 41
    Never mind, nix all that.  Funny how you can stare at a typo for months and not see it.  It took posting the error message here and then correcting it before I realized that VS2005 is right: attribute 'onmousemover' is indeed not a valid attribute of any element.  (sigh)  Embarrassed
  • Re: Deprecated Items and Newer Constructs

    12-12-2006, 4:25 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs
    Smile No problem. I do that all the time. And to answer your original question, none of the event attributes have been depricated. Though VS might tell otherwise if the event isn't in a specific schema.
    Cheers,
           Kevin Jones


  • Re: Deprecated Items and Newer Constructs

    01-05-2007, 3:04 PM
    • Member
      4 point Member
    • NewToDev
    • Member since 01-05-2007, 7:55 PM
    • Posts 2

    "table

    align          Newer Construct: Use the CSS property “text-align”.

    "text-align" doesn't work the same way as align in restrict mode, it only works on child elements of table but not the table itself.

    The way to get table centered is to set table's left margin and right margin at "auto".

  • Re: Deprecated Items and Newer Constructs

    01-05-2007, 3:09 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs
    Thanks! I updated it to use your suggestion.
    Cheers,
           Kevin Jones


  • Re: Deprecated Items and Newer Constructs

    01-05-2007, 3:21 PM
    • Member
      4 point Member
    • NewToDev
    • Member since 01-05-2007, 7:55 PM
    • Posts 2

    Hi Kevin,

    Margin-left and Magrin-right at "auto" only get a table centered. if you want a left aligned or right aligned talbe,  then set margin-left: 0 or margin-right: 0. 

     

    CheersBig Smile 

     

  • Re: Deprecated Items and Newer Constructs

    05-31-2007, 7:26 PM
    • Member
      2 point Member
    • bantionyou
    • Member since 05-31-2007, 11:24 PM
    • Posts 1

    Hi, for nowrap Newer Construct: Use the CSS property “word-wrap" is not working.

     

    I can not find CSS property “word-wrap" when i write style........

     

    Please guide for this.

  • Re: Deprecated Items and Newer Constructs

    06-01-2007, 12:14 AM
    • Star
      7,718 point Star
    • thuhue
    • Member since 09-18-2003, 9:54 AM
    • Posts 2,282

    Try this: style="white-space:nowrap"

     

    Please mark the post(s) that have helped you as "Answer" and earn your point


  • Re: Deprecated Items and Newer Constructs

    06-25-2007, 2:56 AM
    • Member
      2 point Member
    • EOTB
    • Member since 06-25-2007, 6:47 AM
    • Posts 6

    Hi Guys,

    This maybe slightly off topic, but I have found that the <a name="..... construct is also deprecated, as with the <map name=".....

    Problem is, I am trying to programically code that when a button is click and the page is posted back, I want to scroll the page down to a pre-defined point. In pure HTML you used the following to perform this function: 

    <a name="Location1"></a>
    ........
    <a href="#Location1">Move to Location 1</a>
    Does anyone know how to achieve this in ASP.net VB code?
    Thanks for your help
     
  • Re: Deprecated Items and Newer Constructs

    08-27-2008, 5:50 PM
    • Member
      2 point Member
    • ratkiley
    • Member since 08-27-2008, 9:48 PM
    • Posts 1

     The id attribute can be used instead.  This has the added value that every id must be unique within a page.

    http://www.w3schools.com/TAGS/tag_a.asp

     

    for example:

    <a id="Location1"></a>

     

Page 1 of 2 (17 items) 1 2 Next >