我有一个Wordpress网站,我的主题在所有页面上使用以下宽度,亮度和位置。这是默认的CSS,但是喜欢它,但是如果我创建一个新的类/ div,则不要使用eveything使用的默认css,否则我将如何为特定的类/ div标签覆盖它。
标准CSS:
.tg-container
{
width:1200px;
margin:0 auto;
position:relative;
}
因此,此div将使网站上的所有内容居中
所以在我新创建的类中,我不想.tg-container覆盖我的CSS。在课堂上,我想使用全角而不是居中。
我的班级CSS
.wc-block-grid__products
{dont use css from .tg-container}
期待与此相关的帮助!
最好的问候,马丁
您可以使用您的类来做,确保您必须在HTML中将此类用所需的值覆盖这三个属性
.wc-block-grid__products {
width: //your desired width you want;
margin: //your desired margin you want;
position: //your desired postion you want;
}