asp.net – HTML属性bgcolor已被弃用:使用什么?
发布时间:2020-12-15 19:25:34 所属栏目:asp.Net 来源:网络整理
导读:VStudio ASP.NET提供以下消息: Attribute 'bgcolor' is considered outdated. A newer construct is recommended. 推荐的结构是什么? bgcolor在 td内元件. 另一个相关的消息是: Attribute 'bordercolor' is not a valid attribute of element 'table'. 有
VStudio ASP.NET提供以下消息:
Attribute 'bgcolor' is considered outdated. A newer construct is recommended. 推荐的结构是什么? bgcolor在< td>内元件. Attribute 'bordercolor' is not a valid attribute of element 'table'. 有谁知道我可能会找到更新的替代品? 解决方法
W3C HTML 4.0规范中已经废除了
BGColor .
较新的网站和Web应用程序使用CSS(级联样式表)呈现相同的事情,如下所示: body { background-color : #ffffff; } 对于表,请执行以下操作: <table> <tr id="row1"> <th>Header 1</th> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr id="row2"> <th>Header 2</th> <td>Cell 3</td> <td>Cell 4</td> </tr> <tr id="row3"> <th>Header 3</th> <td>Cell 5</td> <td>Cell 6</td> </tr> </table> 在你的CSS中: th { text-align: center; font-weight: bold; vertical-align: baseline } td { vertical-align: middle } table { border-collapse: collapse; background-color: #ffffff } tr#row1 { border-top: 3px solid blue } tr#row2 { border-top: 1px solid black } tr#row3 { border-top: 1px solid black } 这样做会使表格具有背景颜色,并与表数据/表格行的其余部分做不同的内容. 简单地说,在您的样式表中,并将其引用到您的网页上,如下所示: <link rel="stylesheet" href="style.css" TYPE="text/css" media="screen"> 你可以把CSS中的任何你喜欢的内容,更多关于CSS here和here的信息. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc-3 – VSTS错误SerializationException
- asp.net-mvc – 为什么HtmlHelpers需要这个HtmlHelper帮助器
- 谈谈分布式事务之三: System.Transactions事务详解[上篇]
- asp.net-mvc – 如何使用MVC控制器返回JSON
- asp.net-core-mvc – 区域中的ViewComponents
- asp.net – 带有自定义数据的web api帖子图片
- Asp.net core利用IIS在windows上进行托管步骤详解
- ASP.NET -- 获取浏览器信息
- asp.net-web-api2 – 通过http Post请求将XML发送到Web Api
- asp.net-mvc – 我可以在实际项目中使用Telerik ASP.NET MV
推荐文章
站长推荐
- asp.net-mvc-2 – 使用Html.LabelFor显示人类可读
- asp.net“记住我”的cookie
- asp.net – 绑定ListView InsertItemTemplate中的
- asp.net-mvc – 如果我在单个页面中添加多个表单
- asp.net-core – 什么是aspnet50和aspnetcore50?
- ASP.NET -- WebForm -- ScriptManager 类
- asp.net – 不能得到内容的内容,因为内容不是文字
- 如何为ASP.NET 5 MVC 6实现NoSQL身份提供程序
- 在ASP.NET中,HTML指令符号<%#或<%= etc?在服务
- asp.net – 移动浏览器设备检测在.NET
热点阅读