Difficulty in aligning elements to the edges of the screen

How can I adjust the positioning of these two arrow indicators to be aligned with the left and right edges of the screen, regardless of size?

.arrow-container {
  position: absolute;
  top: 37%;
  width: 95%;
  display: grid;
  grid-template-columns: 100px auto 100px;
  align-items: center;
  justify-items: center;
  text-align: center;
  -webkit-perspective: 5000;
  z-index: 12;
}

.arrow-container > div {
  height: 90px;
  width: 40px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  background-color: #373639;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 200ms;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0.35rem);
  align-items: flex-start;
  /*padding: 11px 17px 11px 17px;*/
  font-size: 1em;
  margin: 6px;
  filter: drop-shadow(1px 1px 1px #100021) drop-shadow(1px 0.01em 1px #0d021a);
  transition: background 200ms, transform 300ms;
}

.arrow-container > div span {
  filter: drop-shadow(1px 1px 1px #100021) drop-shadow(1px 0.01em 1px #0d021a);
  color: red;
  font-size: 5em;
}

#right-arrow, #left-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.key-arrow {

}
<div class="arrow-container">
            <div id="left-arrow" class="key-arrow"><span>&#129168;</span></div>
           <div id="right-arrow" class="key-arrow"><span>&#129170;</span></div>
        </div>

While the left indicator is correctly positioned at the left corner, the right indicator needs to be aligned to the right corner. How can I achieve this without success using grid? What are other options to consider?

Answer №1

To change the display property in the arrow-container class, use the following code snippet:

.arrow-container {
      position: fixed;
      top: 50%;
      width: 90%;
      display: grid;
      grid-template-columns: 150px auto 150px;
      justify-content: space-around;
      text-align: center;
      -webkit-transform: rotate(360deg);
      z-index: 15;
    }

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

Pressing the up arrow in Javascript to retrieve the most recent inputs

Is there a way to retrieve the most recent inputs I entered in a specific order? For example: I have an array with 20 elements, and every time I enter something, I remove the first element from the array and add the new input at the end. So, when I press ...

A creative way to display a div upon hovering over a link dynamically

My website has dynamically generated a tags, each with its own corresponding div containing unique content and height. I want to make it so that when a user hovers over an a tag, the matching div is displayed. The div should appear at the position of the m ...

What is the best way to incorporate CSS into JavaScript code?

Here is the code I am working with: <script type = "text/javascript"> function pic1() { document.getElementById("img").src = "../images/images/1.png"; } function pic2() { document.getEl ...

Obtaining Text within <span>Tag</span> with Selenium in C#

I am encountering an issue when trying to retrieve the Subject title of an email from Unread emails using Selenium Webdriver with C#. Below is the HTML code provided : <div class="ae4 UI UJ" gh="tl"> <div class="Cp"> <div> <ta ...

Rendering HTML5 and CSS3 on Internet Explorer 8

My coding knowledge is limited, but I am conducting research for our front-end developers. Our goal is to revamp our portal application using CSS 3 and HTML 5 in order to achieve an adaptive layout that can accommodate different browser widths. The curre ...

Is there a way to determine if jQuery lightslider has been initialized, and if so, how can I effectively remove the instance?

Currently, I have integrated the JQuery lightSlider into my project. Despite some code adjustments, it is functioning well. My goal is to dynamically replace the lightSlider content with data returned via AJAX, which I have successfully achieved. After r ...

What is causing the div element to act as a container?

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95f7fafae1e6e1e7f4e5d5a1bba3bba5">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-B0v ...

Error found - PHP if condition inside HTML td element

Whenever I open my browser, I encounter this error message: Parse error: syntax error, unexpected 'if' (T_IF) I have been working on creating an HTML table to display prices for a Woocommerce product. Although I've come across similar issu ...

After applying sorting, jqGrid displays an empty space below the final row

Having an unusual problem with sorting in the jqGrid. When I sort in descending order, there is extra space below the last row, but when I sort in ascending order, the table ends abruptly at the bottom without allowing any further scrolling. I have includ ...

What is the best way to ensure my images are responsive to the varying device sizes when displayed on this website?

In my endeavor to design a 2-column layout using Bootstrap, I aim for each row to consist of two columns: One column will contain text, while the other will display images that complement the textual content. Below is the Bootstrap code snippet for the n ...

Using WebRTC on a shared hosting environment (with SSH access) without the need for nodejs, ideally implemented in PHP

As I was exploring ways to integrate webRTC into a website that I am creating on shared hosting, I stumbled upon this GitHub repository by nielsbaloe. It has been incredibly helpful in establishing a basic connection. This particular code snippet appears ...

A horizontal navigation bar featuring a centrally aligned vertical layout and full-height display

I want to align everything on my menu bar vertically in the center, with the a elements taking up 100% of the available height of the menubar (text would be vertically-centered). However, I do not want to fix the height of my menu bar. (If I were to fix th ...

Issues with tabbed navigation functionality in jQuery

I'm encountering some difficulties with the tabbed navigation I created using CSS. Essentially, when a button is clicked, it should remove the hidden class from one div and add it to the other. However, what actually happens is that the div which sho ...

Every time I rotate my div, its position changes and it never goes back to

Trying to create an eye test by rotating the letter "E" when a directional button is clicked. However, facing an issue where the "E" changes position after the initial click instead of staying in place. Here is a GIF showcasing the problem: https://i.stac ...

Scraping data from the web using R and creating interactive plots with hover text in Plotly without

I'm attempting to extract hover text content from plotly traces that have been shared online. This is a new type of scraping for me, and I'm exploring ways to accomplish this task in R without relying on selenium or phantomjs, possibly with the u ...

Transform an HTML website into a collaborative wiki platform

I currently have a simple HTML website (no JavaScript, PHP, or CSS) with over 1000 pages that I want to transform into a Wiki format. I need a converter to extract the content from each page and create individual wiki pages for them. Additionally, all the ...

Flexbox mystery: How come the entire div isn't displayed when the element below it is hidden?

I am in need of a versatile column layout where multiple widgets are stacked vertically, adjusting their size dynamically. Each widget consists of a title and scrollable content. The last widget should have the ability to collapse when its title is clicked ...

jQuery conceal input field after it has been displayed

I've created an HTML form with two different sections for search purposes. The first section displays basic fields, and by clicking on "Advanced Search" (in my case, "Расширенный поиск"), additional fields are revealed. Everything work ...

What is the best way to focus on a specific section of a CSS class name?

Successfully Working Example: HTML: <div class="items"> <div class="item">item 1</div> <div class="prefix-item-suffix">item 2</div> <div class="item">item 3</div> < ...

Getting around popup blockers on safari

Here is the HTML code I am working with: <a href = "#" class="fb">Facebook</a> I am using an onclick event handler that triggers window.open when the link above is clicked. This works fine in Chrome, but it does not work in Safari. How can I ...