Creating consistent image placement across all divs: a step-by-step guide

html {
    font-family: 'Open Sans', sans-serif;
}

body {margin: 0;
    padding: 0;
}

#wrapper {
    padding-left:50px;
    padding-top:30px;
}

#third, fifth {
    background-color:#E8E8E8 ;
}
 
img[src^="my_menu.png"] {
    z-index:10;
}
 
#second, #third, #fourth, #fifth {
    width:100%;
    height:100vh;
    padding:0px;
    margin:0;
    margin-left:auto;
    margin-right:auto;
    background-color:white;
    z-index:-1;
} 

#second {
    width:100%;
    height:100vh;
    padding:0px;
    margin:0;
    margin-left:auto;
    margin-right:auto;
    margin-top:100vh;
}

#fourth, #second {
      background-color:grey;
}
<!DOCTYPE html>
<html>
    <head>
        <title>Add gospel Přerov</title>
        
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width" />
        <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    </head>
    
    <body>
        <div class="wrapper">
          <div id="second">     
          </div> 
           
          <div id="third">      
          </div> 
              
          <div id="fourth">
          </div>
              
          <div id="fift">
          </div>  
        </div>
    </body>
</html>

We're in the process of developing a website for a client and we've run into a design challenge. We have created four divs with a height of 100vh and a width of 100%. Now, we need to add downward-facing arrows to each div, positioned at the bottom center. Does anyone know how we can achieve this?

Answer №1

It's not entirely clear if this is in line with your requirements, but based on the query you've raised, this could be what you're looking to accomplish. I suggest setting up a div containing an image (alternatively, consider using the background property for the arrow image).

html * {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
.full {
  position: relative;
  height: 100vh;
  width: 100%;
}
.full:nth-child(1) {
  background: cyan;
}
.full:nth-child(2) {
  background: magenta;
}
.full:nth-child(3) {
  background: yellow;
}
.full:nth-child(4) {
  background: lightgray;
}
.arrow-down {
  position: absolute;
  bottom: 10px;
  width: 32px;
  height: 32px;
  left: calc(50% - 16px);
}
.arrow-down > img {
  width: 100%;
}
<div class="full">
  <div class="arrow-down">
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down">
  </div>
</div>
<div class="full">
  <div class="arrow-down">
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down">
  </div>
</div>
<div class="full">
  <div class="arrow-down">
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down">
  </div>
</div>
<div class="full">
  <div class="arrow-down">
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down">
  </div>
</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

Create a one-of-a-kind SVG design with a customized blur effect in

Recently, I've been experimenting with SVG effects and animations and stumbled upon a fantastic example of how to apply a blur effect to an SVG path. However, I'm struggling to figure out how to set a different color instead of the default black ...

Tips for automatically closing a dropdown menu when it loses focus

I'm having some trouble with my Tailwind CSS and jQuery setup. After trying a few different things, I can't seem to get it working quite right. In the code below, you'll see that I have placed a focusout event on the outer div containing th ...

How is it possible to encounter a Javascript unexpected token ] error within an HTML code?

While working on my project, I encountered a JavaScript error in the console of Chrome. The error message stated "Unexpected token ]" and it was pointing to a specific line of raw HTML code. I am puzzled about what could be causing this issue. Unfortunatel ...

Executing a function with a click, then undoing it with a second click

My goal is to trigger an animation that involves text sliding off the screen only when the burger icon is clicked, rather than loading immediately upon refreshing the page. The desired behavior includes activating the function on the initial click and then ...

Is there a way for me to keep an image stationary on the page while allowing overlaying text to move?

Currently, I am exploring the process of coding a website that mimics the style of this particular webpage: . I am particularly interested in learning how to create a scrolling effect for text within a fixed area, while keeping the accompanying images st ...

Having trouble passing a jQuery variable containing a string value to PHP through the jQuery AJAX function?

Below is the jQuery function code snippet: function processMessage() { if (textValue != "") { messageString='<div class="alert-box round"><p class="text-left">' + username + ':' + textValue + '</p>< ...

Unable to output value in console using eventListener

Hey everyone, I'm new to JavaScript and trying to deepen my understanding of it. Currently, I am working on an 8 ball project where I want to display the prediction in the console. However, I keep getting an 'undefined' message. const predi ...

Drop draggable items on top of each other

I'm wondering if there's a way to drag jQuery elements into each other. To illustrate my question, I've duplicated this code (link) and made some style changes. Here is the updated version: Fiddle Link. In the current setup, you can drag e ...

What are the solutions for addressing popping behavior during hover effects?

Hello everyone, I am experiencing an issue with the image hover effect on my website. How can I make it enlarge smoothly instead of just fading in and out? To better demonstrate, I have provided a helpful example https://i.stack.imgur.com/TcZKy.jpg Any as ...

sort jquery alphabetical characters

I have created some html and jQuery code that allows me to hide elements based on class name when I click on specific buttons in the filter div. However, I am now looking to add functionality to sort the elements alphabetically by class name when I press ...

arrangement of a list with the specified information stored in each item

Presently, my task involves setting up a dynamic gallery page with multiple tabbed lists that are fetched from the database. Each list corresponds to a specific Gallery Name and is associated with a unique data-list-id. Furthermore, each gallery contains ...

Changing an HTML container using jQuery and Ajax to facilitate a login process

Currently, I am on the lookout for a unique jQuery plugin that can replace a div when a successful login occurs. Despite searching multiple times on Google, I have been unable to find an ideal plugin that meets my specific needs. Do any of you happen to kn ...

Substitute the website address using regular expressions

Looking to update the iframe URL by changing autoplay=1 to autoplay=0 using regular expressions. jQuery(document).ready(function($){ $('.playButton').click(function(){ $('.flex-active-slide iframe').contents().f ...

The justify-position attribute does not have any impact on the positions that are set

Here is the JSX code that resembles HTML but uses ClassName instead of class: <div className="snavbarcontainer"> <div className="toplefticon"> <a class="test" href=" ...

Jumping CSS dropdown menu glitch

I'm facing an issue with a dropdown menu. The main problem is that the "parent" link is moving when hovered over. HTML: <ul id="nav"> <li><span>Page 1</span> <ul> <li><a>Extralong Pag ...

Attempting to fetch the user's username using jQuery from the database

echo "<form method='post' action='regprocess.php' id='registerform'>"; echo '<fieldset class="register">'; echo"<h2>Register</h2>"; echo "<ul>"; ...

Creating a unique custom bottom position for the popover and ensuring it is fixed while allowing it to expand

Creating a customized popover similar to Bootstrap's popover, I have successfully implemented popovers in all directions except for the top direction. My challenge lies in fixing the popover at the bottom just above the button that triggers it, and en ...

Swapping icons in a foreach loop with Bootstrap 4: What's the most effective approach?

I need a way to switch the icons fa fa-plus with fa fa-minus individually while using collapse in my code, without having all of the icons toggle at once within a foreach loop. Check out a demonstration of my code below: <link rel="stylesheet" href= ...

Dynamic Code for Removing List Items Based on Date

I need assistance in resolving an issue with my company's website design and function. Specifically, I am working on a page that displays a list of events where employees will be present throughout the year. Here is an example: <div class="contai ...

Continual dark mode throughout page navigation with the ability to switch between light and dark modes

I've been experimenting with creating a persistent dark mode feature for web pages. My goal is to remember the user's preference as they navigate between pages. Additionally, I included a toggle button for switching between dark and light modes t ...