Texture overlay on a Bulma video background

Is there a way to create an overlay on a background video without covering other components?

I want the components to remain visible and on top of everything else, with the background video in the far background, followed by the texture layer, and everything layered on top of it.

Please note: I am utilizing the Bulma Framework on WordPress.

I am using all native Bulma classes, except for defining the following for the texture class:

.hero .texture {
  width:100%;
  height:100%;
  position:absolute;
  top:0;
  left:0;
  z-index:15;
  background:url('/wp-content/themes/bulmapress/src/images/texture.png');
}

This is the structure of the code:

<div class="hero-head">
    <div class="first_nav">
        <header id="header" class="nav-down">
            <nav id="site-navigation" class="navbar container" role="navigation">
                <div class="navbar-brand">
                    <?php bulmapress_home_link('navbar-item'); ?>
                    <?php bulmapress_blog_description('navbar-item is-muted'); ?>
                    <?php bulmapress_menu_toggle(); ?>
                </div>
                <div class="navbar-menu">
                    <div class="navbar-start"></div>
                    <?php bulmapress_navigation(); ?>
                </div>
            </nav>
        </header>
    </div>
</div>
<section class="hero main_hero is-fullheight video">

    <div class="texture"></div>

    <div class="hero-video">
        <video poster="" id="bgvid" playsinline autoplay muted loop preload="auto">
            <source src="/wp-content/themes/bulmapress/src/images/compressed.mp4" type="video/mp4">
        </video>
    </div>

    <div class="hero-body">
        <div class="container has-text-centered">
            <div class="slider-content animated zoomIn pb-6">
                <div>
                    <p class="title is-1 main-text">Semirsmajlovic.com</p>
                    <p class="subtitle is-4 main-text">Website is under construction :)</p>
                </div>
            </div>
            <span class="scroll-down animated zoomIn">
        <svg
            width="30px"
            height="100%"
            viewBox="0 0 247 390"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            style="
            fill-rule: evenodd;
            clip-rule: evenodd;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-miterlimit: 1.5;
          "
        >
          <path id="wheel" d="M123.359,79.775l0,72.843" style="fill: none; stroke: #fff; stroke-width: 20px;" />
          <path
              id="mouse"
              d="M236.717,123.359c0,-62.565 -50.794,-113.359 -113.358,-113.359c-62.565,0 -113.359,50.794 -113.359,113.359l0,143.237c0,62.565 50.794,113.359 113.359,113.359c62.564,0 113.358,-50.794 113.358,-113.359l0,-143.237Z"
              style="fill: none; stroke: #fff; stroke-width: 20px;"
          />
        </svg>
      </span>
        </div>
    </div>
</section>

Example image: https://i.sstatic.net/hhP4T.jpg

Answer №1

To make this happen, you will need to put in some extra effort with CSS.

.hero.video {
  position: relative;
}

.hero.video .texture {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  color: white;
}

.hero.video .hero-video {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
}
.hero.video .hero-video video {
  width: 100%;
  height: 100%;
}
.hero.video .hero-body {
position: absolute;
}

If you want to include additional elements in the texture div, go ahead but remember to style them accordingly :).

I hope this solution works for you!

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

Fuzzy background when you scroll

My container has an image that blurs when you scroll down the page by 50 pixels. I feel like I've seen this effect somewhere before, but I can't quite recall where. I want the text to remain unaffected and not turn blue. Here is the HTML: <d ...

What steps should I take to troubleshoot the issue when utilizing full HTML link paths in my links?

I have come across the recommendation to use full link paths between pages on my website for various reasons. However, I am concerned about how to debug and work on my local testing environment when all of the links are using full paths. (Manually replaci ...

Adding a button to the right of a text-field input in Vuetify app

I need advice on the best way to use Vuetify in order to display a button to the right of a text-field (attached). I've checked the main site for information but couldn't find anything related to this specific scenario. https://i.sstatic.net/Pp ...

Retain chosen option after form submission in PHP/HTML

I have seen many questions asked about this before, but despite trying various solutions here, none seem to work for me. I am populating a list from my mysqli database: <select multiple="multiple" name="formCountries[]" size="5" id="keuzeproduct"> ...

Designs for an HTML5 Cheeseburger navigation interface

I've been struggling to implement a functional and visually appealing hamburger menu on my website. The challenge lies in integrating the menu seamlessly into the page rather than having it just pop up abruptly. Despite trying various webkit tools, I ...

After a link is clicked in the Rails web app, the style undergoes a subtle transformation

Encountering an issue with my HTML/CSS that seems to be connected to Rails and its asset pipeline. Initially, the styling of my web app is perfect on the first page load (and hard refreshes). However, as soon as I click on a link, navigate away from the pa ...

CSS: Hover below the designated target to reveal an expanding dropdown menu

My initial solution involved toggling the visibility on and off when hovering. However, this approach is not optimal as the menu should smoothly transition into view. When the visibility is toggled, the user does not experience the intended transition effe ...

Angular form array inputs

Currently delving into the world of Angular.js, I have encountered a simple problem that has left me baffled. My objective is to generate form inputs with the value of "connectedTeams" in HTML: <input type="text" name="connectedTeam[]"> <input ...

Having trouble with the Inline-Block display, attempting to design a two-column layout

Despite trying various tips from other Stackoverflow queries, the solutions don't seem to apply in this case. This is the desired outcome. * { box-sizing: border-box; } html { height:100%; width:100%; border: 0px; margin ...

Standard tag for all JSP pages including doctype declaration and styles

I have multiple .jsp files and a page.tag that contains information about all the .jsp files. I don't want to include doctype, styles, and scripts in every single .jsp file, as it would require changing them individually if any updates are needed. Ins ...

What is the best way to transform a ternary operation into an Enum Map with custom properties

I'm faced with the challenge of styling a button based on the selection made in a select box. The code snippet I have currently is as follows: const buttonStyles = { backgroundColor: buttonStyle === 'Black' ? colors.interactiveForeground ...

Ways to perfectly position a bootstrap well in the center

https://i.sstatic.net/b3g46.pnghttps://i.sstatic.net/osPzb.png Having trouble aligning this image with the center of the page. It should be a straightforward task, but for some reason, I can't seem to get it right. ...

Need to split your screen into two horizontal DIVs, each with their own scrollbars? Check out this example link for a demonstration!

Hey there! I have a question about creating something similar to this cool website: I'm working with Wordpress and using a child theme for my website. I want to include a fixed header as well. Currently, I've managed to give each div its own sc ...

Implementing Twin Modals Positioned Side by Side with Bootstrap

My dilemma involves creating two side-by-side modals using Bootstrap's grid logic. I have successfully implemented a single modal with the following code: <div class="modal fade bd-example-modal-lg" tabindex="-1" id="my_modal" role="dialog" aria- ...

What is a more dynamic way to assign attributes to elements without directly embedding them in the HTML code?

For my unique scenario, my goal is to assign the attribute target = "_blank" to all <a> elements within a specific div in order to open them in new tabs. This concept could potentially be applied to any element and any attribute. I am curious if the ...

Adjusting the spacing between dropdown menu items in Bootstrap sass with Rails

After adding the bootstrap-sass gem to my app, I have implemented two dropdown menus on the right side of the screen. Although they are horizontally aligned, I find that they are too close to each other. I would like to create some space between them and ...

Add the number provided in the input to the href

I'm attempting to add a number from an input field to the URL in a link. Currently, my code is replacing the entire URL instead of simply adding to the end of it: <input id='customquantity' type='number'></input> < ...

Submitting multiple choices and various forms using PHP step-by-step guide

Looking for some guidance on optimizing my HTML/PHP form setup. Here's a breakdown of what I currently have: Form 1: Apple options: -big -medium -small Submit button Form 2: Orange options: -big -medium -small Submit button Ta ...

Substitute a specific character in the titles of WooCommerce cart item variations with a pipe symbol

Is there a way to remove comma separation from the product attribute on my checkout page? For example: Blue Black Raw Denim - 37, Slimfit 37 is attributed as the product size, and slimfit is the model of the product. I would like to either remove the co ...

Is it possible for Wordpress to submit a form, update a link with the form input, and then automatically redirect to that link where the link itself is simply "#" ?

This particular script generates a form that ultimately creates a link utilizing the variable $ui. <form method="post" name="form" onsubmit="#"> Name search: <input id="ui" ...