Having difficulty aligning Bootstrap/CSS element

As a newcomer to coding, I am facing an issue with my current project. The majority of the work needs to be done in Bootstrap, with some additional CSS. My goal is to have informational bullets on the left side of an image that is centered, and more informational bullets on the right side. Essentially, it should look like: bullets, image, bullets.

I have managed to get the left side looking as intended and the image perfectly centered, however, the right side alignment is giving me trouble. No matter what I try - using p tags enclosed in a div, eliminating the p tag and only using a div, experimenting with display: inline-block, position: center, adjusting margins, using Bootstrap's text-center class - nothing seems to work. I have scoured YouTube for solutions, but I'm unable to achieve the desired layout. Once again, it should feature an image at the center with bulleted text running down each side.

    .bottom {
      
    }
    img {
      border: 20px inset gray;
      width: 500px;
      display: block;
      margin: 0 auto;
    }
    .bullet  {
       
    }
    .bullet2 {
      display:inline-block;
      margin-left: 850px;
      margin-bottom:-300px;
    }
    <div class="container bg-primary">

      <div class="row">

        <div class="col-md-12 col-xs-12">

        <h1 class="text-center text-white">Water</h1>
          <h2 class="text-center text-white"><em>Where there is no water, there is no life</em></h2>

        </div><!--end col12-->

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

      <div class="body">
        <div class="bullet text-white">This is a cool and informative paragraph</div>
                    
        <img class="img-responsive" src="https://i.pinimg.com/736x/d6/69/fd/d669fd1ff1deecff0644292b02fe5a7d--charity-water-water-sources.jpg" alt="boy happy with water"/>
        
        <div class="bullet2 text-white">This is a cool and informative paragraph</div>
          
         </div><!--body-->
      </div><!--end container-->

Answer №1

It appears that Bootstrap is being used in your project.

If my understanding is correct, the following markup schema should work:

container
  row
    col-sm-4
      bullets
    col-sm-4
      img-responsive
    col-sm-4
      bullets

Depending on the version of Bootstrap and where you want it to be responsive, you may need to adjust col-sm-4 with other grid classes.
Documentation: v3. v4.

Here is a sample using Bootstrap v3.3.7:

/* This CSS is optional and only for demonstration purposes */
body { margin: 0; }
<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-sm-4">
      <ul>
        <li>A bullet</li>
        <li>Another bullet</li>
        <li>...</li>
      </ul>
    </div>
    <div class="col-sm-4">
      <img class="img-responsive" src="https://i.pinimg.com/736x/d6/69/fd/d669fd1ff1deecff0644292b02fe5a7d--charity-water-water-sources.jpg" alt="boy happy with water" />
    </div>
    <div class="col-sm-4">
      <ul>
        <li>A bullet</li>
        <li>Another bullet</li>
        <li>...</li>
      </ul>
    </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

Using td with a 100% width does not function properly

In my code, I have a table with 2 rows (tr) that are properly wrapped. However, I am facing an issue where the last row's td element (with the ID TD_16) is not expanding to 100% width. If you'd like to take a look at the code, here is the link: ...

Set Bootstrap column size to match a particular column

I am currently using BootStrap 4 and I am attempting to make a column's height equal to another column. Below is the code snippet I am working with: <div class="container" style="overflow:hidden"> <div class="row" style="overflow:hidden" ...

Navigating HTML Wordpress code for beginners

I am currently working on a project for my studies, creating a WordPress website. In order to pass the W3C HTML & CSS validation check, I need to edit the code to fix errors and warnings that are popping up. #1 Initially, I attempted to use the Appeara ...

When using a jQuery function, remember to always return false

I'm currently developing a forum and looking to implement client-side form validation. However, I'm unsure about how to validate the form before submission. I've tried using an 'on' function, but I need a way to notify the user if ...

JavaScript file slicing leads to generating an empty blob

I am currently working on a web-based chunked file uploader. The file is opened using the <input type="file" id="fileSelector" /> element, and the following simplified code snippet is used: $('#fileSelector').on('change', functio ...

Styling the content area to fill the entire window in CSS will

<div id="content"> </div> #content{ height:100%; z-index:2; position:relative; top:40px } The content within this DIV is positioned 40px from the top of the page and will scroll under a navigation bar that is 40px high. I am trying to figur ...

Struggling with uploading an image in a react application

Hey everyone, I'm encountering some issues with importing images into my project. Previously, I was able to import images successfully in my old project using the same method that worked before, but it's not working this time around. The way I im ...

Is there a way to adjust the input type date format to show mm/dd/yy?

My input type is set to "date" with the default format of mm/dd/yyyy. However, I would like to change it to mm/dd/yy. Is there a way to adjust the format of a date input? Date: <input type="date" id="date" name="date" value="mm/dd/yy" required/> ...

Searching for the measurement of the angle formed between two vectors within a triangle using HTML5 Canvas

I'm having trouble understanding why the angles in my Canvas-drawn triangle seem off whenever they aren't right angles. I've included both the HTML and JS code below. Can anyone explain why only the right angles add up to 180 degrees? I&apos ...

Organize elements in a grid using CSS styling

I have designed a layout using grids, featuring two menus on the left and right, with a central area for content. Within the content area, there is a 4x4 grid layout. Here's an example of the 4x4-grid layout: https://codepen.io/mannberg/pen/qemayy h ...

Customizing the column layout in Bootstrap 4 for various screen sizes

My columns are set up like this: <div class="col-md-3"> <div class="col-md-3"> <div class="col-md-3"> <div class="col-md-3"> Initially, these columns are displayed as 4 in a row, but they collapse into one column when a specific t ...

An easy guide to rearranging Bootstrap 4 column order for mobile display

Is there a way to rearrange the columns' elements in a specific order when resizing to mobile? Here's the code snippet: <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" /> <div c ...

Can someone point me in the direction of the app.css file within DurandalJS that controls the modals

I am currently facing an issue with implementing a modal in my app using the DurandalJS (SPA) framework. The modal is not displaying correctly, as it opens without a blockout and stretches horizontally across the entire browser. (I expect "Feeds", the "Ne ...

The functionality of $(this).data seems to be malfunctioning

I've spent the last couple of hours doing research but still can't seem to figure this out. I'm using ajax to load content, and for some reason $(this).data is not working as expected. If I replace this with the actual class, the content lo ...

The Ng-bootstrap dropdown menu fails to activate when clicked within a table row with a click event listener

By simply clicking on a table row, users can easily view the details. When I incorporate a 'ng-bootstrap' dropdown menu in the last column of the data table, it seems that clicking on the dropdown button does not open the menu as expected. Inste ...

JavaScript code for styling changes is not functioning as expected

Check out this code snippet: var moving_nav = document.getElementById("moving_nav"); var logo = document.getElementById("logo"); setInterval(function(){ var scrolled = window.pageYOffset || document.documentElement.scrollTop; if (scrolled >= ...

Steps for creating a horizontal card design

Looking to achieve a card style similar to this: http://prntscr.com/p6svjf How can I create this design to ensure it remains responsive? <div class="recent-work"> <img src="work/mercedes.png"> <h3>Modern website concept</h3&g ...

I am facing an issue where the carousel CSS styling is not reflecting on the

Recently, I decided to dive into the world of bootstrap and am experimenting with the carousel feature for the first time. However, I seem to be facing some challenges with styling. Despite trying to adjust the size of my image using CSS, I haven't se ...

How do I prevent the default submission behavior in an asp:ImageButton when the user presses the enter key in ASP.NET using C#?

Whenever I attempt to use this code snippet, it doesn't seem to work properly. How can I prevent the submit behavior of an asp:ImageButton? Here is the HTML code I am working with: <td class="style101"> <asp:ImageButton ID="imgBtnPos ...

Interactive font-awesome icons within an interactive dropdown menu

I am currently facing an issue with using two Fontawesome icons in a clickable dropdown menu. The dropdown menu does not toggle when I click on the icons directly; however, it works when I click on the padding around them. The example provided by W3schools ...