Placing an image at the bottom right corner and layering it behind an svg element

I am currently attempting to position an image behind an angled SVG separator. Our goal is to achieve this look:

https://i.sstatic.net/2YnsY.png

However, the current display does not meet our expectations as illustrated here:

https://i.sstatic.net/5Dssf.png

Below is the existing HTML structure being used:

<!-- hero -->
<div class="container-fluid bg-hero padding-angled-medium">
    <div class="container">

        <h1>Learn <span>English</span></h1>
        <h2>with someone perfect for you</h2>
        <h4>Professional one-to-one English lessons with teachers who care</h4>

        <div class="row">
            <div class="col-md-6">
                <div class="col-md-6">
                    <a class="btn btn-hero center-block" href="<?php echo base_url('book/free'); ?>">Free Evaluation</a>
                </div>
                <div class="col-md-6">
                    <a class="btn btn-secondary-cta default center-block" href="<?php echo base_url('courses'); ?>">View Courses</a>
                </div>
            </div>
            <div class="col-md-6">
                <img id="toucan" class="img-responsive pull-right" src="<?php echo base_url('Public/images/frontend/home/toucan.png'); ?>" alt="">
            </div>
        </div>

    </div>
</div>
<!-- end hero -->

<!-- white angled svg -->
<svg class="angled-div" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10" preserveAspectRatio="none">
    <polygon points="100 0 100 10.1 0 10.1" fill="white"/>
</svg>
<!-- end white angled svg -->

Here is my SASS code that styles the page:

// hero
.bg-hero {
    background: -moz-linear-gradient(top, rgba(255,255,255,0) 50%, rgba(0,0,0,0.3) 100%); /* FF3.6-15 */
    background: -webkit-linear-gradient(top, rgba(255,255,255,0) 50%,rgba(0,0,0,0.3) 100%); /* Chrome10-25,Safari5.1-6 */
    background: linear-gradient(to bottom, rgba(255,255,255,0) 50%,rgba(0,0,0,0.3) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#4d000000',GradientType=0); /* IE6-9 */
    width:100%;
    h1 {
        font-size: $font-largest;
        font-weight: 800;
        span {
            color: $brand;
            text-transform: uppercase;
            text-decoration: underline;
            text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5)
        }
    }
    h4 {
        margin-bottom: 30px;
    }
    // Media queries for responsiveness
}

Question: Is there a CSS technique or do I need to modify the HTML structure to achieve the desired effect of placing the image behind the SVG?

Answer №1

If you're looking to manipulate the image in your css, consider utilizing the z-index CSS property. One approach could be setting a negative z-index like: #yourImage {z-index: -1;}. Another important point is ensuring that the SVG separator has a higher z-index than the image to ensure it appears in front. Note that this adjustment may impact other elements' z-indexes on the page.

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

Attempting to modify the background color of an iFrame in Internet Explorer

I am experiencing an issue with my webpage where the iFrame is displaying with a white background in IE, while it shows up with a blue background in Firefox and Chrome. I have attempted various solutions to make the background of the iframe blue or transpa ...

Is it possible that my PHP script will not accept my POST request if I initially

Recently, I developed a dynamic signature generator for my online game. To create your own signature, you can manually access it via I attempted to simplify the process by creating a userbox where users don't have to visit and edit it. My goa ...

tips for concealing the sorting icon in the DataTables header upon initial load

Is there a way to initially hide the datatable sorting icon upon loading, but have it display automatically when clicking on the header? I've been searching for a solution without success. https://i.sstatic.net/o2Yqa.png ...

What is the correct method for formatting text spacing?

A few months ago, I dabbled in web design and created a basic website. Now, I'm revisiting it to clean up the layout and make it more visually appealing. I initially used non-breaking spaces to separate paragraphs, but I know that's not optimal. ...

Integrate PHP code into a div using Javascript and Ajax without losing any previous inclusions

Having issues with my navigation bar and elements. <ul><li> The element in question is: <li> My elements are linked via ajax to a separate php function file: switch ($_GET['menu']){} The functions are separated on a php fi ...

Footer covering up content on small screen display

I've encountered an issue with a footer that won't stick to the bottom of the page. I'm pretty sure it's just a small oversight on my part, as I've successfully implemented this feature before. I've cleaned up the page to make ...

Can we utilize conditions to both select and deselect items using JavaScript and PHP together?

I have a selection list with checkboxes that is dynamically generated based on certain conditions in the code snippet below. if ($data_inteiro_01 <= $data_inteiro_02) { if ($parcela[$i] === 0) { $display = 'disabled'; } } els ...

Click the link to copy it and then paste the hyperlink

I am facing an issue with copying and pasting file names as hyperlinks. I have checkboxes next to multiple files and a share button. When I check the boxes and click on the share button, I want to copy the download URLs for those files. Although I can succ ...

Pictures do not adhere to the maximum width set on their parent elements

When the max-width CSS style is set on the body tag and an image within the body surpasses this maximum width, the image does not adhere to the set limit. Instead of resizing, it simply overflows. Why does this happen? So, what is the solution to this pro ...

Choosing a CSS Grid layout

New to web development, I have a design dilemma. Working on a game that teaches students how to multiply, I am unsure about the best way to display the multiplication process. This picture illustrates my issue: https://i.sstatic.net/F8ZGs.png Given that I ...

How can I create a label with a full width in Bootstrap?

Currently, I am utilizing bootstrap in the following manner: <label> <input type="text"> </label> The issue at hand is that the label element comes hardcoded with display: inline-block;. Is there a way to remove this or make it look ...

Issue encountered with the "find_element" function in Selenium using Python

Currently, I am working on a project that involves creating a bot to interact with a Google page (Google Meet) using the Selenium Webdriver in Python. However, when running the code find_element, I encounter the following error: selenium.common.exceptions. ...

Sending information through the click of a button from various components

I need to trigger form submission when a button outside the form is clicked. I placed the button in my app component and followed an advice from this highly rated post: How to submit form from a button outside that component in React? However, following ...

Unable to render Material Icons on Vue/Quasar web app hosted on Azure

I am facing an issue with my webapp built using Vue and Quasar. I added the necessary icon imports to my quasar-user-options.js file. import '@quasar/extras/material-icons/material-icons.css' import "@quasar/extras/material-icons-outlined/ma ...

Rotating an arrow image on an accordion using jQuery

I have been working on this page located at Unfortunately, my attempts to showcase the issue in a jsfiddle were unsuccessful. The webpage features an accordion-style FAQ section, and I am attempting to make the arrow rotate 90 degrees when a question is ...

Import HTML content into R

In my project, I am trying to use R to extract the pronunciation of each word from a column in a dataset by accessing a specific website. I have started coding for this task as shown below. The goal is to fetch the pronunciation for each word from the we ...

What's the best way to align text in relation to the image?

enter image description here I need help with positioning my text relative to the resizing image at different breakpoints. Can anyone assist with this? Is there a way to position text relative to the background in a manner that it always stays attached t ...

PHP image retrieval is not functioning correctly and the image is not appearing as it

I'm facing some challenges when it comes to displaying images with PHP. I attempted to use this solution from Stack Overflow, but unfortunately, the image is still not appearing correctly. Within my PHP file that deals with the HTML layout, the code ...

Navigating through images within my application

When setting images, I encounter an issue where the second image overlaps the first one instead of appearing separately. How can I ensure that each image is displayed in its own box? I have attempted to use a blob directly by returning imgUrl in the showI ...

Styling a CSS-HTML unordered list menu with a separator that is perfectly aligned with

Currently, the menu has been created with the following CSS: nav{ width:1024px; margin: 0 auto; } ul{ display: flex; justify-content: space-between; } li { border-right: 1.1px solid #333333; margin: 0 auto; padding: 0 1em; text-align: center; flex-grow ...