Creating a layout with text on the left and an image on the right using Bootstrap 4

On the left side of this image, you will find some text such as name and address. On the right side is an image of that person. How can I achieve this layout using Bootstrap 4?

https://i.sstatic.net/2eRz1.png

Answer №1

If you want to create a responsive layout, consider utilizing Bootstrap 4's card component and the col-sm-6 grid system for each section.

Check out an example here: https://jsfiddle.net/9k8w1fpq/4/

To learn more about creating cards in Bootstrap, visit:https://www.w3schools.com/bootstrap4/bootstrap_cards.asp

img{
width:100px;
height:100%;}
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<div class="container">
<div class="card" style="width:400px">
<div class="row">
  <div class="col-sm-6">
    <img class="card-img" src="https://material.angular.io/assets/img/examples/shiba1.jpg" alt="Card image"/>
  </div>
  <div class="col-sm-6">
    <div class="card-body-right">
      <h4 class="card-title">John Doe</h4>
      <p class="card-text">Some example text some example text. John Doe is an architect and engineer</p>
      <a href="#" class="btn btn-primary">See Profile</a>
    </div>
     </div>
  </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

What is the best way to retrieve a value from an INPUT field and dynamically assign it to a jQuery variable?

Hey everyone! I've got a POST form with a field like this: <input type="text" name="username" /> Using jQuery, I have declared a variable called var username = <---insert code here--->; Here's the question: How can I dynamically as ...

Manipulating dynamic form inputs: utilizing JQuery to assign and update values with Materialize autocomplete

In the process of creating an invoice page that allows users to search for a product, I have implemented auto-fill functionality where details are automatically populated. Values retrieved from the database are used to populate the Materialize dropdown an ...

Gain a comprehensive understanding of the JavaScript syntax utilized throughout the code

I stumbled upon this JavaScript code that enables asynchronous file uploads, but there are certain parts of it that I'm struggling to grasp. Any insights or explanations would be greatly appreciated - many thanks in advance. // Utilizing Ajax for Fil ...

Unable to successfully implement the Bootstrap dropdown feature in my header upon switching pages

Utilizing Ruby on Rails and Bootstrap 5.3 to develop a website for showcasing my projects and information. I have a header file that contains all of the navbar code. Once I visit any link from one of the dropdown options, the dropdown button stops function ...

Guide on utilizing multiple ng-apps alongside multiple controllers

Having trouble accessing controller values in different ng-apps? Here's a setup with two ng-apps and their controllers, where you may encounter errors when trying to access the value of one controller in another. Need some assistance with this issue. ...

Making an Ajax call using CakePHP

Encountering an issue with the AJAX call. Currently working on a website project in PHP using CakePHP framework, where a popup appears prompting the user to choose between "yes" or "no". Depending on the choice made, the selection should be saved. However, ...

Ensuring smooth video playback on a website

My website is experiencing issues due to a large mov file that's 157 megabytes. When I try to run it on my page using a javascript scroller animation, the animation becomes choppy. Additionally, I used css to simulate a mask, but it doesn't get m ...

Ways to position an element at the edge of the browser either on the left or right side when the image is not in a centered container

Looking to create a unique layout that involves: Utilizing a three-column structure Incorporating a div element that spans two columns Positioning an image within the two-column div so that it extends to the left edge of the browser window while staying ...

Maintaining the active state in Bootstrap, even when manually entering a URL, is essential for smooth

Check out this fully functional plnkr example: http://plnkr.co/edit/p45udWaLov388ZB23DEA?p=preview This example includes a navigation with 2 links (routing to 2 ui-router states), and a jQuery method that ensures the active class remains on the active lin ...

The jquery and css3 slider smoothly slides in one direction, but struggles to move in the opposite

I have successfully implemented a feature in my code where an item slides to the left and gets deleted. However, I am facing an issue where after deleting the element, a new element is created on the right side of the screen but it appears in the center wi ...

Display a div when hovering over a span with custom styling

Don't let the title fool you. http://jsfiddle.net/whb8A/ I'm struggling to style the text inside a span tag within a div. The h3 element shouldn't be nested in the span, but removing it makes it difficult to style with CSS. When hovering ...

Display a specific tab section upon clicking using jQuery or JavaScript

Hello everyone! I am completely new to JavaScript. I have added a tab slider to my HTML with 3 categories in the tab menu: All, Creative, and Branding. How can I show a div after clicking on one of the list items? I have assigned classes to the list items ...

Customizing Semantic UI Navigation Menu Styles

For the first time, I am incorporating semantic-ui into my React application. The specific package I am working with can be found here: To display my header, I am using the following code: <Menu className='header' > <Containe ...

Tips on arranging elements so that they appear in the same row as other similar elements

Currently, my display looks like this. The add to cart button is not showing up in a row because the product name of the third element is a bit lengthy. This is the code used to display the products: <div> <div class='box' ng-repe ...

What is preventing the code from concealing the html div when the winOrNot function is given the argument (false)?

Can you identify why the "Congratulations" message in the div is not being hidden when the function is called with the (false) argument? <!DOCTYPE html> <html> <head> <title></title> </head> <body> <div id= ...

What is the best way to fetch JSON data in the backend of my code?

I have a json (id) being sent to "page2.aspx" from "page1.aspx". This is the code in my Page1.aspx: (function load() { return $.get("page2.aspx", {id: "123" }, function (response, status, xhr){ //code } } How can ...

The function is malfunctioning following the alert

I am experiencing an issue with my renumbering list function. I have a delete button on the list that triggers a confirmation alert, but after the alert is shown, the renumbering function stops working. Here is my script: <script type="text/javascript ...

Unable to get scroll snapping to function properly on Windows and various other devices

My webpage has scroll snapping enabled, which works well on Mac but not on certain devices (especially Windows), where it behaves like a regular scroll. This makes it difficult for visitors to read the content as they have to manually figure out where each ...

Eliminating the unwanted line breaks that are automatically inserted when integrating JavaScript with HTML code

Hey everyone, I'm new to web development and could really use some assistance. I am currently working on a website that shows the weather forecast for the next four days, using SimpleWeather.js. In my JavaScript, I want to display the High & Low temp ...

What is the method for specifying input type in an HTML document?

I need assistance with controlling an input field labeled "Size" in HTML. The input should only allow users to enter Numbers and specific characters like X, ', and ". Other alphabets and characters should be restricted. I am working with AngularJS as ...