Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Vijayalaxmi vastrad
2,789 Pointshow to apply both after and before pseudo elements to same element in scss
For example:
.circle:before { position: absolute; content: ""; /* more styles: width, height, etc */ }
.circle:after { position: absolute; content: ""; /* more styles: width, height, etc */ }
HOW TO WRITE THIS IN SCSS
2 Answers

Sam Glister
1,704 PointsIf this was me writing this in scss and they both have exactly the same rules I would potentially use a mixin which should achieve what you are wanting to do.
@mixin before-after-stlyes {
&::before {
position: absolute;
content: "";
width: 100px;
}
&::after {
position: absolute;
content: "";
width: 100px;
}
}
Then apply this to whichever elements with the include function.
.circle {
@include before-after-stlyes;
}

Vijayalaxmi vastrad
2,789 PointsOHH THANK YOU SO MUCH, I AM BEGINNER TO SCSS, JUST STARTED LEARNING BASICS I DO NOT NO MIXINS CONCEPT.
melissamyra
Front End Web Development Techdegree Graduate 18,844 Pointsmelissamyra
Front End Web Development Techdegree Graduate 18,844 PointsTo make this SCSS even more DRY, I would add
so