【问题标题】:How to avoid applying style from external style-sheet file?如何避免从外部样式表文件应用样式?
【发布时间】:2014-08-07 08:21:15
【问题描述】:

我的 aspx 页面中有一个图像标签。但是在那个 aspx 页面中引用了一个外部工作表。在该外部样式表中,为图像标签指定了一种样式。但我想避免应用这种风格。同时我不想应用任何内联/内部样式,因为我根本不希望将任何样式应用于图像标签。除了内联样式或内部样式之外,还有其他方法吗?

【问题讨论】:

  • 您需要对应用的属性取反。没有别的办法。
  • 您是否使用该页面上外部样式表中的其他样式属性..?你不能只删除外部css的引用吗..?
  • 是的,不能删除对外部 css 的引用。以及如何否定应用的样式?
  • @KrishnaTeja :使用 !important 表示该特定图像。例如:图片{width:100px!important;}

标签: css


【解决方案1】:

您可以使用另一个样式表中更具体的路径覆盖外部样式。

如果css路径是:

.container img { ... }

你可以设置:

.container img.className { overwrite the previous applied styles }

【讨论】:

    猜你喜欢
    • 2011-05-25
    • 2020-07-19
    • 2018-08-17
    • 2015-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-17
    相关资源
    最近更新 更多