tags:

views:

68

answers:

2

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

+1  A: 

You can do:

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

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

Sarfraz
that's not the proper syntax tho
David Hedlund
@David: How is it not proper?
Sarfraz
-1 for incorrect HTML
ck
Anyone can make a small mistake like this; I think Sarfraz meant to type the correct form. Don't downvote...
Harmen
Yes guys i did not see the last closing tag, fixed it now. Thanks you all :)
Sarfraz
Vote changed. -1 removed.
ck
I was referring to `span, google` instead of `span google` but I see that that's changed now as well
David Hedlund
+5  A: 

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

<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.

.span { some-css }
.google { other-css }
David Hedlund
And div.span.google { yet-more-css }
CurtainDog
but how i can do if i have this two as a ID
4thpage
It doesn't make sense to have two ids, an id already uniquely identifies an element.
CurtainDog
id is meant to be unique to that specific tag, so you should use class instead. However, if you must associate it with two id's, then you could nest the divs: <div id="span"><div id="google"></div></div> and thus: #span {} #google {}
kainosnous