0

i wonder if anyone can help, easiest way to show it is the temporary url here: http://norsk-kulturhus-nettverk.a.heltblank.no/

It is the top image. The grey triangle should always follow the image size. Anyone got some tips?

Edit: Tried this:

.content-type-homepage .grid-section-article-wide .grid-rte {
    width: 0; 
    height: 0; 
    border-top: 20vw solid rgba(242,242,242, 1); 
    border-right: 100vw solid transparent; 
    position: absolute; 
    top: 0; 
    z-index: 99;
}
Stewartside
  • 20,378
  • 12
  • 60
  • 81

2 Answers2

2

You could use a media query which finds when the browser hits a certain size and then starts to change the border property.

I have tested this on the URL you gave above and it seems to be working.

.content-type-homepage .grid-section-article-wide .grid-rte {
    width: 0; 
    height: 0; 
    border-top: 20vw solid rgba(242,242,242, 1); 
    border-right: 100vw solid transparent; 
    position: absolute; 
    top: 0; 
    z-index: 99;
}

@media (min-width:1200px) {
    .content-type-homepage .grid-section-article-wide .grid-rte {
        border-right: 1200px solid transparent;
    }
}
Stewartside
  • 20,378
  • 12
  • 60
  • 81
0

Here is your css edited. Just replace the 100vw by the value you need

.content-type-homepage .grid-section-article-wide .grid-rte {
    width: 0; 
    height: 0; 
    border-top: 20vw solid rgba(242,242,242, 1); 
    border-right: 1200px solid transparent; 
    position: absolute; 
    top: 0; 
    z-index: 99;
}
Weedoze
  • 13,683
  • 1
  • 33
  • 63
  • Doesn't work for smaller screen sizes, the border is supposed to be as wide as the image, so a fixed border-width won't work. – Paul Oct 07 '16 at 12:41
  • Yes thanks, tried that earlier also. Just figuerd out i can do: @media(min-width:1200px){ .content-type-homepage .grid-section-article-wide .grid-rte { border-right: 1200px solid transparent; } } – kristoffer berntsen Oct 07 '16 at 13:18
  • So that solved it if it isn't bad practice or anything :) – kristoffer berntsen Oct 07 '16 at 13:18
  • @kristofferberntsen so just completely missed my answer with what you said you did in the end? :( boooo :P – Stewartside Oct 07 '16 at 14:18
  • @Stewartside Saw that now, crazy. Had a lecture today at the school on the bootstrap grid subject, so i learned it just when i posted. Not trying to take credit for your answer, thanks for the help :) – kristoffer berntsen Oct 07 '16 at 14:33