0

I am trying to create a triangle css divider. I was able to create the divider using

border-width: 4vw 75vw 0 23vw.

however, this way feels a bit sketchy. border-with you can't pass percentages, is this solution valid?

This is my css class:

.triangle {  
width: 100%;   
box-sizing: border-box;   
height: 0;   
border-style: solid;   
border-width: 4vw 75vw 0 23vw; }

It seems to me that 75vw is not a correct solution.

This is the divider: css divider

3
  • what is it to look like on different viewport dimensions (tall and thin for example)? e.g. how is the angle and/or height of the sides decided in relation to width? Commented Jul 7, 2023 at 17:24
  • 2
    could you do it with clip mask, it's percentage, check here bennettfeely.com/clippy Commented Jul 7, 2023 at 17:30
  • 1
    check this: css-generators.com/section-divider Commented Jul 7, 2023 at 19:47

1 Answer 1

-1

If you are asking if the CSS is valid syntax, the answer according to CSS Lint is yes.
Your CSS only produces 1 warning about "The box-sizing property isn't supported in IE6 and IE7."

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

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.