Challenges with Masonry blog layouts across various web browsers

Looking for assistance from experienced web designers!

I am working on creating a masonry layout for my blog archive pages. I want all the posts to be the same size to form a perfect grid. The layout appears correctly in Safari, but Chrome and Firefox are causing issues. In those browsers, the columns are not aligned properly with the title in one column and the featured image overflowing into the next.

I attempted to fix this by adding {max-width:75%; height:900px;}, which resolved the problem in Chrome but created a new issue in Firefox and distorted the layout in Safari (with columns overlapping the sidebar).

Here is the link to the blog archive page:

Below is the CSS code I am currently using:

.archive #content {
column-count: 3;
column-gap: 1em;
column-rule: 0 solid #666;
-webkit-column-count: 3;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-moz-column-gap: 1em;
-moz-column-rule: 0 solid #666;
-o-column-count: 3;
-o-column-gap: 1em;
-o-column-rule: 1px solid #666;

}

.archive .blog-post-wrapper {
border: solid 1px #b3b3b3;
display: block;
margin: 5px 0 25px;
padding: 5px;

}

.archive .image-wrap {
width: 220px;
height: 170px;

}

.archive .thumbnail img {
padding: 0;
height: 100%;
width: 100%;

}

.archive #content p {
display: none;

}

.archive #content .blog-big {
margin-bottom: 0 0 10px 0;

}

.archive .blog-big {
margin: 0;
padding: 0;

}

.archive h2.post-title {
background-color: #ffffff;
max-width: 100%;
display: block;
text-align: center;
padding-top: 8px;
padding-bottom: 5px;
margin: 0;
color: #fff;
text-decoration: bold;
font-family: 'questrial' !important;
height: 45px;
font-weight: bold;
line-height: 8px;

}

.archive #content h2.post-title a {
font-size: 16px;
text-decoration: bold;

}

.archive #content .socials {
display: none;

}

.archive #content .blog-signature img {
display: none;

Answer №1

To align all elements with the class .blog-post-wrapper to the left and give them a specific height, you can use the following CSS code. I tested this in Chrome and the alignment worked perfectly.

Give this a try:

.archive .blog-post-wrapper {
border: solid 1px #b3b3b3;
display: block;
float: left;
height: 262px;
margin: 5px 0 25px;
padding: 5px; 
}

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

Switching ng-Idle countdown time from seconds to minutes is possible by adjusting the configuration settings

I have implemented ng-idle in my application, where the warning popup appears after 10 seconds with the message: "Your session will be close in 10 seconds" However, I need to change this to minutes. The session should be closed in 5 minutes instead. How ...

Is there a quick way to import all available font weights from a Google font?

I am looking to experiment with importing all weights and styles of a Google font, such as Roboto or Roboto Slab, in a CSS file. Is there a more efficient way to do this rather than listing out each individual style in the @import? ...

The "if" statement carries out the identical action each time it is executed

Despite my efforts to toggle the value of the turn variable every time the if statement runs, I keep encountering the same outcome. It appears that turn consistently evaluates as 2. Below is the code snippet in question: $(function() { var turn = 2; ...

Customize CKEditor by automatically changing the font family when the page is loaded

How can I change the font-family of CKEditor to Meiryo based on a JavaScript boolean? I attempted this code in my custom JS within an if condition, but it did not successfully change the font-family: config.font_style = { element : 'span&apo ...

Guide on inserting a dropdown menu following a specific count of <li> elements using Javascript or Jquery

I am currently working on an HTML project <div class="ktmsg"> <ul> <li class="a1"> <a title="Link Tools" href="#"> … </a> </li> <li class="a2"> <a title="Link Tools" href="#"> ...

Incorporate Bootstrap and SCSS by utilizing class names within the SCSS code rather than directly in the HTML files

When working with Bootstrap 4, I have discovered the text-truncate class that can be used in an element. For example: <span class="text-truncate">Any very long text</span> Now, my goal is to apply this text-truncate class to multiple objects ...

React component causing footer overlap

Currently, I'm facing a challenge in creating a footer that stays at the bottom of the page without overlapping any other components. In my index file, I've included the following code: .footer{ margin-top: 1rem; padding: 1rem; background- ...

What is causing an increase in height for an inline-block element when using overflow: hidden?

When exploring this specific example, the mysteries of CSS and HTML unfold... HTML Structure <body> <div> <div>foo bar</div> </div> </body> CSS Style Rules body, html, div { height: 100%; margin: 0; } di ...

The Bootstrap 4 dropdown seems to have a one-time use limit

I'm currently working on a dropdown menu using Bootstrap 4. The dropdown menu is functional, but I'm facing an issue where it only toggles once. I have tried various solutions recommended on different websites, but none of them seem to work. Belo ...

Creating a dynamic CSS animation with multiple spans for typing effect

I have made some progress with this project. Here is the link to what I have so far: http://codepen.io/tacrossman/pen/GJglH However, my goal is to have the cursor blinking animation running after each new word (span) is written out. When I attempt to ad ...

Strategies for reliably causing IE 10&11 to crash? Simulating the phenomenon of "Internet Explorer abruptly closing and reopening the tab"

Here's an interesting query. Is there a method to consistently trigger this error in Internet Explorer 10 & 11 using Javascript, CSS or HTML? An issue with this website is forcing Internet Explorer to close and reopen the tab. I'm not trying ...

Is there a way to automatically scroll to the bottom of a div when it first

Looking to enhance my application with a chat feature that automatically scrolls to the bottom of the chat page to display the latest messages. Utilizing VueJs: <template> <div id="app"> <div class="comments" ...

Auto adjusting textarea height as per content length

Is there a way to adjust the height of the text area based on the content entered by the user? I want it to automatically increase as the user types and decrease if they delete content. ...

Angular: Autocomplete field automatically shifts focus when an item is removed

I am currently working on an Angular 2 application that utilizes PrimeNG components. One of the UI features includes an autocomplete component with multi-select functionality (p-autoComplete) similar to the one showcased in the official documentation: < ...

Alter the path within a paragraph tag in html

I'm having some trouble changing the direction of a tag inside another tag. It's not working correctly for me. In the example below, I want to see aslami @ exactly as I have written it, but the result is showing @ before a instead of after i. ...

The Card Component from Core UI fails to appear in the Print Preview feature

I'm currently experimenting with the Card Component from the Core UI framework. However, I'm facing an issue where the color of the Card component and its associated icon do not appear in the Preview when trying to print the page. I attempted to ...

Develop a circular carousel using React JS from scratch, without relying on any third-party library

I am looking to replicate the carousel feature seen on this website. I want to mimic the same functionality without relying on any external libraries. I have found several resources explaining how to achieve this. Most suggest creating duplicate copies o ...

Tips for adding a class to an SVG when clicked

I want to make an SVG change color to white when clicked and its container (icon_container) to change to blue. How can I achieve this? Below is the code snippet: state = { active: false, }; click = () => { this.setState({active: !this.state.active ...

Adjust the width of the list items based on the specified condition

I need assistance with adjusting the width of items in a list. The list includes: <ul> <li>One</li> <li>One-One</li> <li>Two</li> <li>Two-Two</li> </ul> The display should be dyn ...

Display the mobile Navbar only when scrolling to the top (using Bootstrap 4)

My goal is to have the navbar on mobile only appear when the user scrolls to the top of the page. Currently, it remains fixed at the top regardless if the user is scrolling up or down. I found this code snippet here: Here's a live example: This is ...