如何在div或span中使用两种css样式

时间:2021-04-20 20:33:16

how i can use two style on a div <div id="span,google"></span>

我如何在div

上使用两种风格

2 个解决方案

#1


7  

You can't assign two id's like that, but you can use two classes:

你不能像这样分配两个id,但你可以使用两个类:

<div class="span google"></div>

Also, you can't start the element as a div and close it as a span as in your code. I'll write that off as a typo, tho.

此外,您不能将元素作为div启动,并将其作为代码中的跨度关闭。我会把它写成一个错字,然后。

.span { some-css }
.google { other-css }

#2


1  

You can do:

你可以做:

<div class="span google"></div>

where you should have .span and .google classes set in your stylesheet

您应该在样式表中设置.span和.google类

#1


7  

You can't assign two id's like that, but you can use two classes:

你不能像这样分配两个id,但你可以使用两个类:

<div class="span google"></div>

Also, you can't start the element as a div and close it as a span as in your code. I'll write that off as a typo, tho.

此外,您不能将元素作为div启动,并将其作为代码中的跨度关闭。我会把它写成一个错字,然后。

.span { some-css }
.google { other-css }

#2


1  

You can do:

你可以做:

<div class="span google"></div>

where you should have .span and .google classes set in your stylesheet

您应该在样式表中设置.span和.google类