What is causing the divs to behave in this floating manner?

I'm experiencing an issue on my website where the divs are floating in a strange manner. The layout displayed on the original theme's page (http://demo.fabthemes.com/revera/portfolio/) is correct, but mine seems off. I have reviewed the code and CSS files multiple times, but I can't identify the problem.

Any insights on what might be causing this mishap?

Answer №1

To ensure a consistent height, simply define the min-height:

article.post, article.page, section.error-404 {
  margin-bottom: 40px;
  min-height: 240px;
}

Answer №2

Your label extending onto two lines is causing dissatisfaction.

Perhaps setting a fixed height for the h3, or incorporating elements with clear:both; after every fourth item, could resolve this issue.

Answer №3

The height varies in different situations. Follow these steps:

div.box, div.sidebar, section.footer {

padding-top: 20px;

max-height: 500px; <----

}

Answer №4

Since some titles span across two lines, the blocks' heights vary. To ensure they all stay in one row, apply this css:

.portbox h3 {
    height: 1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

You can also assign a fixed height to h3 that accommodates two rows (or however many may be needed).

Answer №5

It is necessary to enclose every set of 4 columns within a div with the class "row"


<div class="row">
    <article class="col-sm-3 col-6 portbox post">... </article>
    <article class="col-sm-3 col-6 portbox post">... </article>
    <article class="col-sm-3 col-6 portbox post">... </article>
    <article class="col-sm-3 col-6 portbox post">... </article>
</div> 
<div class="row">
    <article class="col-sm-3 col-6 portbox post">... </article>
    <article class="col-sm-3 col-6 portbox post">... </article>
    <article class="col-sm-3 col-6 portbox post">... </article>
    <article class="col-sm-3 col-6 portbox post">... </article>
</div> 

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

Having trouble retrieving POST data with NodeJS/Express and an HTML form?

I have encountered an issue in my application where I am unable to extract the posted data from req after performing an action pointing to a nodejs endpoint. Despite successfully executing the action, when attempting to access the posted data from req, I a ...

jQuery-powered unique serial numbers for tables

I've encountered an issue with my dynamic table that consists of 2 dynamic rows including students, their subjects, and marks. The code in question is provided below: Feel free to check out the code here Snippet for Serial Number function gene ...

Is it feasible to implement the Bootstrap GRID System?

Hello there! I am currently exploring a potential scenario. When viewing on a desktop or laptop, the layout should look like this: <div class="col-md-3"> sidebar </div> <div class="col-md-9"> article </div> On a smaller screen, ...

jQuery is displaying fields inside the widget box that were supposed to have been removed

I am currently working on a project with a widget foldable box function called Metadata Widget. This widget displays certain fields, and I have added an import button to the side that calls upon the Metadata Widget and shows it. However, I have noticed tha ...

What is the best way to align the subsequent sub-elements to the right edge of the initial child element in a left alignment

Here is the HTML snippet I am working with: .entry{ border: 1px solid gray; } .list_number{ color: red; border: 1px dashed gray; margin-right: 5px; } .entry_body{ border: 1px solid green; } <div class="entry"> <span class=" ...

Tips for customizing a red error input box in AngularJS when the cursor is present but no content has been entered

I am working on implementing validation in my form using AngularJS. My goal is to have the input box turn entirely red when there is an error. Currently, after I receive an error and delete the text with the cursor still inside the box, the color of the bo ...

Centering the viewport on a spacious website

Currently, I am working on developing a horizontal website that spans 16000px using a specific template that can be found at the following link: http://tympanus.net/Tutorials/WebsiteScrolling/ The website is divided into four sections, each 4000px wide. M ...

Troubleshooting: Difficulty getting CSS `position: absolute` to correctly position a div above all other elements

In my current project, I am utilizing Javascript, specifically the VueJS framework, to create a page named mainTextEditor. This page consists of a text field and a 'popup' that is implemented using a div with a v-if directive to show the div when ...

Illustration tucked beneath the menu

I am looking to create a landing page for my project similar to the design on this website. I am using Bootstrap 4 and HTML, but struggling to hide the background image behind the navigation bar. Can anyone help with this issue? ...

Struggling with pinpointing the specific element

I'm struggling to select an element within a nested <ul>. In this code snippet, my goal is to pinpoint the <a> tag that follows the parent <li> <ul class="wc-block-product-categories-list wc-block-product-categories-list--dept ...

AngularJS selector, offering similar functionality to jQuery

There are 3 div elements with the same class in an HTML code snippet: <div class="hide"> </div> <div class="hide"> </div> <div class="hide"> </div> In jQuery, all the div elements can be hidden with a single code sta ...

The ongoing challenge with the 'active' class in jQuery

Here is an example of a menu: <ul class="nav nav-list"> @for (int i = 1; i <= pageno; i++) { <li> <a href="~/Insts?page=@i&count=10">@i</a></li> ...

ways to create a separation between floated elements

For my photo wall, I am trying to create a specific pattern where every 1, 10, 11, 20, 21, and 30 displays a big image sized at 160x165. In between each pair of big images are 8 small images sized at 85x80. The first line works as expected with one big im ...

Issue encountered during the uploading of a single image via ajax

I'm encountering an issue with uploading a single file via AJAX. Here is the code I am using: JavaScript File var _submit = document.getElementById('fileInputBox'); var formData = new FormData(); formData.append('upload', ' ...

Having trouble loading CSS in Firefox?

After creating a basic responsive website, I encountered an issue where Mozilla was not loading the CSS properly when the site was hosted on my server. Interestingly, the CSS loaded fine on Chrome and IE when viewed from my computer. Here is a snippet of ...

Having multiple divs lined up horizontally on a single row

I am trying to create three divs in a single row similar to this: https://i.sstatic.net/A63Sx.png Any assistance on how to achieve this setup would be greatly appreciated. ...

Activate radio button exclusively for admin user

My current application includes an admin panel with functions to manage users. I use a while loop in the form creation to display 3 user types: Admin, Manager, and User, which are pulled from a database. Admin Manager User This is how my HTML Form look ...

Selecting a specific value in Vue.jsNeed help in

My HTML code includes these lines: <v-select v-model="user2_id" :options="[{!! $users !!}]" class="select"> </v-select> <input type="hidden" v-model="user2_id" name="user2_id"> The variable $users is defined as follows: <?php $l ...

Having difficulty erasing the existing input

I'm trying to create a form input field in JavaScript that generates a specified number of additional inputs based on user input. The issue I'm facing is that while the code works and adds more input fields, it does not delete the previously gene ...

Assess the equation twice using angular measurement

I am attempting to assess an expression that is originating from one component and being passed into another component. Here is the code snippet: Parent.component.ts parentData: any= { name: 'xyz', url: '/test?testid={{element["Te ...