CSS:没有属性 [英] CSS :Not attribute

查看:102
本文介绍了CSS:没有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些HTML表格.这些表没有CSS类.这两个表具有width="100%"属性.其他表没有width属性.

I have a few HTML tables. These tables do not have CSS classes. The two tables have width="100%" attribute. Other tables don't have the width attribute.

仅使用CSS我需要设置没有width=100%的表的宽度.像这样:

Using only CSS I need to set the width of the tables which don't have width=100%. Something like this:

table:not(width="100%"){
    width: myValue;
}

推荐答案

属性选择器被[]包围,因此您的选择器应如下所示:

Attribute selectors are surrounded by [], so your selector should look like this instead:

table:not([width="100%"]) {
    width: myValue;
}

这篇关于CSS:没有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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