Enhance the organization of your current webpage by incorporating three divs positioned side by side

I currently have a webpage set up, accessible here: https://plnkr.co/edit/5NWm4E868nXYyixd2SLv?p=preview

The current layout looks okay, but I feel restricted in terms of customization. Therefore, I am interested in creating 3 divs where I can have more control over the positions of specific elements. Here is a visual representation of what I aim to achieve: Image Reference -> https://ibb.co/jDF6hF. This image conveys my goal better than words.

This is my current setup: https://plnkr.co/edit/sqpAWK1h6dECDyM1SaAl?p=preview

You might notice that the existing layout does not match the desired picture. Do you know of a more effective method to achieve the desired design?

#wrapper {
  overflow: hidden;
}

.item {
  float: left;
  width: 27%;
  outline: 1px solid blue;
  margin: 1% 1% 1% 1%;
  padding: 2%;
}

.imageleft {
  float: left;
  margin: 10% 00% 00% 20%;
}

.circle {
  border: solid 2px #73B7DB;
  background: #73B7DB;
  width: 100px;
  height: 100px;
  border-radius: 100px;
  text-align: center;
  line-height: 440%;
  font-size: 22px;
  text-decoration: none;

html

<div id="wrapper">
  <div id="text" class="item">
    <div id="midleft"><a class="imageleft circle" id="how"><font color="white">Wie</font></a></div>
    <div id="midleft"><a class="imageleft circle" id="how"><font color="white">Wie</font></a></div>
    <div id="midleft"><a class="imageleft circle" id="how"><font color="white">Wie</font></a></div>

  </div>
  <div id="module" class="item">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex
    ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse mole</div>



  <div id="image" class="item"><img class="imageright" src="https://placehold.it/300x200" /></div>
</div>

Answer №1

The image on the right-hand side is currently not adjusting to different screen sizes and it doesn't stay within its container. To make the image responsive, you can simply apply this CSS code:

.imageright {
    max-width:100%;
    height: auto;
}

Answer №2

I have undergone significant transformation. Initially, it is crucial to ensure that ids are unique on the page.

To achieve a responsive design, I utilized flexboxes for the layout.

.wrapper {
  display: flex;
  justify-content: space-between;
}

.leftColumn {
  width: 20%;
  display: flex;
  flex-direction: column;
}

.middleColumn {
  width: 55%;
}

.rightColumn {
  width: 20%;
}

.circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: lightblue;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle:not(:last-child) {
  margin-bottom: 1em;
}

.imageleft {
  color: white;
}

.rightColumn img {
  width: 100%;
  height: auto;
}

.rightColumn img:not(:last-child) {
  margin-bottom: 1em;
}
<div class="wrapper">
  <div class="leftColumn">
    <div class="circle">
      <a class="imageleft">Wie</a>
    </div>
    <div class="circle">
      <a class="imageleft">Wie</a>
    </div>
    <div class="circle">
      <a class="imageleft">Wie</a>
    </div>
  </div>
  <div class="middleColumn">
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex
    ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse mole
  </div>
  <div class="rightColumn">
    <img class="imageright" src="https://placehold.it/300x200" />
    <img class="imageright" src="https://placehold.it/300x200" />
  </div>
</div>

Answer №3

The main contrast between the image and your content lies in the proportions. Experiment with adjusting the widths of the .item elements to 15%, 60%, and 25%. Then, try converting the internal widths to relative values (this might be a bit tricky, consider replacing circles with images and setting width:100%). Furthermore, to visualize the appearance of the .item divs accurately, set the .item height to 100% or 100vh (viewport height).

Additionally, for more flexibility in layouts, explore css grid but make sure to consider browser compatibility.

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

Emphasizing hyperlinks according to the user's scrolling location

Currently, I am attempting to create a feature where links are highlighted when the user scrolls over the corresponding section on the page. However, there seems to be an issue with the functionality as Link 2 is highlighting instead of Link 1 as intende ...

The MUI component with hideBackDrop={true} is preventing me from clicking outside of the Drawer component to close it

I implemented a Drawer component which opens when an icon on the Map is clicked. The drawer menu appears along with a backshadow that drops over the map. Interestingly, clicking on the map while the backshadow is displayed closes the drawer without any i ...

Leveraging arrays generated from two separate MySQL queries for dual selection functionality with JavaScript

I have successfully populated the first HTML select with results from the first query. Now, I would like to store the results from the second query in either a Json file or XML and then use plain javascript (not jQuery) to populate the second HTML select ...

What is the correct way to center-align elements?

I have a basic grid layout that has been styled using CSS. #videowall-grid{ width:700px; border:1px dotted #dddddd; display: none; margin: 5px auto; padding: 5px; } #videowall-grid .square{ padding: 5px; margin: 5px; bo ...

Identify the significance within an array and employ the filter function to conceal the selected elements

I'm in the process of filtering a list of results. To do this, I have set up a ul list to display the results and checkboxes for selecting filter options. Each item in the ul list has associated data attributes. When a checkbox with value="4711" is c ...

What is the best way to combine PHP and HTML within a JavaScript script?

I'm facing a challenge with integrating dynamically added elements and a populated drop down on my form. Is there a way to combine the two seamlessly? Below is the code snippet I'm using for dynamically adding and removing elements: $(docu ...

I am having trouble sending the text of a selected list item from a dropdown menu to the controller from the view in MVC4. The controller is receiving a null value. Can someone please

This is my code snippet for creating a dropdown menu to select classes: <div class="dropdown"> <button class="btn btn-danger btn-lg dropdown-toggle" type="button"id="menu1" data-toggle="dropdown">Go To Class<span class="caret"></ ...

submit the data to the database

How can I successfully pass the value from the Ajax code to the database in this program aimed at displaying user details? There seems to be an error in the code for passing the value. What steps should I take to rectify this issue? function showUser() ...

The compatibility of IE9 with tables and the use of display: block

When optimizing my site for low-width mobile devices, I adjust the display property of various table elements such as tr, td, and th to block in order to stack them vertically. This technique helps wide tables to show all their content without overflowing ...

Conceal a div until reaching the end of the webpage by scrolling

Currently, I am working on a web page inspired by music release pages (check out an example here). My goal is to have certain hidden divs at the bottom of the page only reveal themselves once the user has scrolled all the way down, with a delay of a few se ...

Enhance your CSS link in Yii framework 2.0 by incorporating media printing capabilities

While working on Yii framework 2.0, I typically include a CSS file by adding the following code snippet to assets/AppAsset.php: public $css = [ 'css/style.css', ]; Upon inspecting the element in the web browser, I notice the following code ...

Display 'Div 1' and hide 'Div 2' when clicked, then reveal 'Div 2' and hide 'Div 1' when a different button is clicked

I need help figuring out how to make two separate buttons work. One button should display 'Div 1' and hide 'Div 2', while the other button should show 'Div 2' and hide 'Div 1' when clicked. My knowledge of jquery an ...

Retrieving the value of a radio button using JavaScript

I am working with dynamically generated radio buttons that have been given ids. However, when I attempt to retrieve the value, I encounter an issue. function updateAO(id2) { var status = $('input[name=id2]:checked').val(); alert(status); ...

Implementing a gradient effect on a specific image element within an HTML canvas with the help of jQuery

Currently, I'm working on an HTML canvas project where users can drop images onto the canvas. I am looking to implement a linear gradient effect specifically on the selected portion of the image. My goal is to allow users to use their mouse to select ...

Ways to apply CSS to a changing div ID

I am looking to apply CSS to a dynamically generated div ID. var status = var status = item.down().next().innerHtml(); if(status == "test") { var c = 'item_'+i ; c.style.backgroundColor = 'rgb(255, 125, 115)'; //'ite ...

When you hover over an image, its opacity will change and text will overlay

I am looking for a way to decrease the opacity and overlay text on a thumbnail image when it is hovered over. I have considered a few methods, but I am concerned that they may not be efficient or elegant. Creating a duplicated image in Photoshop with the ...

Adjustable header: resizing images and text overlay on images

Is there a way to make the images and text resize based on the size of the div or screen? I don't want the text to overflow the images when resizing. I've tried using the object-fit attribute but it hasn't worked. Any suggestions? <d ...

What is the reason behind having a selectedOptions property rather than just a selectedOption?

Why does the selectedOptions property of select return an HTMLCollection instead of just one HTMLOptionElement? As far as I understand (correct me if I'm wrong), a select element can only have one selected option, so why do I always need to access it ...

What is the process for incorporating themes into CSS?

At the moment, I have set up variables to manage colors for both light and dark themes (such as --light-background-color, --dark-background-color). Handling two themes is manageable with this approach, but it feels a bit labor-intensive. If more themes wer ...

Guide to Aligning Divs at the Center in Bootstrap 4

I've been attempting to center the div on the page using Bootstrap 4, however, it's not cooperating. I've tried using the margin:0 auto; float:none property as well as the d-block mx-auto class, but neither are working. Below is my HTML code ...