Asp.net 日历控件不会停止获得银奖......! (CSS)
尝试CSS它,我可以CSS单元格,以及一周中的几天,我认为顶部部分表示月份,但月份周围的区域是银色的,并且没有尝试CSS它会改变它 - 我尝试过所有不同的 CSS 属性(我认为),但最终总是银的。它在设计师中也显示为银色。我找不到改变这种想法的方法?
Trying to CSS it, I can CSS the cells, and the days of the week, and I think the top part that says the month, but the area around the month is silver, and no attempt at cssing it will change it - I tried all the different Css properties (I think) but it always ends up being silver. It appears in the designer as silver too. I can't find a way to change this...ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
只需将其添加到控件的 ASPX 中即可:
这应该可以解决问题。
Just add this in the ASPX of your control:
That should solve the problem.
不幸的是,这种样式实际上被硬编码到原始 ASP.NET Calendar 对象的 Render 方法中。您可以使用 Reflector 来查看这一点。是的,这很荒谬。使用替代日历对象,或对日历进行子类化并修复 Render 方法。不确定这个问题是否在 3.5 中得到修复...
Unfortunately, this style is actually hard-coded into the Render method of the original ASP.NET Calendar object. You can use Reflector to see this. Yes, it's ridiculous. Use an alternative calendar object, or sublclass the calendar and fix the Render method. Not sure if this is fixed in 3.5...
默认情况下,日历控件的渲染 HTML 可能会包含内联样式定义,例如
style="background-color: silver;"
,它将优先于 CSS 声明,除非它们具有 !important 标志。您可以在日历控件的标记中更改此设置作为快速修复
The rendered HTML for the calendar control will probably contain an inline style definition by default e.g
style="background-color: silver;"
, which will take precedence over CSS declarations unless they have the !important flag.You could change this in the markup for the calendar control as a quick fix
尝试使用 IE 开发工具栏/Firebug + Firefox,并将鼠标悬停在要更改颜色的项目上。看看为该项目编写 CSS 是否有效。
Try using IE Developer toolbar/Firebug + Firefox, and hover over the item that you want to change the color of. See if writing CSS for that items works.
可以做我所做的,即在你的 CSS 中添加第一个子元素。日历仍然是一个 HTML 表格。然而,第一行不是标题。
can do what i did which is add a first child in your css. The calendar is still an HTML table. the first row how ever is not the header.