Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Lindsay Barrett
seal-mask
.a{fill-rule:evenodd;}techdegree
Lindsay Barrett
Python Web Development Techdegree Student 7,357 Points

attribute styling

I have added an attributes css styling to my code, but the content image is not displaying in front of the html element.

<div class="footer4">
<h2>Get in Touch</h2>
<p class="phone">(623) 340-1422</p>
<p class="email">Aaabar@cox.net</p>
</div>
.email:: before {
content: url(images/get in touch/email.png);
margin-right: 8px; 
}

2 Answers

because you left a space in front of the before. and you need to define the content as empty string '', then give it a height and width and then define a background-image.

.email {
  padding-left: 8px;
}
.email:before {
  content: '';
  background-image: url(images/get in touch/email.png);
  height: 8px;
  width: 8px;

}
Brent Suggs
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Brent Suggs
Front End Web Development Techdegree Graduate 21,343 Points

I would also like to add that you aren't really styling based on attribute as you are using a class.
To use attribule styleing so that every link with said attribute is treated the same you would do the following...

<div class="footer4">
<h2>Get in Touch</h2>
<a href="tel:6233401422">(623) 340-1422</a>
<a href="mailto:aaabar@cox.net">Aaabar@cox.net</a>
</div>
a[href^="mailto:"]::before {
content: url(images/get in touch/email.png);
margin-right: 8px; 
}

This way any link with an href that starts with "mailto:" will get this styling.