CSS Elements

Status
Not open for further replies.

RiskyRyan

New Member
Feb 17, 2015
15
0
Making a new portfolio due to old one being ugly etc. Not designed anything recently and don't recall ever having to use this certain CSS code string before but: I have my name, Ryan Squalky. I'm trying to make Ryan red and Squalky white and have done this by:
HTML
Code:
<div class="logo red">Ryan</div> <div class="logo white">Squalky</div>
CSS
Code:
.logo  {
    font-size:45px;
    font-family:Bebas;
    text-align:center;
}

.logo, .red {color:#E74C3C}
.logo, .white {color:#ECF0F1}
Which didn't work this made all the text dominantly white and some reason made Squalky go on a new line!
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,926
3,921
The reason all the text turned white is because you assigned ".logo" with the color "#ECF0F1", along with ".white"; the comma allows you to target multiple things. If you wanted to target two classes in the same div you'd do ".logo.red".

Although, here's the way you should probably be doing it:
 
Status
Not open for further replies.

Users who are viewing this thread

Top