2

I am trying to do a banner for my website, a bit differently.

I want bottom border, to be kind of "arrow down" looking

Something like this: JS FIDDLE

.indexBanner {
  background-image: url('https://i.sstatic.net/dFUnt.jpg');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  background-color: #404040;
  height: 500px;
  position: relative;
  -webkit-clip-path: polygon(50% 0%, 100% 0, 100% 85%, 50% 100%, 0 85%, 0 0);
}
<div class="indexBanner"></div>

But currently I am using clip-path, which is not supported by Firefox and IE. And also you can see that the "arrow shaped" border is a bit messy.

I've also tried transform: skew in which case the result was more of a "chat bubble" kind of effect.

Is there any way to do this, because I am all out of ideas.

3
  • 2
    You can use the skew approach mentioned in this answer - stackoverflow.com/questions/30368404/…. I don't understand what you meant by "chat bubble" effect. Maybe if you show a demo, I can help to fine tune it. SVG would be your best bet though. Commented Jun 11, 2016 at 11:55
  • 4
    Check this Commented Jun 11, 2016 at 12:04
  • Just noting that Firefox has supported clip-path with a reference to an SVG <clipPath> element for ages and with basic shapes like polygon for about a year (unprefixed). It needs the layout.css.clip-path-shapes.enabled flag set to true in about:config to work. Commented Jan 15, 2017 at 15:09

2 Answers 2

2

https://jsfiddle.net/glebkema/h18w341m/

.indexBanner {
  background-image: url('http://nauci.se/Flipo/assets/images/study.jpg');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  background-color: #404040;
  height: 500px;
  position: relative;
  overflow-x: hidden;
}
.indexBanner:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 50vw solid white;
  border-right: 50vw solid white;
  border-top: 15vw solid transparent;
}
<div class="indexBanner"> 
</div>

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

Comments

0

I have tried changing the arrow-border to look less messy.

https://jsfiddle.net/night11/b7ch05Ln/ - updated

-webkit-clip-path: polygon(0 1%, 100% 0, 100% 60%, 50% 100%, 0 60%);

2 Comments

Please check your link. I guess this jfiddle is for another issue.
Thanks for bringing to notice :)

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.