Utilize CSS to create a column layout

I have some HTML output that I would like to style using CSS, but unfortunately I have no control over how the HTML is generated and cannot make any changes to it.

Right now, I have a two-column layout set up here: http://jsfiddle.net/uvg6f3tr/

I'm trying to move all fields after "language" back into column 1 or give them a negative margin. I've attempted this, but I can't seem to break out of the second column and display the results below in the first column. If possible, I'd like to escape the columns altogether at this point.

Any help would be greatly appreciated.

div.person dl {
    -webkit-column-count: 2;
    -moz-column-count: 2;
         column-count: 2;

margin: 0px;
width: auto;
}

dt { clear:left }
dt, dd { float:left;}  
<div class="inline dataplugin_entry person sectionedit2">
   <!-- Insert embedded code here -->
</div>

Answer №1

The CSS columns specification emphasizes the importance of maintaining balanced content between columns, ensuring they have equal height.

According to the Mozilla developer network,

The CSS3 Column specification mandates that column heights should be balanced, with the browser automatically adjusting the maximum column height to achieve approximately equal content heights in each column.

While this balancing behavior may initially seem restrictive in terms of arbitrary column breaks, there is a column-fill property that can potentially alter this behavior. However, support for this feature is currently limited to Firefox and may not fully address your specific issue.

One potential workaround could involve setting the height or max-height of the container containing the columns using a proportional unit like EM. By constraining the column heights just beyond where the language element is rendered, it might create the illusion of a single arbitrary column break.

In the absence of widespread column-fill support, achieving an ideal layout may require a balance of content distribution before and after the desired element, or proportionate division based on the column count. Alternatively, utilizing the break-after property as specified in the document could provide a solution, although its compatibility remains limited at present.

To maximize compatibility, combining break-after with the -webkit-column-break-after property, along with setting column-fill to auto and adjusting the height to limit the parent container's size below the language element, could help better cover various scenarios (particularly for Firefox).

It's important to acknowledge that CSS columns themselves do not enjoy universal support, with notable lack of support from Internet Explorer 9. Therefore, accepting some limitations in achieving arbitrary column breaks across all browsers may be necessary.

Answer №2

Perhaps this could serve as a beginning

     dt, dd {
     display:inline;
 }
dd::after {
    content: '\A';
    display: block;
}

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

String iteration with Stylus

Is there a way to remove the brackets and the quotation marks when putting media queries into an object and looping over them? The code works well, but the stylus is causing the output to have unwanted characters. Here's my code: $maxBreakpoints = { ...

Enhance a disabled button by incorporating a ripple effect

I've got a button that toggles on and off depending on the required form fields. When it's enabled, clicking it activates a ripple effect. Now I'd like to have the ripple effect even when the button is disabled. I attempted something simila ...

QuickSearch displayed at the center with a floating left alignment

I have been trying to center a QuickSearch div with multiple Q & A sections, but I am having no success. The div is floated to the left and has a background image. HTML <div class="l-row"> <div class="QuickSearch"> <div class="loop"& ...

Tips for changing the CSS properties of input elements in iView

Exploring Vue's single file components and experimenting with the iView UI framework. Here is a snippet of code I am working with: <template> <div> <i-input class="cred"/> </div> </template> I want to adjust the ...

Issues with the functionality of the bootstrap modal jQuery function in Firefox, causing problems with scrollbars and dynamic modal height adjustments

My newly launched website is built using bootstrap v3 and modals to showcase detailed information about each game server that is queried. Each modal provides insights into the current players on the server, their score, and play time. While implementing ...

Unique CSS-created chronological schedule with alternating design

I am looking to customize my CSS timeline by removing the first line and changing the color of each individual circle. How can I achieve both of these modifications? I attempted to add a class called .not_complete to one of the timeline containers, but it ...

Ensuring even distribution of three divs within a container

Imagine a container that is 1200px wide, with three divs inside. Each div is only 292px wide. The first div should align with the left margin, the third div with the right margin, and the second div should sit right in the middle of them. Adding to the c ...

Employ a for loop to generate custom shapes within the canvas

EDIT: I will be sharing all of my code including the HTML and JS. Pardon me for the abundance of comments. I am attempting to generate rectangles in a canvas using a for loop (taking user input) and then access them in another function to perform certain ...

Tips for adjusting the size of a drawing on an HTML 5 canvas within a personalized Polymer component

In my custom Polymer element, I am looking to dynamically resize an html5 canvas when the window resize event occurs. Despite trying to utilize the window.onresize event, I encountered difficulties with accessing canvas functions. One of the functionalit ...

utilizing symbols from a vector graphic icon库

There are countless icon images to be found on the internet. Recently, I came across this particular set and now I'm stumped on how to actually utilize them. Despite my efforts to find tutorials online, I have come up short in finding any helpful reso ...

Ways to reposition Material UI tabs at the base of a container such as AppBar?

I'm looking for advice on how to position <Tabs within an AppBar at the bottom of a parent container, effectively placing them at the bottom of the header. Currently, I have divided the header into three sections: top-bar-left, top-bar-tabs, and to ...

What is the best way to continuously execute the 'onclick' function using AJAX inside a specific ID?

My challenge involves implementing a new AJAX upload feature to insert a data element from the onClick event in multiple rows. The issue I am facing is that it works fine for the first row, but when I add subsequent rows, the function no longer works upon ...

Reverse all elements on the page except for ::selection

Is there a way to invert the page while keeping text selection unchanged? I attempted to use ::selection to exclude it, but was unsuccessful. Below is the CSS code I used for inverting the page: html { background-color: #131313 !important; filter: cont ...

What is a more efficient method for generating HTML code using PHP variables?

My online store showcases a variety of products, each housed in a div with the id content block. The link, image, background, description, and price for each product are all retrieved from a mySQL table. Initially, I planned to store the HTML code below as ...

What is the best way to apply styling exclusively to a child component?

I am currently working on a coding project that involves a parent component and multiple child components. My main goal is to adjust the position of a filter icon by moving it down 5 pixels on one specific child component. The issue I am facing is that no ...

The widths of inputs vary between FireFox and Chrome

I've been investigating why the widths in FireFox and Chrome show a significant difference. This variation is causing a problem with my Modal in the views. Chrome: FireFox: Upon comparing the photos, it's clear that the width of the input in C ...

Images of varying sizes aligned at the bottom of cards, organized in rows with pure CSS styling

I am working on a layout that involves a container with "cards": images positioned above with related text below. Here's an example: <div class = "cards"> <div class = "card"> <div class = "image-wrap"> <img src= "im ...

issues stemming from the css of leaflets

This is my first time using leaflet and I am encountering a CSS issue. I'm not sure if there is another CSS file for leaflet, but whenever I try to adjust its position, it changes unexpectedly. I have a floating nav bar that should appear when scroll ...

Do I need to utilize a Form element?

<p>text 1<span>additional information 1</span><span>more details</span></p> <p>text 2</p> <a> hyperlink </a> <button>submit</button> <p>yet another paragraph</p> Greeting ...

Vue.js component still not transitioning out despite using mode="out-in"

As I navigate my way through learning about vue.js, one issue that has been puzzling me is how to make routed pages fade in and out when a user switches to a new page. Despite thinking it would be a simple task with vue, I have been struggling quite a bit ...