Issues encountered while trying to style an unordered list using the table-cell property

I am having trouble formatting the "How it works" section on my website. When the text is too long, the numbers on the left side grow alongside it as shown in number 4.

Is there a way to keep the numbers fixed on the left while allowing the text to expand freely on the right without affecting the numbering? Thank you!

.uli {
    list-style: none;
    float: left;
    width: 100%;
    padding: 0;
}

.uli li {
    padding-bottom: 80px;
    float: left;
    width: 100%;
    position: relative;
}

.uli li span {
    border-radius: 50%;
    border: 1px solid #eaeaea;
    width: 100px;
    height: 100px;
    line-height: 30px;
    margin-right: 10px;
    background-color: #eaeaea;
    display: inline-block;
    position: relative;
    text-align: center;
display: table-cell;
    vertical-align: middle;
color: #fff;
font-size: 3em;
}

.uli li:before {
    content: '';
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    left: 49px;
    background: #eaeaea;
    z-index: -1;
}

.uli li:last-child:before {
    display: none;
}
.uli .ulcontent{
display: table-cell;
    vertical-align: middle;
padding-left: 100px;
}
.entry-content .uli > li{
    list-style-type: none;
}
<ul class="uli">
<li>
<span>1</span>
<div class="ulcontent">
<h3>First Contact</h3>
<p>You can contact me and discuss your idea. If you want, you can do so <a href="#">Here</a></p>
</div>
</li>
<li>
<span>2</span>
<div class="ulcontent">
<h3>Web Consulting</h3>
<p>We will arrange an interview to get to know each other and clarify the project's fundamentals.</p>
</div>
</li>
<li>
<span>3</span>
<div class="ulcontent">
<h3>Web Design</h3>
<p>The creation of a design for your project begins based on its specific needs</p>
</div>
</li>
<li>
<span>4</span>
<div class="ulcontent">
<h3>Development</h3>
<p>Once the final design is approved, we start the development phase, where the theme is programmed entirely from scratch and all web functionalities are added.</p>
</div>
</li>
<li>
<span>5</span>
<div class="ulcontent">
<h3>Implementation</h3>
<p>At this point, the content is added, customized, and transferred to your server so you can manage it yourself.</p>
</div>
</li>
<li>
<span>6</span>
<div class="ulcontent">
<h3>Pre-Consultation</h3>
<p>We will meet via video conference to introduce ourselves and lay down the foundations for what will be your new membership site. Are you ready? Let's go!</p>
</div>
</li>
</ul>

Answer №1

To enhance the appearance of the content, consider applying the following styles to the <span> element located within the <li> element:

display: block;
float: left;
line-height: 100px;

View the updated code on CodePen for reference.

Updated Version

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

Ways to extract variables from a component and utilize them in App.js

Despite my efforts to search online, I could not find the answer or understand what I needed to. My issue: I need the "inputVal" variable from the "InputField.js" component to be accessible in the "App.js" component (specifically in the fetch request where ...

Django: Troubleshooting problem with offcanvas PDF preview iterations

Hey everyone! I'm in the process of creating a webpage that features a table with metadata regarding PDF files. To enhance user experience, I want to provide users with a preview of stored files in an off-canvas format. This is my HTML file setup: & ...

The process of loading a unique home page based on the screen size of the device

Looking for assistance on dynamically loading different home pages based on screen size. Any suggestions? For instance, if the screen size is less than 960px, I would like to show the default landing page as index1.html and if the screen size is greater t ...

Mobile browsers are displaying fonts unevenly within tables

Currently in the process of developing a desktop site () that should function optimally on mobile browsers without the need for a separate mobile version. While mobile Safari scales up fonts in large text blocks, tables used for content are causing some is ...

Avoid creating a line break directly after the header, however allow for a line break

I find myself in a scenario where I require a paragraph that has a specific format: An Emphasized Title Some relevant information regarding the subject... I am looking to insert a new line before the title, ensuring it seamlessly integrates with the re ...

JavaScript error - Property value is not valid

When I use IE 6/7/8, I encounter a JavaScript error message. The problematic line of code reads as follows: document.getElementById('all').style.backgroundColor = color; The specific error reported in IE 6/7/8 is as follows: Invalid property ...

"Having the same meaning as $(this) in jQuery, the CSS

Is there a CSS equivalent to the Jquery selector $(this)? For example: .widget h4 { background: black } .widget:hover h4 { background: white } In this scenario, when any element with the .widget class is hovered over, the child h4 changes its background ...

The current state of my DOM doesn't match the updated value in my model. The update is triggered by a function that is called when a button is clicked

app.controller('thumbnailController', function ($scope) { debugger $scope.customers = [ { name: 'Ave Jones', city: 'Phoenix' }, { name: 'Amie Riley', city: 'Phoenix&ap ...

Warning: The DataTables alert has been triggered for table ID DimStatus. It is indicating that an unknown parameter, 'Code', has been requested for row 0 and column 0 during the initialization

https://i.stack.imgur.com/yEpSp.pngI am encountering an error while attempting to display my data in a datatable. The structure of my table is as follows: [Table("DimStatus", Schema = "dmg")] public class PolicyState { [Key] ...

The Jqueryui image link is not displaying the image despite no error being reported

Can anyone help me figure out what I'm missing? I'm currently working with ASP.NET MVC 5 and have downloaded the JqueryUI combined via Nuget package. Despite no error references for css/js files, the close button is still not showing in the ima ...

unable to establish a connection to SQL in [PHP]

I'm having an issue with my code and need some help fixing it. The website is supposed to allow users to add, edit, and delete data. However, when I fill out the fields and click "add", it redirects me to a blank page. Here's the code that I have ...

Evolving fashion trends

I'm looking to dynamically change the style of my HTML element based on screen size, similar to this example: <p [ngStyle]="{'color': isMobile() ? 'red' : 'blue'}">Lorem Ipsum</p> The code above triggers a m ...

The deletion request using the form in Express is experiencing issues and not functioning properly

When attempting to delete data from a database using a form in node.js and express, I am encountering issues with the deletion process. It seems that there are only two methods available - get and post - and no specific delete method. router.js code rout ...

In relation to CSS and HTML

I recently started working on a website built with HTML/CSS and encountered an issue with links highlighting when hovered over. The problem arises from the main image on the homepage containing an embedded link, causing the area under it to also highlight ...

Can you explain the significance of the characters '& > * + *' in JSX (CSS)?

When using material UI, the progressbar demo includes lines of JSX code like this: '& > * + *': { marginTop: theme.spacing(2), }, Can you explain what the selector '& > * + *' represents in this context? ...

How can we prevent the navigation from fading out when scrolling back up, as JQuery control the opacity of the Nav to fade in?

Looking for some guidance on jQuery assistance. I currently have a fixed navigation bar at the top of my webpage with an initial opacity set to 0 upon page load. As the user scrolls down, I want the navigation bar to fade in using the following code: fun ...

What is the best way to extract the value from an anchor element?

To retrieve the value from an input tag, we can use <id>.value like this: <input type="text" #solutionInput (keyup)="0"><br> <solutionDetail [solutionName]="solutionInput.value" > </solutionDetail> Here, 'solutionInput& ...

The CSS property 'clear:both;' is not functioning properly on IE7 browsers whereas works fine on IE8/IE9, Firefox, Chrome, and other browsers

I have been receiving feedback from visitors about some issues on one of my websites. Those who reached out to us are using IE7 on Windows XP. I was able to recreate the problem by using IE7 or by mimicking it in compatibility mode with IE7 document mode o ...

Selection of child elements using CSS selectors

I have the following HTML snippet and I want to target the second child with the class name "embed": <div class="embed-container">test</div> This is what I tried: .feature-row .threecolumns .caption:nth-child(2) { border: 1px solid red; ...

Width and left values don't play well with absolute positioning

I am encountering an issue where a div with absolute positioning, which is a child of another absolute positioned element, is not behaving as expected. Despite setting width:100%; left:1px; right:1px on the child element, it extends beyond its parent. < ...