0

I have shape of triangle on which click I want client to navigate in another page.

But link goes in whole square. How can I solve that?

my div is:

div{
    border-bottom: 50px solid red;
    border-right: 50px solid transparent;
    width: 0;
    height: 0;
    top: 0;
    position: absolute;
    cursor: pointer;
    line-height: 75px;
}

JSFIDDLE

gsiradze
  • 4,583
  • 15
  • 64
  • 111

1 Answers1

0

This is a repeating question: Triangular link area

Insert the link into the div

Use skew or rotate: http://jsfiddle.net/0a8aq5ve/

html,body {
    height:100%;
    margin:0;
    padding:0;
}
div {
    height:50%;
    border:10px solid lightgrey;
    position:relative;
    overflow:hidden;
}
a {
    position:absolute;
    bottom:0;
    width:100%; height:20%;
    background:red;
    -webkit-transform-origin: 100% 0;
    transform-origin: 100% 0;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
}
Community
  • 1
  • 1
felix91
  • 452
  • 3
  • 11
  • if you know the question to be a dupe please don't reanswer the question - It would be best to VTC as dupe as OP will be able to find their answer in a single link. – jbutler483 Oct 27 '16 at 11:14