加入媒体查询后手机端css可以使用,但是电脑端css无效?

加入媒体查询后手机端css可以使用,但是电脑端css无效?

我的写法是这样的

	@media screen and (max-width: 1023px) {
		.button-module_container__ssMyd2 {

			width: 100%;
			margin-left: 0%;
			transform: scale(1.1);
			margin-top: 3vw;
			padding: 1.3vw;
			border-radius: 0.9vw;

		}
	}
	
		.typography-module_body1Bold__ghm177 {
		font-weight: 700;
		color: #fff !important;
		 
	}

我发现手机端typography-module_body1Bold__ghm177 有效果 但是电脑端却和失去效果一样。

而且只有个别css失效,其他都是可以正常使用的。

打开f12发现typography-module_body1Bold__ghm177样式前覆盖着@media screen and (max-width: 1023px)但是根本没有。

答案@media screen and (max-width: 1023px) {里面有一个是少了一个花括号,把后面的样式都包括进去了。

posted @ 2023-07-26 13:28  yjxQWQ  阅读(35)  评论(0)    收藏  举报