Enhancing divs with border using CSS Transforms

I'm currently in the process of constructing an isometric grid made up of cubes using CSS, but I've encountered a problem with outlines.

Here's my desired outcome: cube design However, this is what I have managed to achieve so far:

html cube I've attempted various techniques such as incorporating translateZ and adjusting backface visibility, but without success.

This is how my CSS currently looks:

.cube {

transform: rotateX(55deg) rotateZ(45deg) translateX(50%) translateY(-50%);
transform-origin: 0% 0%;
transform-style: preserve-3d;
position: relative;
pointer-events:all;
transition: background-position ease 7s;
background-size: 400% 400%;


div {
  position: absolute;
  transition: background-position ease 7s;
  backface-visibility: hidden;

  &:first-child {
    transform-origin: center top;
    width: 100%;
    height:100%;
    transform: rotateX(-90deg);
    top: 100%;
  }

  &:nth-child(2) {
    transform-origin: left center;
    width: 100%;
    height: 100%;
    left: 100%;
    transform: rotateY(90deg);
  }
}

Any suggestions or insights would be greatly appreciated.

CodePen Link

Answer №1

To create a unique effect, consider overlapping the faces of the cubes and applying the background-blend-mode CSS attribute for a seamless blend between them. This technique eliminates any odd borders between the cubes.

Check out the codepen example here: https://codepen.io/anon/pen/LXzWjJ

You may need to experiment with transforms and dimensions to achieve your desired outcome.

While not perfect, this approach seems to get the job done effectively.

I hope you find this information helpful!

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

Creating a Collage with Varied Image Sizes

Hey there, I'm trying to achieve something that seems simple, but I can't quite figure it out. What I want to do is query a table and display the results in two separate divs on my webpage. Here's an example of the HTML structure I have: &l ...

Using Rails to load an image from CSS

My current approach to loading an image is using this code: <div id="bglion"><%= image_tag("BG-LION6.png")%></div>, which successfully displays the image. However, I am interested in loading the image from a CSS file instead. After resea ...

"Limitation observed - function operates only on first attempt

I have been working on a map project that involves pulling information from Google about various locations using the library available at https://github.com/peledies/google-places In order to troubleshoot and identify the issue with the code related to ma ...

Troubleshooting problem with Django Material's navigation bar

Currently, we are utilizing Django Material (MaterializeCSS as CSS framework) for a new project in progress. We have encountered an issue with the language selector located in the admin navbar. Interestingly, this problem only occurs in Firefox and not in ...

Reposition text below images in Meta Slider

I have a website where I am utilizing Meta Slider within Wordpress. I would like to position the captions below the images instead of on top of them. Meta Slider claims this feature is only available in the Pro version, but could it be achieved by adjustin ...

Tips for achieving a Google Map that smoothly slides behind a sticky header as you scroll

I recently added a sticky header using CSS to my long HTML page. At the bottom of the page, there is a <div> element with a Google Map embedded in it. As I scroll down the page, the content scrolls behind the sticky header as expected, but the Googl ...

How to style a div for printing using CSS

Currently, I am working on a project that has already been completed but now requires some enhancements. To give you an overview, the project includes a search functionality that displays additional details upon clicking on the displayed name in the result ...

Who is responsible for triggering a PostBack?

I am trying to identify the control that triggers a page PostBack within the Page_Load event, as there are multiple controls on my page. ...

Issues with Bootstrap Carousel Slide Show functionality in FireFox

I have implemented a Bootstrap-5 Carousel Slide Show for the website banner. It is functioning correctly in Google Chrome, but there seems to be an issue when viewed in Firefox. The Firefox browser version I am using is 90.0.2 (64-bit). Upon inspecting the ...

Running a continuous JQuery function loop

I need assistance with creating a continuous image fade in and out effect. Currently, my code looks like this: $(document).ready(function(){ $(".slider#1").delay(1000).fadeIn(2000); $(".slider#1").delay(1000).fadeOut(2000); $(".sli ...

The jQuery scroll function is not working for the span class I specified. What could be causing this issue?

I attempted to implement a scroll-to plugin to move between elements on a page when clicking previous and next buttons. The source demo works differently from my modified version, and I am struggling to figure out where I went wrong. Source demo: My Curr ...

How should a frame be correctly inserted into a modal in Bootstrap?

I'm currently working on incorporating a frame into a CSS modal, but the current display is not quite ideal. Additionally, I manually adjusted the frame's position (top and left), which is causing misalignment issues for different screen sizes, r ...

Unable to find the iframe using the contains method in xPath

Having trouble targeting this particular iframe element. The ID of the iframe keeps changing, so I have to use a wildcard in my XPath expression. <iframe id="cardinal-stepUpIframe-1659117883889" src="about:blank" frameborder="0& ...

Is the background image viewport centered?

I am embarking on a new venture with a website design that is unfamiliar to me, but I have a clear goal in mind... My design concept involves a single large image measuring 1000px x 1000px as the background, while the actual content fills up only 500px x ...

How to choose a particular Excel spreadsheet in Angular before importing the file?

I am currently working on a new feature that allows users to choose a specific Excel worksheet from a dropdown list before importing a file. However, I am facing some difficulty in adding the worksheet names to the dropdown list. Right now, I have placehol ...

How come my padding isn't working on an anchor tag, but it works fine on a button element?

Consider this code snippet: .ul { list-style-type: none; } .li { display: inline-block; border: black solid 1px; margin-left: 20px; } .btn { padding: 20px; text-transform: uppercase; } <ul class="ul" ...

Vertical tabs in Bootstrap display content when hovered over

I have implemented some tabs using Bootstrap and I want to show these tabs when hovering over them. Here is the link to view the tabs: https://jsfiddle.net/uzfxmrs3/ Below is the HTML code for the tabs: <div class="d-flex align-items-start respon ...

My CSS is stubbornly refusing to reload, despite my efforts to provide a unique link for each loading

Greetings fellow web developers! As a newbie in the field, I recently launched my very own WordPress site. Exciting as it is, I encountered some challenges while trying to make last-minute modifications to the stylesheet. Despite ensuring that the changes ...

What could be the reason for Angular Router to receive query parameters twice?

I have an application that consists of two pages with lists. On Page A, clicking on an item will display the corresponding detail page. The detail page contains a list of sub-items, and clicking on any sub-item navigates to Page B with the sub-item's ...

oversized user interface selection container

When using semantic-ui for my search form with large input fields, I am facing an issue where the select option field does not adjust its size. I have followed the documentation but it seems like I might be missing something. Can someone help me figure out ...