The HTML divider border is failing to encompass all of the subcontents

Giving HTML/CSS Django website creation a shot for the first time, appreciate your patience. I'm using a basic resume template and trying to troubleshoot an issue right from the beginning (template in question here).

In one section of my website, there's a visual glitch (here). The 1px line meant to divide sections is appearing below the headings instead of after the entire content of the section. This problem only occurs with stacked elements like these two sections.

The HTML code snippet causing this issue:

<div class="yui-gf">
    <div class="yui-u first">
        <h2>Skills</h2>
    </div>

    <div class="yui-u">
        <div class="talent">
            <h2>Multi-System Design</h2>
            <p>Proven experience with robotic systems spanning mechanical, electrical, and software backgrounds.</p>
        </div>

        <div class="talent">
            <h2>Interpersonal Reporting</h2>
            <p>Familiarity with reporting, documentation, and organization of technical design documents.</p>
        </div>

        <div class="talent">
            <h2>Problem Based Solutions</h2>
            <p>Involvement with team based, problem driven projects that solve a question rather than a set task.</p>
        </div>
        
    </div><!--// .yui-u -->
</div><!--// .yui-gf -->

Here is the relevant CSS:

.yui-gf {
    margin-bottom: 2em;
    padding-bottom: 2em;
    border-bottom: 1px solid #ccc;
}

.last {
    border: none;
}

.talent {
    width: 32%;
    float: left;
}
...

Frustratingly, I can't figure out why the spacing+divider is not aligning correctly with the elements, even though everything seems enclosed within the yui-gf container. Any insights would be greatly appreciated!

Answer №1

The issue likely lies with the floating of elements within the .talent class. When elements are floated, the parent element loses track of their height. Check the dev tools to confirm if the yui-gf class divs are ending prematurely.

To resolve this, consider removing the float and width properties from the .talent class, and instead use CSS Grid on the parent element to align its children in columns:

.yui-u {
  display: grid;
  grid-template-columns: auto auto auto;
}

Alternatively, you can specify specific column widths like this:

.yui-u {
  display: grid;
  grid-template-columns: 32% 32% 32%;
}

Additionally, note that the CSS definition for the .yui-gf class is missing a closing curly bracket in the code snippet provided.

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

Step-by-step guide to automatically submitting a form after obtaining geolocation without the need for manual button-clicking

I am looking for a way to automatically call a page to get geolocation data, and then submit the form to my PHP page with the values of getlat and getlon without the need to click a submit button. I have tried implementing the code below, however, despit ...

Unique CSS Styles for Border Radius

Is there a way to achieve rounded corners on only the top left and top right, but not on the bottom two corners of a div using a specific value for -webkit-border-radius? ...

Creating well-sized images using Bootstrap 3 column dimensions

While achieving this layout with CSS alone is simple, I'm having trouble implementing it using Bootstrap. I am looking to have an image where the text wraps around it, either floated left or right. However, I want the image to span 3 columns for medi ...

The functionality of jQuery's .hide and .show methods can sometimes result in unexpected behaviors while

I am experiencing some issues with this code snippet - it is causing some unexpected animations. The first issue is that it is lowering the content by about 1em during the animation and then moving it back up afterwards. The second issue is on the archive ...

PHP - POST Method - Consequences of exceeding the content length header in the POST request

My concern is not about the POST content limit specified in php.ini, but rather about a scenario where the content length in the request header is set to 1mb, yet 2mb of actual content is transmitted. ...

Exploring the Power of Nested *ngFor in Angular 2

I am struggling with passing indexes to a function where the first parameter (ii) is coming back as undefined. <div *ngFor="let tab of screen.data.tabs; let indexTab = i;"> <div *ngIf="tab.active"> <div *ngIf="tab.questions"&g ...

Deciphering the hierarchy of z-index stacking

I'm feeling a bit puzzled about how to determine the stacking order using z-index. I am struggling to grasp how browsers handle elements with the position property in comparison to those without it. Is there a set rule to establish the stack order o ...

How can I assign a class to my Typography component in Material UI?

When using my material-ui component, I wanted to add an ellipsis to my Typography element when it overflows. To achieve this, I defined the following styles: const customStyles = (theme) => ({ root: { textAlign: "left", margin: theme.spacing( ...

Show the chosen choice in a select dropdown with custom text using Angular

I successfully implemented this code snippet to display a dropdown list of countries and their phone codes. However, I encountered an issue where I need to only show the selected option's code without the country name. The first screenshot shows how i ...

How can I adjust the view port height to display the footer on the screen without the need for a scroll

Exploring some css techniques. I'm attempting to display the footer on the page without requiring a scrollbar. My approach involves subtracting the footer's height from the content wrapper div. Unfortunately, this method doesn't seem to be e ...

Is it advisable to avoid using XHTML elements, tags, and attributes that will not be included in the HTML 5 specification?

Given that I am currently utilizing XHTML 1.0 Strict, does it make sense to avoid using XHTML elements, tags, and attributes that are not included in the HTML5 specification? For example: <acronym> and <big> ...

Adjusting the size of the iframe on-the-fly

Scenario: Currently, I am tackling a project involving developing a responsive design using the standard HTML/CSS combination. Everything seems to be working smoothly except for one specific situation where an iframe is nested inside a div. The challenge l ...

Is it possible to incorporate a label within a dropdown menu (<select>)?

How can I add a label inside a select box using Bootstrap? Here is an example: Before selecting an option After selecting an option, the label should appear in a small size like this: After selecting an option : <div class="form-group"> & ...

Show stored procedure query results in ASP.NET MVC

After spending over 8 hours attempting this task, I seek assistance. Please take note of the edit at the bottom. Implementation of Stored Procedure CREATE PROCEDURE SIX6 (@YEAR INT) AS BEGIN SELECT * FROM (SELECT Song ...

The nested div does not have scrolling functionality

I'm currently working on making a nested div scrollable, but I'm encountering some challenges. The problematic div in question is the one with the "items" class. <body> <div class="page-wrapper"> <div class="header">Heade ...

Why do the back button and custom scroller behave differently on two different webpages?

I’ve added the malihu custom scroller to my website, but it’s behaving differently compared to how it works in the demo. I can’t seem to figure out what's causing this discrepancy. For reference: Demo: check here Website: visit here The fo ...

Having difficulty accessing object property using Chunk Template Engine

I am working on a project where I have created a list of objects and now need to retrieve the object name from a template using the Chunk Template Engine. The object list has been initialized as follows: html.set("items", new Item[]{new Item("Item 1", 2) ...

Reorganizing elements on mobile screens using a grid system

I am working with a simple grid layout: .container{ display:grid; gap:20px; grid-template-columns: repeat (12, 1fr) } .container >*{ grid-column-start: span 12 } @media(min-width:768px){ .item{ grid-column-start:span 6 } } ...

Is the styling of inline form elements compromised by validation in Bootstrap 4?

I'm facing an issue with validating an inline form field using Bootstrap 4. Whenever the validation is triggered, the width of the inline form field jumps. You can see the problem in action by clicking Enter without entering a value on this fiddle: h ...

Tips for adjusting the width of a div to accommodate word wrapping

Can a div element be resized when word wrap occurs? To illustrate, take a look at this example from a similar query: .mypost { border: 1px solid Peru; margin: auto; min-width: 200px; display: inline-block; background: red; } .test { margin: ...