属性'nowrap'被认为是过时的。建议使用更新的构造。它是什么? [英] Attribute 'nowrap' is considered outdated. A newer construct is recommended. What is it?

查看:246
本文介绍了属性'nowrap'被认为是过时的。建议使用更新的构造。它是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Visual Studio 2010编译ASPX页面时,出现错误:

 < td valign = topnowrap width =237> 

错误讯息是

 属性'nowrap'被认为是过时的,推荐一个更新的构造。 

错误信息是指什么?
并且它的行为与'nowrap'完全一样吗?

解决方案

您可以像这样使用它,我希望你现在不会得到过时的消息。

 < td valign =topstyle =white-space:nowrapwidth =237> 

正如@ThiefMaster指出的那样,建议将 width 和valign to CSS(注意:CSS将它称为 vertical-align )。

1 )

 < td style =white-space:nowrap; width:237px; vertical-align:top ;> 

2)我们可以制作一个这样的CSS类,优雅的方式



款式部分

  .td-some-name 
{
white-space:nowrap;
width:237px;
vertical-align:top;

在HTML部分中

 < td class =td-some-name> 


I'm getting an error when compiling this within an ASPX page using Visual Studio 2010:

    <td valign="top" nowrap width="237">

The error message is

    "Attribute 'nowrap' is considered outdated. A newer construct is recommended."    

What construct is the error message referring to? And does it behave exactly the same as 'nowrap'?

解决方案

You can use it like this, I hope you wont get outdated message now.

  <td valign="top" style="white-space:nowrap" width="237">

As pointed by @ThiefMaster it is recommended to put width and valign to CSS (note: CSS calls it vertical-align).

1)

<td style="white-space:nowrap; width:237px; vertical-align:top;">

2) We can make a CSS class like this, it is more elegant way

In style section

.td-some-name
{
  white-space:nowrap;
  width:237px;
  vertical-align:top;
}

In HTML section

<td class="td-some-name">

这篇关于属性'nowrap'被认为是过时的。建议使用更新的构造。它是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆