placing an image at the top of the holder

Here is the code snippet I've been working on, aiming to achieve a design similar to this https://i.sstatic.net/OQkNA.png. Below is my code:

 .service-box {
        background: #fff;
        margin: 0 -5px 20px;    
        font-size: 16px;
        text-align: center;
        text-decoration: none;
        padding: 50px 30px;
        -webkit-transition: background 0.5s;
        -o-transition: background 0.5s;
        transition: background 0.5s;
    
    }
    
    
    .service-box:hover {
      background: #84a499;
      color: #fff;
    }
    
    .service-box:hover .btn-primary {
      background: #fff;
      color: #222121 !important;
    }
    .service-box:hover .icon-rounded {
      background: #688d80;
    }
    
    .service-box .service-title {
      padding: 30px 0 22px 0;
      margin: 0;
      font-weight: 300;
    }
    
    .service-box .service-title a{
        color: #222121;
    }
    
    .service-box:hover .service-title a {
      color: #fff;
    }
    
    .service-box .btn{
        margin-top: 10px;
    }
    
    .service-box .btn .fa{
        margin-left: 5px;
    }
    
    .service-box .icon-rounded{
        width: 80px;
        height: 80px;
        border: 1px dashed #e1e1e1;
        display: inline-block;
        border-radius: 50%;
        text-align: center;
        line-height: 80px;
    }
    
    .service-box .icon-rounded:before{
        font-size: 50px;
        margin-left: 0;
    }
 
    <!-- Web Fonts -->
    <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,700,900,500italic' rel='stylesheet' type='text/css'>
    
    <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"/>
    <!-- Main CSS -->
    <link rel="stylesheet" href="services/css/style.css" />
    






        <div class="container-fluid" style="background-color: white;">
         <div class="row">
        <div class="col-md-4 col-sm-4 col-xs-12" style="margin-bottom: 100px; margin-top: 100px" >
          <h1>My First Bootstrap Page</h1>      
          <p>This part is inside a .container-fluid class.</p> 
          <p>The .container-fluid class provides a full width container, spanning the entire width of the viewport.</p>   
          </div>
          
        
        <div class="col-md-4 col-sm-4 col-xs-16" style="margin-bottom: 100px; margin-top: 100px"  >
          <div class="service-box">
        <span class="icon-rounded flaticon-business70"></span>
        
        <h2 class="service-title"><a href="services-single.html">Information Design</a></h2>
        
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit sed rhoncus ex condimentum. Donec placerat nunc ut porttitor blandit. Duis ex nisi, tristique nec nullaf non.</p>
        
        <a class="btn btn-primary" href="services-single.html">Read More <i class="fa fa-long-arrow-right"></i></a>
        </div>  
          </div>
          
        <div class="col-md-4 col-sm-4 col-xs-16" style="margin-bottom: 100px; margin-top: 100px">
          <h1>My First Bootstrap Page</h1>      
          <p>This part is inside a .container-fluid class.</p> 
          <p>The .container-fluid class provides a full width container, spanning the entire width of the viewport.</p>   
          </div>
          
          </div>
        </div>

The output I have resembles this https://i.sstatic.net/skFQB.png

I'm currently stuck trying to replicate the first image using the provided code. If you have any suggestions or guidance on how to proceed with achieving the desired layout where an image is at the top followed by a title, description, and a separate "Read more" option in rectangles, please advise. Any help would be greatly appreciated.

Thank you

Answer №1

Utilize the bootstrap grid system to create nested rows and split a column into multiple parts according to your needs.

<div class="col-md-4 col-sm-4 col-xs-16 col-4" style="margin-bottom: 100px; margin-top: 100px">
    <div class="row">
      <div class="col-12">
        <div id="image" class="text-center m-6">
          <img src="https://www.thefamouspeople.com/profiles/images/a-p-j-abdul-kalam-2.jpg" class="rounded-circle img-thumbnail" alt="image" width="200px" height="200px"/>
        </div>
      </div>
      <div class="col-12">
        <div class="service-box">
      <span class="icon-rounded flaticon-business70"></span>

      <h2 class="service-title"><a href="services-single.html">Information Design</a></h2>

      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit sed rhoncus ex condimentum. Donec placerat nunc ut porttitor blandit. Duis ex nisi, tristique nec nullaf non.</p>

      <a class="btn btn-primary" href="services-single.html">Read More <i class="fa fa-long-arrow-right"></i></a>
    </div>
      </div>

    </div>

  </div>

Check out this working demo for a single column here: https://codepen.io/IamMonikaPatel/pen/VdrQry

Answer №2

For each box, make sure to include a circular image with specific CSS styling like this:

.customCircle {
display: block;
margin: 20px auto 20px;
height: 20px;
width: 20px;
border-radius: 50px;
}

You can define the image using either CSS or HTML. To replicate the example, simply add:

border: 1px dotted #cecece;

If you only want the second box to resemble the example, apply a unique class to that box or use nth child in CSS to target the second element within the container. Ensure to include this styling:

background-color: #008080

Please note that the colors provided are just examples and may not match exactly withe the original example.

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

Responsive HTML code for a textarea, button, and table

I'm currently developing a website that includes a textarea, button, and table within the body content. The responsiveness of my content works well, except for extremely narrow displays such as mobile phones. In such cases, the table does not wrap pr ...

Having trouble with implementing the .addclass function in a dice roller project

I'm looking to have the element with id=die load initially, and then on a button click event labeled "click me," apply the corresponding CSS class such as 'die1,' 'die2,' and so forth. function roll() { var die = Math.floor(Ma ...

Should input fields be placed inside separate columns or share a column in Bootstrap to keep them together while being right justified?

When using Bootstrap, is it better to place separate input fields inside their own col or share a col to keep them together and right-justified? I have a combo and input that I want to display on the same row at the right-hand side of the screen. If I put ...

Difficulty with MultiHandleSliderExtender and postback in JavaScript

Attempting to implement the multihandlesliderextender (from the Ajax Toolkit) for creating a price filter option on a webshop. Upon selecting a new price, it should trigger a reload of everything including extensive behind-the-scenes code. Referenced an a ...

How can we stop the brief display of a hidden div from occurring?

I have two divs on my webpage - one to display if JavaScript is disabled, and another if JavaScript is enabled. The issue I am facing is that even when JavaScript is not disabled, the div containing the message stating that JavaScript is disabled briefly ...

Order of tabs, dialog, and forms customization using Jquery UI

I'm currently working on a jquery dialog that contains a form split into multiple tabs. In order to enhance keyboard navigation, I am looking for a way to make the tab key move from the last element of one tab to the first element of the next tab. Cur ...

Trouble keeping the dropdown submenu from staying open

Trying to figure out how to keep my dropdown menu open only when clicked. Currently, the submenu disappears if I move my mouse away from it. I attempted using e.stopPropagation without success. Is there a CSS or Javascript solution that can help with this ...

Retrieve the content of the 'div' element, but exclude certain text

I have a task to copy the content from a div into a textarea, allow for editing within the textarea, and ensure that any changes made are saved back to the original div. I also need to filter out an attribute, such as data-bind: "some stuff;", set for the ...

Ways to structure a div to resemble a table

I'm currently working on a form that has multiple input fields, and I'm looking to structure them in a specific way. The layout I want to achieve can be seen in this example: https://jsfiddle.net/dmilos89/58ea82gj/2/ The example above utilizes ...

Develop a file upload progress tracker using jQuery and AJAX

I have successfully implemented an AJAX upload feature that displays a progress bar and percentage completion. However, I would like to enhance the user experience by creating a separate progress bar for each file being uploaded. Is it possible to achieve ...

Should you prioritize internationalizing your image alt attributes?

Do you localize your alt attribute in img tags for internationalization? Is it beneficial in the long run? ...

Exploring the latest features in Bootstrap 4 Alpha and enhancing your

Rumors have it that Bootstrap 4 will make its debut during the year 2016. When duty calls for an upgrade, is a complete re-write truly the best solution? Tackling such a project from Boostrap 2 to 3 was no small feat, and I find myself hesitant to take on ...

Introducing the World of Wordpress Blogging

How can I create an introduction on my WordPress site similar to the one found at ? I am specifically interested in incorporating the expanding horizon line effect. It seems like it may just be a GIF that plays and then fades into the homepage. Are there ...

Creating a Full-Width Dropdown in Bootstrap 4 Navbar: A Step-by-Step Guide

I'm attempting to create a dropdown that spans the full width of the screen and has a collapsible feature like many modern websites. However, I am having difficulty figuring out how to achieve this. I experimented with using Bootstrap's collapse ...

The size of the panel header does not seem to be adjusting as expected within the React

I need help adjusting the header size in a React-Bootstrap Panel within a Typescript application. I've tried wrapping the text in <h1> tags as specified in the documentation, but there seems to be no change. Even with attempts to add inline sty ...

Choose Option 1 in order to proceed with selecting Option 2 and displaying the outcome in the VueJs framework

Looking for help on how to show the text value from multiple related select fields. I want Option 1 to display a list of parent options. Upon selecting an Option 1, it should determine what values are available in Option 2 select field. After selection, ...

Eliminate extraneous space with the clearfix:after pseudo-element

Could use some help figuring out how to remove the unwanted whitespace caused by clearing the float (specifically after the tabs). Any suggestions on how to fix this issue? Take a look at the code snippet below (jsfiddle): /* Clearfix */ .clearfix:af ...

Can a submit button be created that integrates both a radio button and submission functionality?

Is there a way to combine a radio button and submit button into one element for submitting the value just with a click? Currently, I have a radio button and a separate submit button in my code, but I want to streamline it. This is the current code snippet ...

Move the object beyond the boundaries of the container that can be scrolled

I'm having an issue where the "item" is draggable, but once I try to move it outside of the scrollable container, it disappears. I've attempted adjusting the z-index, but it doesn't seem to be resolving the problem. Any suggestions on what m ...

What is the most reliable method for displaying an SVG shape in any color across various web browsers?

Is there a way to render a 2D SVG shape, which is flat and 100% black, in any color across various browsers? ...