problem creating a triangle in div after with css

1

Personally I needed to create a triangle in my :after of my div but this shape would have to be 100% wide I made a triangle shape but it is with fixed width and this can not because in mobile it gets bad and when the site opens on larger screens it gets crooked follows prints of what I did with the code:


Css that creates the triangle:

#lp-pom-block-875{
    position: relative;
  }

  #lp-pom-block-875:after{
    content: '';
    display: block;
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: 0;
    border-left: 680px solid transparent;
    border-right: 680px solid transparent;
    border-bottom: 60px solid #f9f0e9;
  }

NOTE: Note that in the images I showed the triangle does not fit the fixed size and I do not know how to give a size of 100%;

    
asked by anonymous 06.09.2017 / 19:23

1 answer

1

You can not use position absolute, otherwise you lose responsiveness. This 100% width does not work with position absolute.

I would try to use media queries or I would have to switch to relative and adjust the screen.

    
06.09.2017 / 20:07