What are the steps to design a fluid responsive grid with three boxes?

I really need help creating a responsive grid using CSS and HTML. The image below should give you an idea of what I'm trying to achieve. Thank you in advance for any assistance!

Here is the image as a reference:

https://i.sstatic.net/FO9q5.png

Answer №1

If you're looking for a top-notch framework, consider using bootstrap!

Their grid system is incredibly helpful :)

All the resources you need can be found here:

http://getbootstrap.com/css/#grid

Hopefully this information proves useful :)

Answer №2

Despite my beginner status with CSS and HTML, here is my attempt at styling:

<div class="wrapper">
    <div class="Box1">
        Box1
    </div>

    <div class="container_right">
        <div class="Box2">Box2</div>
        <div class="Box3">Box 3</div>
        <div class="Box4"> Box4</div>
    </div>
</div>

CSS:

.wrapper {
    overflow:hidden;
    width: 1060px;
    margin:0 auto;
    padding:5px;
}

.wrapper .Box1 {
    float:left;
    margin-right:10px;
    width:520px;
    padding:5px;
    background-color:#808080;
}

.wrapper .container_right {
    width:520px;
    float:right;
}

.container_right .Box2 {
    width:100%;
    height:200px;
    margin:5px;
    padding:5px;
    background-color:#808080;
}

.container_right .Box3 {
    width:50%;
    height:200px;
    padding:5px;
    background-color:#808080;
}

.container_right .Box4 {
    width:50%;
    height:200px;
    padding:5px;
    background-color:#808080;
}

Answer №3

Stack Overflow operates on the principles of learning, trying, failing, and seeking help when needed. It is crucial to put in effort on your own before asking for assistance.

There are numerous methods to create a layout like this, but here is an example using Bootstrap with images as content. Some tweaks have been made to adjust the spacing between elements.

Fiddle:

https://jsfiddle.net/csy1wypc/1/

HTML:

<div class="container-fluid">
  <div class="row">
    <div class="col-md-6 col-sm-6 col-xs-6">
      <div class="single">
        <div class="img-holder">
          <img src="http://lorempixel.com/g/900/400/">
        </div>
      </div>
    </div>
    <div class="col-md-6 col-sm-6 col-xs-6">
      <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
          <div class="double">
            <div class="img-holder">
              <img src="http://lorempixel.com/g/800/400/">
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-6 col-sm-6 col-xs-6">
          <div class="single">
            <div class="img-holder">
              <img src="http://lorempixel.com/g/600/400/">
            </div>
          </div>
        </div>
        <div class="col-md-6 col-sm-6 col-xs-6">
          <div class="single">
            <div class="img-holder">
              <img src="http://lorempixel.com/g/700/400/">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

CSS:

.col-md-6,
.col-md-12,
.col-sm-6,
.col-sm-12,
.col-xs-6,
.col-xs-12 {
  padding: 0;
}

.row {
  margin: 0;
}

.single,
.double {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.single {
  padding-bottom: 100%;
}

.double {
  padding-bottom: 50%;
}

.single .img-holder,
.double .img-holder {
  position: absolute;
  width: 100%;
  text-align: center;
}

.single img,
.double img {
  position: relative;
  max-height: 100%;
  left: 100%;
  margin-left: -200%;
}

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

Enhancing Your Product List with PrestaShop Print Capabilities

I am having an issue with printing specific features from a product list: {if isset($product.features)} <div class="features"> {foreach from=$product.features item=feature key=key} {if $key < 2} <table ...

Adjusting the layout of tables for an accordion design

I am facing an issue with displaying the accordion in a table layout. When I expand them, the arrangement gets disrupted. To see the table layout for the accordion, you can check it here. <div ng-controller="AccordionDemoCtrl"> <label class="che ...

Tips for updating the selected value in Vue dynamically

I am currently working on a feature where the months change dynamically based on the selection made using Vue. You can view the code snippet in the link provided below. <div id="app"> <span class="selectboxWrap"> < ...

Disappearing Image on Hover in JavaScript and HTML

I'm encountering an issue with my JavaScript hover effect on two images. When a user hovers over the arrow image, it should change to a hover version of that image. Additionally, if the user clicks on the arrow, it should trigger another JavaScript fu ...

After trying out the demonstration on the website, I am unable to get my submit button to work

Having trouble with my Formsubmit feature. Despite following the example on the website, my submit button doesn't send anything and the verification isn't reaching my email. Currently working with Angular. <form action="https://formsubmi ...

The background image is cropped at both the top and bottom edges

Check out this JSFiddle link: http://jsfiddle.net/SoSoDef/uhx3o62f/1/. The code seems to be running fine, but I'm facing an issue where the image is being slightly cut off at the top and bottom for some reason. -webkit-background-size: cover; Can an ...

Can an iPhone be enabled to detect other devices within the same local network?

If you have five devices connected to the same local network, can iOS device 1 function as a central hub that "discovers" the other four devices on the network and communicates with them in a server-like manner? Would establishing communication through a ...

What's the best way to ensure a div's height and width are equal when implementing responsive design?

I am currently working on a responsive design and facing challenges in making div's height and width equal. Initially, I set the div's width as a percentage and height as auto, but this caused the divs to not display properly. To resolve this iss ...

Personalized jQuery mask customization

After experimenting with a masking function that conceals numbers based on a specific pattern, I am now looking to make it more flexible for users. For instance, if a user types 123456789, the field will display as XXX-XX-6789. Currently, the pattern is ...

How can I change the default selected option for a radio button in a React application?

I am having trouble setting the default checked radio button to lime in my radio button group. Even though I have set lime as the default value, it doesn't seem to work. Here is the code snippet that I am working with and I am looking for a solution ...

What is the best way to create a dynamic menu icon using CSS?

I am currently developing a CSS animation that is inspired by this. I have made progress and almost reached my goal, but I am facing some difficulties in getting it to work perfectly. For those unable or unwilling to visit the links: I aim to create an ani ...

Alter the style of a div by clicking on a button

Can the background image of a div be changed by selecting a button outside of the div? For example: HTML <div id="change"></div> <div id="buttons"> <button class="button1">this</button> <button class="button2"> ...

Ways to create distance between DIV elements?

On my WordPress generated page, I am looking to add AdSense below the header. You can view an image of the layout here. I have attempted to create space between the header and the AdSense ad by applying margin-top and padding to the div that contains the ...

Trouble with Exec Command InsertHTML: Content not Going to Correct Position in Content Editable Div Tag

Need to add an image using the insertHtml execCommand within a content editable div. Take a look at the following code snippet. function createSelection(node, chars, range) { if (!range) { range = document.createRange() range.selec ...

Can you explain the distinction between div and span tags?

HTML includes two main tags, div and span. I am curious about the specific functions and roles of each tag. I have experimented with both but haven't been able to identify any significant differences. Can someone provide a detailed explanation on the ...

Create a grid or flex layout with Bootstrap 4 that features a sticky first row and column

Does anyone have any suggestions on how to make the attached grid/table layout responsive using Bootstrap 4's flex/grid system? The layout should include a sticky first row and column for navigation items. I attempted using w- & h- classes, but it do ...

How can I validate a password input in a form on click and reveal a hidden div on the same page without refreshing?

I've been attempting to create a password-only form that reveals a hidden div on the same page when the correct password is entered. I want to avoid reloading the page, but I'm unsure of how to achieve this. function checkPassword() { var co ...

Customize HTML template with unique data fields

Hey everyone, I'm trying to create a template html file and customize certain data within it. I've been looking for ways to achieve this and the only solution I came across is shown below: <div w3-include-html="tmp1.html"></div> ...

How to position a div in the center of the screen with an overlay

While this code functions well in Firefox, it unfortunately does not work in IE. I am seeking a solution to properly center the div on the screen - Currently, the div is leaning too much towards the bottom In addition, I require the div with an id of "l ...

What methods can I use to locate and delete body selectors within CSS styling?

Currently, I am in the process of enhancing my PHP skills by identifying and removing body selectors within style tags. The objective is to eliminate any occurrences of body selectors that could potentially alter the body section of my HTML, especially pro ...