george Posted March 9, 2013 Share Posted March 9, 2013 I am trying to create a triangle at the right end of a box. My HTML is <div class="exampOne"></div> and my CSS .exampOne { background-color:green; width:30px; height:20px; }.exampOne:after { border-color: transparent transparent transparent blue; border-style:solid;border-width:20px;height:0px;width:0px;z-index: 3;} What am I doing wrong?Thanks Link to comment Share on other sites More sharing options...
jeffman Posted March 9, 2013 Share Posted March 9, 2013 (edited) :after does nothing unless you give it some content -- even if it's empty. For this application, you need to change the display property also. So add these two lines: content:"";display:inline-block; Edited March 9, 2013 by Deirdre's Dad 1 Link to comment Share on other sites More sharing options...
george Posted March 9, 2013 Author Share Posted March 9, 2013 Thank you Deirdre's Dad. Hope all is well with you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now