Place a downward arrow on top of a colored box or backdrop image

I am currently in the process of designing a downward arrow for the bottom of a full-width div. The arrow works well when transitioning from a colored section to a white one, as seen below:

https://i.sstatic.net/VsVW7.png

However, I am encountering issues in another situation...

https://i.sstatic.net/VsVW7.png

In the scenario above, the blue div with the arrow is running into a full-width background image, and it doesn't quite achieve the desired effect.

I aim to position the tip of the arrow over the top of the image or another color. How can I accomplish this?

This is my current setup:

<div class="bannerStripHeader" style="background-color:#009edb;">
    <section class="row">           
        <div class="columns large-12" style="color:inherit !important;">
            <div class="brandHeaderContent">
                Content here    
            </div>
        </div>      
    </section>
</div>

I am using the border color to set it to white.

.bannerStripHeader:before {
border-width: 50px 0 30px 70vw;
border-color: transparent transparent transparent #fff;
left: -5px;
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
-webkit-transform-origin: 100% 50%;
-ms-transform-origin: 100% 50%;
transform-origin: 100% 50%;
}
.bannerStripHeader:after {
border-width: 50px 70vw 30px 0;
border-color: transparent #fff transparent transparent;
right: -5px;
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
-webkit-transform-origin: 0 50%;
-ms-transform-origin: 0 50%;
transform-origin: 0 50%;
}
.bannerStripHeader:after,
.bannerStripHeader:before {
content: "";
border-style: solid;
bottom: -23px;
height: 0;
-webkit-transition: -webkit-transform .5s ease .5s;
transition: transform .5s ease .5s;
width: 0;
position: absolute;
}

Answer №1

I'm not quite sure if the description matches the code you provided. Are you looking to achieve a result similar to this demo?

.bannerStripHeader {
  position: absolute;
  overflow: hidden;
}

.bannerStripHeader:before {
  border-width: 50px 50vw 0 50vw;
  border-color: #009edb transparent transparent transparent;
  left: 50%;
  transform: translate(-50%, 0);
  top: 0;
  width: 0;
  height: 0;
  display: block;
  content: "";
  border-style: solid;
  position: absolute;
}


/* only for demo */
img {
  width: 100%;
}
<div class="bannerStripHeader">
  <section class="row">
    <div class="columns large-12">
      <div class="brandHeaderContent">
        <img src="https://images.unsplash.com/photo-1427477321886-abc24e8ce923?dpr=1&auto=compress,format&fit=crop&w=1199&h=800&q=80&cs=tinysrgb&crop=">
      </div>
    </div>
  </section>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting the ModelState.IsValid issue while editing user data and saving changes

Need to make updates to user details such as Firstname, Lastname, and date-of-birth. Even though the ModelState is valid, encountering issues with the SaveChanges function not working. It seems that there are some errors related to the password and email f ...

Steps to animate a div expanding to fit its content dimensions

I'm looking for a way to animate the opening of a div so that it adjusts to the size of its content. The content is fetched from a separate search using .load, which means it could be just a single line (no result) or multiple results that vary in hei ...

Fade transition for background image position in CSS3

I'm working on a unique sprite image to control my slideshow. My goal is to make the controls appear active by changing the background position when a user hovers over them. To achieve this, I've implemented the following CSS transitions: -moz ...

Material UI does not support the inline attribute for applying CSS properties

Trying to adjust the CSS for Material-UI When setting the width, everything works fine. However, when attempting to set display inline, an error occurs ---> "inline is not defined" Can anyone provide guidance on how to resolve this issue? Sharing my cod ...

What could be causing the transparency of my buttons when viewed on my device?

Recently, I customized the appearance of buttons in my App by adding colors. Surprisingly, everything looks perfect when I test it on a local server on my PC. However, once I deploy the App to my Android device, all the buttons become transparent. In my v ...

Place the image within the div to the right side

My div element is narrower than the image it contains, and I've set the overflow property to hidden. As a result, only a portion of the image is visible from the left side. However, I would like to see a portion of the image from the right side inste ...

Arranging Divs in Bootstrap

Having issues with my Bootstrap layout where I have two divs: (A) set as col-lg-6 and (B) set as col-lg-6 on a large device. This currently displays as: (A)(B) I am trying to rearrange the order of these divs on a mobile or small device using col-sm-12 ...

Refreshing a page using AJAX form functionalities

After spending some time searching, I am unable to find a satisfactory solution to my issue. I have a "finance" tracker that includes hidden divs which are displayed using jQuery when the corresponding button is clicked. Additionally, I have an Asset Track ...

Is there a way to adjust the width of the datepicker on my device?

I've been attempting to adjust the width of the date picker, but I'm having trouble achieving it. Below is my code: import React from "react"; import ReactDOM from "react-dom"; import { DatePicker, RangeDatePicker } from &qu ...

When attempting to capture an element screenshot as PNG, a TypeError occurs indicating that the 'bytes' object is not callable

Can someone please help me figure out how to save a screenshot of a specific element in Selenium using Python3? Here is the code I am trying: from selenium import webdriver import pyautogui as pog import time options = webdriver.ChromeOptions() options ...

How can you modify the HTML tags before Bootstrap overrides them?

Imagine having a code snippet like this: <style> #container ul li{ font-size:50px;} .myclass1 ul li{ font-size: 20px;} </style> <div id="container"> <ul> <li> <div class="myclass1"> ...

Running a Python script from an external source on a webpage through the utilization of PHP

Being new to this field with a background in Biology, I am currently focused on working with biological databases. I have successfully created a database using MySQL, HTML, PHP, and Bootstrap. However, I now aim to integrate an analysis module that include ...

Adjust the height of the div container and implement a vertical scroll feature on the fixed element

I created a fiddle and was hoping to enable scrolling, but I have been unable to find a solution. http://jsfiddle.net/sq181h3h/3/ I tried both of these options, but nothing seems to be working: #league_chat { overflow-y:scroll; } #league_chat { ...

Is there a jQuery function that can produce repeated output and append content with each successive click?

Attempting to implement a dynamic searchbar with various parameters has led me to explore using jQuery to load and clone the searchbar file in order to append it to the body dynamically. I have made several attempts to modify selectors without achieving t ...

Encountering a 500 Internal Server Error while attempting to insert data into a MYSQL database using

I am experiencing an issue while trying to insert radio checked data values into a MySQL database using PHP, jQuery, and AJAX. Whenever I attempt to insert the values, I encounter an internal server 500 error... Any assistance would be greatly appreciated ...

Attempting to implement a basic AngularJS integration with Google Maps for a straightforward demonstration

I have a basic Google Maps project that I am trying to transition into an AngularJS project. This is all new to me as I am a beginner in both AngularJS and web development so please bear with me :) The project can be found at https://github.com/eroth/angul ...

Learn how to divide a container div with multiple sub-divs into two columns using CSS

Are you up for a good challenge? In my MVC project, I have a dynamic list of divs that I want to split into two columns. The number of divs in the list is unknown. How would you go about achieving this task? EDIT: Just to clarify, when I say split, I&a ...

What is the best method for transferring data from an Excel spreadsheet into an HTML table?

I need assistance with integrating a dynamic Excel file into my website for football statistics. I want to be able to update the numbers in the spreadsheet and have the website's table automatically reflect these changes. Is there a solution availabl ...

Element in list displaying a distinct alignment from the rest

I currently have a navigation bar based on a list, which looks something like this: https://i.stack.imgur.com/e1Dmb.png My concern is how to position the "Logout" item on the right side of the screen. I've tried adding clear list items but that seem ...

The Feedback Form jQuery is not providing any data

I'm facing an issue with my html page that includes an ajax query to a php file. The purpose of this php file is to send a message and then return a response to the ajax query. However, no matter what I try, I am unable to receive any response from th ...