0

I have an tag, with the following markup:

#leftMenu ul li a   {color: #111; text-decoration: none; display: block;}

And I want to be able to hover over it, and display a triangular end. Similar to this shape:

http://www.promotionalpromo.com/Upfiles/Prod_v/1-7-8-x-2-7-8--Long-Arrow_2010017055476.jpg

But not with the same dimensions, more along the lines of: width: 200px; height: 20px;

Either I chop the two ends, (border-top-right and border-bottom-right) or I add css on with :after, however I need all this to happen when the user hovers of the tag.

How can I achieve this?

2 Answers 2

1

I found this site very usefull : http://apps.eky.hk/css-triangle-generator/

when i needed to create triangles. it generates a triangle for you.

Now after u generate the triangle, all u need to do is use :before or :after on your desired element to make it work, in your case hover as well.

Sign up to request clarification or add additional context in comments.

3 Comments

But you cannot write 'a:hover:after' can you?
this tutorial should help u get the hang of it : speckyboy.com/2012/02/15/how-to-build-a-stylish-css3-search-box
1

Just for reference this is how I did it:

#leftMenu ul li a   {color: #111; text-decoration: none; display: block; position: relative;}
#leftMenu ul li a:hover {color: #555; text-decoration: underline; background: #EEE; }
#leftMenu ul li a:hover:after 
            {
                content:"";
                float:right;
                position:absolute; top:0; right:-12px; width:0; height:0;
                border-style: solid;
                border-width: 13px 0 12px 12px;
                border-color: transparent transparent transparent #EEE;
            }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.