"Utilizing Bootstrap to create a Call-to-Action button that spans the full

Having difficulty getting the button in my right column to occupy the entire height and width of the column. I've tried adjusting heights, setting positions, but still can't seem to get it right with this odd structure.

My development frameworks are Twitter Bootstrap 4, SCSS, and jQuery.

The Bootstrap code snippet:

.cta-section {
  background: #243635;
  .center-align {
    align-items: $center-align;
  }
  .section-content-left {
    text-align: left;
    padding: 2.625rem 3.5rem 2.625rem 8.125rem;
  }
  h2 {
    font-size: $h2size;
    font-family: $nunito;
    font-weight: 200;
    color: $colorwhite;
  }
  p {
    font-size: $font15px;
    color: $colorwhite;
    line-height: 1.625rem;
    opacity: .77;
  }
  .cta-block-right {
    background: $colorgreen;
    font-family: $nunito;
    color: $colorwhite;
    .cta-large {
      color: $colorwhite;
      b {
        color: $colorwhite !important;
      }
    }
  }
} // End Cta Section
<div class="cta-section">
  <div class="container-fluid">
    <div class="row center-align">

      <div class="col-md-8 col-sm-12">
        <div class="section-content-left">
          <h2> We Make It Easy To Find Work You Love</h2>
          <p> It can seem daunting applying for a new career. Not to mention that you're interested in doing it in an innovative way (remotely). Don't worry, we have a simple process and we'll walk you through from start to finish. </p>
        </div>
        <!-- end section-content-left -->
      </div>
      <!-- col-md-8 col-sm-12 -->


      <div class="col-md-4 col-sm-12 column-bg-green" style="
                height: 100%;
                width: 100%;
                position: relative;
            ">
        <div class="cta-block-right" style="
                /* position: absolute; */
            ">
          <a class="cta-large" href="#"> <b>  See Our Process </b> </a>

        </div>
        <!-- end cta-block-right -->
      </div>
      <!-- end col-md-4 col-sm-12 -->


    </div>
    <!-- end row -->
  </div>
  <!--end container -->

</div>

Answer №1

EXPLANATION

When using Bootstrap 4, the rows and col are created using Flexbox. This means that by default, the Bootstrap col will take up the entire available height because the default align-item property of its parent row flex container is set to "stretch".


SOLUTION

To resolve this issue, simply remove all inline styles and apply the Bootstrap CSS class .h-100 to the .cta-block-right button.

<div class="col-md-4 col-sm-12 column-bg-green">
    <div class="cta-block-right h-100">
      <a class="cta-large" href="#"> <b>  See Our Process </b> </a>
    </div>
    <!-- end cta-block-right -->
</div>
<!-- end col-md-4 col-sm-12 -->

That should solve the problem :)

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

How can I centrally align the text(link) vertically in relation to its background image?

After setting the background color, height, and width of a link using CSS, I managed to align the text(link) center horizontally by applying the "text-align: center" property. However, I am facing difficulty in vertically centering it with respect to its ...

Arranging CSS text in a parallel format and aligning it vertically

I am working on a layout with two columns of text placed side by side, where one column is right aligned and the other is left aligned. Below is my current code: .alignleft { float: left; } .alignright { float: right; } .list-unstyled { padding ...

Incorporating components into Vue while utilizing Flask poses a challenge

Currently, I am working on a project that involves Flask and Vue. I am attempting to add a carousel to my website, but I am running into difficulties with creating and importing components for Vue when following tutorials. Here is my current file structure ...

Excessive content spilling over into the footer area due to an integrated forum feature within

We have integrated a Muut forum into our website, and it is working well when embedded in a coding block within the page's body. However, there is an issue where the sidebar of the forum gains extra features when logged in as an admin. This causes the ...

Glitch discovered in the if statement implementation in PHP and HTML

<img id="post_like_btn_<?php echo $post_info['id']; ?>" class="post_like_btn" <?php $like_result = data_like($dbc, $user_info['id']); while($like_info = mysqli_fetch_assoc($like_result)){ if($post_info['id' ...

Optimizing Bootstrap 4 Carousel for various screen sizes

I want to implement a full screen bootstrap 4 carousel with a transparent navbar at the top. The provided code seems to be functioning correctly. HTML: <!doctype html> <html lang="ro"> <!-- START head --> <head> &l ...

What are the steps to play this using Internet Explorer?

I am having trouble with my player code in Internet Explorer. Can anyone provide assistance on how to make it work across all browsers? <object data="http://bitcast-b.bitgravity.com/player/6/bitgravity_player_v6_1_4.swf" id="bitgravity_player_6" ...

What could be the reason for the malfunction of the nav-tab and tab-pane components?

I'm currently having an issue with my nav-tab and tab-pane implementation. While the nav-tab is working fine, the tab pane does not display the correct content when I click on a second tab. As a beginner in using Bootstrap, I am looking for advice on ...

Updating Bootstrap accordion button title when in collapsed state using CSS

I need some assistance with updating a Bootstrap accordion button behavior. Specifically, I am trying to change it so that when collapsed, it displays the text "See Less -". I believe I should be using the CSS property content, but I'm struggling to p ...

What is the best way to add two popups to a marker in Leaflet? One triggered by mouseover and another by a click event?

Is there a way to make a title hover over my map markers, but then have a full popup with unique content open up when they are clicked? I attempted to create a legend with a list of markers as links for popups, but I couldn't figure out how to do it. ...

What might be causing the 404 Error to appear on the mobile version of my website?

Currently, I am in the process of developing a static website using HTML, CSS, and Javascript. To add on-scroll animation effects, I have incorporated a plugin known as AOS. In addition, I have included Bootstrap in my project which was installed through n ...

What could be causing the issue with hammer.js swiping functionality on iPhones?

Looking for assistance from those experienced with hammer.js, as I'm facing an issue with swiping/scrolling on iPhones. I have been developing a web app using 8thwall and hammer.js for swipe and scroll functionality. While testing on my Samsung Galax ...

What is the process for adjusting row height in FullCalendar?

This is my control panel. $calendar = Calendar::addEvents($events) ->setOptions([ //set fullcalendar options 'firstDay' => 1, 'height' => '200px', 'themeSystem' => &ap ...

HTML template without the use of server-side scripting languages like PHP or Ruby on

Is there a way to develop HTML templates without relying on backend languages such as PHP or Ruby on Rails? I tried using JavaScript, but I encountered issues with my current code when adding nodes after the DOM is loaded. An ideal solution for me would ...

The PHP script was unable to load the CSS stylesheet from the specified base URL

I am having trouble loading the awesome.css file in my PHP file. The code I am using in my PHP file looks like this: <link rel="stylesheet" type="text/css" href="<?php echo base_url('resources/web2/lib/css/awesome.css'); ?>"/> Upon ...

What is the difference between class at DOM and className at component?

When passing the className props to the child component, sometimes the className for the active link is not correctly reflected in the DOM element during production: The child component (Link) receives the className prop for the active link from the paren ...

Issues with JQuery list selectors

Many individuals have raised concerns about selectors in the past, but no matter what I try, my code seems right yet it doesn't work as intended. My situation involves a list of actions that are displayed or hidden when their corresponding "folder" is ...

The jsonGenerator is unable to process strings containing spaces

Hey, I'm having trouble passing a string with whitespaces to my JavaScript function using jsonGenerator. Here's the code snippet: jGenerator.writeStringField(cols[8], ap.getContentId() != null ? "<img src='img/active.png' onclick=au ...

When an if statement is triggered by an overload of information, it initiates the start of a fresh

I am in need of creating an if statement that will trigger whenever images with IDs 0 to 3 (a total of 4 images) are loaded. This if statement should then generate a new row containing 0 to 3 images, and the same logic needs to be applied for words as well ...

Can you explain how to pause the .setInterval() function when hovering over it and clicking on the interior content simultaneously?

I have been working on a slideshow that involves building elements into an array, modifying the DOM, and using items from the array to fade in and out on a timer. While I have made progress, there are still a few things I would like to accomplish but I am ...