Positioning problem with font-awesome arrows below the slider for navigation

I am trying to create a layout similar to the image in this link:

https://i.sstatic.net/crywo.jpg

However, I am facing issues with placing arrows (fa-angle-left) on the image within a slider. I have experimented with using position: absolute and relative, but haven't been successful.

Below is my code snippet, where I've used font-awesome for the arrows. Please note that the arrows may not function as intended due to the setup.

#top_header {
  background-image: url(http://i.imgur.com/wCDfIxa.png);
  background-repeat: no-repeat;
  background-size: cover;
  width: 100%;
  .slider_wrapper {
    width: 100%;
    background-color: red;
    overflow: hidden;
    img {
      width: 100%;
      border: 0;
      padding: 4em 0;
    }
    a {
      .fa-angle-left, .fa-angle-right {
        font-size: 80px;
        color: yellow;
      }
      .fa-angle-left {
        float: left;
      }
      .fa-angle-right {
        float: right;
      }
    }
  }
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<section id="top_header" class="clearfix">
  <div class="wrapper">
    <div class="slider_wrapper">
      <img src="http://i.imgur.com/bPbklqm.png" alt="">
      <a href="#"><span class="fa fa-angle-left"></span></a>
      <a href="#"><span class="fa fa-angle-right"></span></a>
    </div>
  </div>
</section>

Answer №1

* {
  box-sizing: border-box;
}

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

.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}

.clearfix:after {
  clear: both;
}

.wrapper {
  max-width: 90%;
  margin: 0 auto;
}


/**  - - - - - - - - - - Top Header - - - - - - - - - - **/

#top_header {
  background-image: url(http://i.imgur.com/wCDfIxa.png);
  background-repeat: no-repeat;
  background-size: cover;
  width: 100%;
}

.slider_wrapper {
  max-width: 100%;
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border: 0;
  padding-bottom: 2em;
}

.fa-angle-left,.fa-angle-right {
  font-size: 40px !important;/*Dont use !important when you working on a different style sheet */
  color: white;
  position:absolute;
   margin-top:22.5%;
}

.fa-angle-left {
left:7%;
}

.fa-angle-right {
  right:7%;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
 <section id="top_header" class="clearfix">

  <div class="wrapper">
    <div class="slider_wrapper">
      <a href="#"><span class="fa fa-angle-left "></span></a>
      <a href="#"><span class="fa fa-angle-right"></span></a>
      <img src="http://i.imgur.com/bPbklqm.png" alt="">
    </div>
    <!--slider_wrapper End-->

  </div>
</section>

    <!--slider_wrapper End-->

  </div>
</section>

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

Detecting Selected Radio Button Value Using Javascript

I am currently working on a project titled: Tennis Club Management utilizing javascript, HTML, CSS, and Bootstrap. In the project, one of the pages is managePlayers.html, which features two buttons - Add Players & Show Players. Clicking on the Add Play ...

A growing flexbox container that expands to a specific height before allowing for scrolling

In the case of a fixed height container with two vertical divs, I am aiming for the first div to be as tall as its content, up to 80% of the parent div's height. After that point, the content within the first div should scroll. The second div will the ...

Difficulty encountered when utilizing $_POST with a text area

Having a contact form on a website with 2 text fields, 1 textarea, and 1 hidden field is resulting in an unexpected issue. Despite all the fields posting to a PHP script, the textarea data is not being captured as expected. This is puzzling considering the ...

How to hide or remove an element in jQuery depending on an attribute change

I am currently working on my website and exploring ways to utilize jQuery to display or add the element div#content1 when the #nav-home-tab has aria-selected=true, and to hide or remove the element if aria-selected=false. This is what I have tried so far: ...

How to show PHP/HTML code within the PHP script and display it in HTML

Struggling to incorporate the following code into a PHP block for reuse on other webpages due to numerous errors. Any guidance on how to make this work? Here's the code block within a PHP file: <select name="products"> ...

"Implementing a responsive full-screen menu using Bootstrap for optimal user experience

I've implemented navbar-fixed-top and I want my menu items to expand to full width below the navbar when the user clicks on the burger-icon. The expanded menu should cover the entire height of the screen, and the burger-icon should transform into an ...

Is there a way to align the line under the hyperlinks to match the text size using CSS?

<div className={styles.container}> <ul className={styles.links}> <li className={styles.link}> <a href="/">Home</a> </li> <li className={styles.link}> <a href="/portfolio& ...

Respond.min.js is specifically optimized for compatibility with IE 8 emulation mode within IE 11

The respond.min.js script seems to only work on Internet Explorer 8 emulation within the developer's mode of IE 11. However, when tested on the actual IE 8, it fails to function without any indication, and in the IE Tester tool, it throws an error sta ...

Aligning MaterialUI Grid items vertically within various Grid containers

Looking to implement a design that features three vertical columns. The first and last columns will display MaterialUI cards, while the middle column will showcase a vertical line with dots aligned vertically with the start of each card. The height of the ...

Tips for emphasizing the prepend Font Awesome icon in Bootstrap 4 or Bootstrap-vue

Having an issue similar to this: https://i.sstatic.net/upjfK.png How can I adjust the width of the border so that it covers the icon on the left as shown here: https://i.sstatic.net/LSuOE.png This is my HTML: .input-group-text { width: 48px; bor ...

Opacity Vertical Gradient Text Design

Currently exploring various methods in CSS3, jQuery, SVG, or canvas to achieve a specific effect, but encountering some challenges along the way. Key considerations to take note of: The text gradient is vertical with opacity The text could span multiple ...

How to update icon for fa-play using Javascript in HTML5

I recently added an autoplay audio feature to my website. I would like to implement the functionality to pause and play the music, while also toggling the icon to fa-play at the same time. This is the HTML code I am using: <script type="text/javascri ...

Tips for customizing the selection tip of a custom cursor using CSS

I have integrated a color picker jquery plugin on my website to allow users to pick colors from an image. I made a modification in the CSS to change the cursor to an eyedropper icon. However, currently when clicking on the image, the color pointed by the u ...

What is the syntax for using escape characters in Vue?

Looking to create a website similar to CodePen? I have developed a library of assets including buttons, cards, and effects, all built using vue.js. Each asset includes HTML, CSS, and sometimes JS code. In my vanilla JS version, I formatted the code using e ...

Removing values when disabling a button using JavaScript

Within my code, I have two tables - one for non-clickable teams and another for clickable matches. Check out the image of the tables View the code on my GitHub repository let teams = [ {name: 'Roma', points: 0, wins: 0, draws: 0, loses: ...

I am experiencing issues with buttons not appearing on screen while attempting to establish a connection with Dropbox through the use

I am currently working on a lab project and looking to utilize Javascript to connect to Dropbox. Despite checking for syntax errors, the code I have written does not display the buttons as expected. You can view the current code setup in this JSFiddle: ht ...

Tips for Aligning Images of Various Sizes in the Center of a div

My images are displayed in a horizontal line, but some have different sizes. I want to center all the images within their container div for a better look. Is there a way to do this automatically with CSS so that the images remain centered regardless of siz ...

Utilizing jQuery Appended Data in Forms for Dependent Inputs

Apologies if the title I have chosen is not very clear. My query pertains to a form with connected inputs as demonstrated below: <form> <input type='text' name='item-1'/> <input type='text' name='sub-item ...

My CSS div seems to be ignoring the max-width property I've set

Update: I believe my code is correct, the skew just caused a slight distortion haha. Apologies for any confusion. I usually consider myself proficient in CSS, but this particular challenge has me questioning that... .creative-container { background ...

What are the pros and cons of embedding background image data into CSS as Base64?

While examining the source code of a greasemonkey userscript, I came across some interesting CSS: .even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsK ...