Start-up display

As a newcomer to using bootstrap CSS, I am facing challenges in creating a screen layout. My goal is to have a row with two columns that stretch all the way down the available screen and are responsive. Additionally, I want a div in the second column always positioned at the bottom. For reference, please take a look at the image linked below. Any assistance on this matter would be greatly appreciated.https://i.sstatic.net/xhdzf.png

This is what I have tried so far:

<div class="container">
        <div class="row">
            <div class="col-md-6 col-sm-6 bg-danger">
                left
                <ul>
                    <li ng-repeat="x in [1, 2, 3, 4, 5, 6, 7]">{{x}}</li>
                </ul>

            </div>
            <div class="col-md-6 col-sm-6 bg-info">
                right
                <div>
                    <ul>
                        <li ng-repeat="x in [1, 2, 3, 4, 5, 6, 7]"> content {{x}}</li>
                    </ul>
                </div>

                <div class="nav bg-warning">nav</div>
            </div>
        </div>
    </div>

Answer №1

take a look at this!

.constant{
  position:fixed;
    bottom:0;
    right:0;
  width:100%;
  border: 2px solid #f60;
  height: 40px;
  }
.cover-viewport {
  height: 100vh;
  border: 2px solid green;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
  <div class="col-xs-6 cover-viewport">
  <!-- your content goes here-->
  </div>
  <div class="col-xs-6 cover-viewport">
  <!-- your content goes here-->
    <div class="constant"></div>
  </div>
  </div>

Answer №2

If you want to make the content stretch to fill the entire viewport, you can set the height of all elements to 100%

Alternatively, you can use viewport units (vh) on the columns

html, body, .container, .row, .row > div {
  height: 100%;
}
.bg-info {
  position: relative;
}
.bg-info .nav {
  position: absolute;
  bottom: 0;
  width: calc(100% - 30px);   /* 2 * 15px padding */
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container">
        <div class="row">
            <div class="col-xs-6 bg-danger">
                left
            </div>
            <div class="col-xs-6 bg-info">
                right
              
                <div class="nav bg-warning">nav</div>
            </div>
        </div>
    </div>

Answer №3

Check out the helpful code snippet below:

.fixed{
  position:fixed;
    top:0;
    left:0;
}
<div class="container">
  <div class="col-lg-6 col-md-6">
    <!-- your content goes here-->
  </div>
  <div class="col-lg-6 col-md-6">
    <!-- your content goes here-->
    <div class="fixed"></div>
  </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

"Enhance Your Website Navigation with ASP.NET Menu Image PopOut using

I am using the asp:Menu and the popout image is enabled by default, however I actually like it. The issue is that after modifying the background and foreground of the menu, the popout image arrow blends in with the background. Is there a way to change thes ...

Tips for encapsulating an image generated using execCommand

<input type="button" onclick="document.execCommand('insertimage',null,'http://barwoncopiers.com/wp-content/uploads/2011/03/linkedin-icon-45x45.jpg');" value="Img"/> <br> <div contenteditable="true" class="editor" id="edit ...

how to position one div above another using css

I currently have a page layout with 7 different div elements structured like this; <div id="container"> <div id="head"></div> <div id="A"> <div id="A1">A1</div> <div id="A2"></div> ...

Tips on preventing navbar from shrinking in height while resizing the page

I am working on an app that is designed to resemble a desktop operating system. Currently, I have a navbar positioned at the bottom of the page, but when the height of the page is adjusted, the navbar shrinks too much and becomes difficult to use. I have ...

sticky navigation causing issues with tab functionality

Currently in the process of developing a website with a rather intricate sticky navigation bar. The JavaScript code being utilized to achieve this functionality is as follows: // Code for creating a sticky navigation bar document.addEventListener("s ...

How can I align the middle of the element within its parent until it hits the top-left edge, at which point should I stop center

I am trying to center an element within a parent container. It seems simple with methods like transform, flexbox, and grid... The issue arises with overflow behavior. When the parent container shrinks below the dimensions of the child element, scrollbars a ...

After a slight delay, the animated element twitches into action

I am currently working on implementing a menu item behaviour in the header similar to the one found at: . On this webpage, there is a bar that slides back and forth when hovering over elements. However, I am unable to add another element to my header, so I ...

Ways to eliminate header and footer data while printing a webpage

In my attempt to implement the code displayed below, I am encountering an issue where the header and footer continue to appear on the printed page. Despite numerous attempts with various CSS elements, I have been unsuccessful in removing the header and fo ...

Make the bootstrap button group adjust its size to fit the container dimensions

My goal is to create a display for multiple images with descriptions using a button cycling system. However, I am facing an issue where the buttons overflow the container instead of fitting within it when I wrap the cycler in a container with a fixed width ...

What is the best way to modify the size of the letter background?

I'm facing an issue with a word that has a background color. While using the CSS property background-color: blue, allows me to give the word a background color and display: inline-block helps in sizing it exactly to the word, the problem arises when I ...

Having trouble restricting the width of a column in Bootstrap?

I am having trouble adjusting the width of a specific column (Name: link) in my code. Here is what I have so far: <table class="table table-striped table-bordered"> <thead> <th>ID</th> <th>User</th> **<th class="col- ...

Ensure that the flex item expands to occupy the vacant space left when other child elements are deleted

I am facing an issue with multiple children inside a parent container that has the CSS properties display: flex and flex-direction: column. There is a toggle button on the webpage which removes one of the children when clicked. The problem I need to solv ...

Adjust the size of an image to fit within a set height row using CSS grid

I have a container with fixed width and height where I want to display an image and some text. My goal is to have the text appear first, followed by the image filling up the remaining space in the container. Check out the image below for reference: Exampl ...

Achieving side-by-side placement of two input groups in a bootstrap form

I've been attempting to create a form layout where two form-group elements are positioned next to each other on the same line. Despite trying various styling options such as display:inline, display:flex, none seem to produce the desired result. Below ...

Div with headers that stick to the top and stack when scrolling

I am working on creating a lengthy scrollable list of grouped items where the group titles remain visible at all times (stacked). When a user clicks on a group header, the page should scroll to the corresponding items. I have successfully used the positio ...

What is the best way to align an image in a particular div based on the current position of the viewport

I want to add a sleek animation while loading content using ajax. My goal is to display an icon while the "Content" div is reloading, but I'm not sure if this can be achieved with just CSS. The icon needs to: Always be horizontally centered within ...

What causes text display issues in Google Chrome when using the jQuery sortable widget?

Exploring front-end technologies like jQuery and CSS is a new adventure for me, but I find myself puzzled as to why the same code displays differently. The code snippet I'm referring to is the example of the sortable widget provided by jQuery. Inter ...

Scrolling seamlessly within a container that is fixed in position

For hours, I've been attempting to incorporate smooth scrolling into my project with no success. The issue lies in the container where the anchor tags are located. If it's set to fixed position or absolute, none of my attempts seem to work. In ...

Transitioning from one CSS id to another during page loading

Wondering how to fade in one CSS id on page load and then smoothly transition to another after a few seconds? Here are the ids: #background { background: url("images/am_photography_bg.jpg") no-repeat center -25px fixed; background-size: 100%; ...

Adjusting font size according to the font style selected

Can conditional font size be determined based on font family using CSS or jQuery? ...