Create a custom CSS box layout inspired by the design of the Google Web

My website has a design similar to the Google Web Store. However, I am having an issue with the two boxes at the bottom not filling up the space above them.

The boxes are wrapped in a ul element and the items are in li elements. The list items are floated left and the ul has a clear.

If you would like to see the issue in action, here is the link to the jsfiddle: http://jsfiddle.net/wTCKr/

I would greatly appreciate any CSS or JS suggestions to fix this problem. Thank you!

Answer №1

To achieve larger boxes on the right side, it is necessary to float them to the right so that the smaller boxes on the left align correctly.

<li class="items big" style="float:right">

Take a look at this updated JS Fiddle fork for reference.

If you encounter issues with placing a large box in the middle, additional measures will be needed such as using absolute positioning along with jQuery or JavaScript to manage the layout effectively.

Update: I have created a solution using some JavaScript for absolute positioning in this example. The code utilizes jQuery but can be adapted to pure JavaScript if required. Ensure that the boxes are arranged correctly for this method to work flawlessly.

Answer №2

To achieve this effect, try using the CSS

ul { top: -200px or margin-top: -200px;}
.

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 use Promise.all() to delay the return of an array that is currently being constructed within the function?

In the following code block, I am trying to set an array as the value for a local variable by calling a function that returns an array. The issue arises because the Promises in the second function are not resolved until after the array has been returned to ...

Issue with Vue Composition API: Unable to append a property to an object

Currently, I am utilizing Vue's Composition API in my project. However, I have encountered an issue where the template renderer does not recognize changes when I add a property to a ref object. Below is the code snippet that demonstrates this problem: ...

Issue with ABCpdf failing to implement inline CSS styles

On my aspx page, I have a script containing the following CSS: <style type="text/css"> .subcontainer{margin: 0 auto; padding-top: 20px} .hide-val{display:none;} </style> While the page loads fine in the browser and the hide ...

Bring in LOCAL .obj for loading with Three.js OBJLoader in a React environment

Attempting to import a local .obj file using the THREE.OBJLoader().load() function is causing issues. While it successfully loads non-local URLs such as '', loading the local file takes a long time due to downloading it every time. The setup inv ...

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 >= ...

Is there a way to handle button click event when utilizing this.props.children in React?

I have recently completed a React component that serves as a modal wrapper. The content for this modal is passed through the props.children property. Inside the content, there is a button that, when clicked, should trigger an event in the parent component. ...

What could be the reason for v-model not functioning properly within vue.extend?

I've configured a page structure similar to the following: <main id="app"> <div id="mount-place"></div> </main> <script type="text/x-template" id="my-template"> ...some code her ...

What is the best way to delete these <li> tags according to their respective timestamps?

When the page loads, there are initially 5 <li> elements. Additional <li> elements are then randomly added every few seconds. I want to remove any <li> elements that have been on the page for more than a minute. My plan is to create an ...

How is UI Router Extras causing unexpected errors in my unit tests?

QUESTION: - I am facing failures in my tests after installing ui-router-extras. How can I resolve this issue? - Is there a way to use ui-router-extras without causing test failures? If you want to quickly install this, use yeoman along with angular-full ...

Troubleshooting: Why are the last CSS entries not loading in runserver (Django)?

Trying to solve a simple issue here. I have two HTML files with different CSS styles. The CSS code I wrote for the home page yesterday is working fine. However, today when I added some 'div' and 'class' elements to the second HTML (che ...

A property name needs to be included before the colon (' : ') in the declaration of a property value within an ASP.NET file

Just starting out with asp.net and decided to give lumen-bootstrap a try. Ran into an unexpected warning and now some of the buttons are not displaying properly. https://i.sstatic.net/WOH0N.jpg ...

Hierarchy-based dynamic breadcrumbs incorporating different sections of the webpage

Currently in the process of developing a dynamic breadcrumb plugin with either jQuery or Javascript, however I am struggling to implement functionality that allows it to change dynamically as the page is scrolled. The goal is to have a fixed header elemen ...

Tips for showing a message in the modal after a user completes the registration process

This code snippet contains an HTML form for user registration. Upon clicking the register button, users are redirected to another page. However, the desired outcome is to display the message on the same modal form. <div class="popup"> ...

WordPress AJAX code encountered a http400 Bad Request

I've recently started delving into website development and am currently working on a WordPress site. The issue I'm facing is similar to another query on SO, but that question doesn't involve jQuery.AJAX; instead, it utilizes jQuery.post with ...

Mastering the Integration of React in Node.js

I've been eager to experiment with Server Side Rendering in React, however, my code isn't functioning as expected. It seems like I might be overlooking something crucial. Being new to React, it's challenging to pinpoint the issue. https:// ...

Silent response upon click event listener

I'm having an issue with a navbar item not calling the reverseService function on click as expected. Although my IDE is indicating that the reverseService function is never used, VueJS dev tool doesn't show any problems. However, manually changi ...

Check if the value is a string and contains a floating point number; if so, parse and format the float

I need to work on formatting decimal values returned by an API that only responds with strings. The requirement is to add a leading zero but no trailing zeros to any decimal value in the string. If the value is not a float, it should remain unchanged. For ...

What is the best way to display a popup window on top of the parent window?

How can I display a popup window on top of the parent window when a button is clicked? I have tried using the Window.Focus() method, but the popup window keeps going back behind the parent window. I would greatly appreciate any help on this. Thank you in ...

Passing Props from _app.js to Page in ReactJS and NextJS

I recently made the switch from ReactJS to NextJS and am encountering some difficulties in passing props from _app.js to a page. My issue lies in trying to invoke a function in _app.js from another page. In ReactJS, this process was simple as you could cr ...

Is there a way to eliminate the black seam that is visible on my floor mesh that has been separated? I am utilizing A

I recently imported a large .glb file into AFrame. The model has baked textures and the floor is divided into multiple mesh parts for improved resolution. However, I am facing an issue where black seams appear on the separated parts of the floor, only dis ...