Francesca Francesca - 1 year ago 111
CSS Question

Using two CSS classes on one element

What am I doing wrong here?

I have a

, but on the first one I want zero padding on the top, and on the second one I want no bottom border.

I have attempted to create classes for this first and last but I think I've got it wrong somewhere:

.social {
width: 330px;
height: 75px;
float: right;
text-align: left;
padding: 10px 0;
border-bottom: dotted 1px #6d6d6d;

.social .first{padding-top:0;}

.social .last{border:0;}

And the HTML

<div class="social" class="first">
<div class="socialIcon"><img src="images/facebook.png" alt="Facebook" /></div>
<div class="socialText">Find me on Facebook</div>

I'm guessing it's not possible to have two different classes? If so how can I do this?

Answer Source

If you want two classes on one element, do it this way:

<div class="social first"></div>

Reference it in css like so:

.social.first {}


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download