HTML5 offers the ability to display multiple lists side by side with different

Looking to align three different types of lists next to each other: an unordered list, an ordered list, and a description list. I've experimented with various methods but haven't had success getting them to display side by side. If anyone has insight on the correct way to achieve this, I'd appreciate it. Here is how I attempted it:

       #schedule {
} 
#schedule ul {
    list-style-type: none; 
    display: inline-block;
}
#schedule ol {
    list-style-type: none; 
    display: inline-block;
}
#schedule dl {
    list-style-type: none; 
    display: inline-block;
}

This was my CSS code for the following HTML structure:

    <aside id="schedule">
            <h2>Favourite Teachers</h2>
            <ul>
                <li>Steve Sutherland</li>
                <li>Steve Sutherland</li>
                <li>Steve Sutherland</li>
            </ul>
            <h2>Favourite Classes</h2>
            <ol>
                <li>Web Programming</li>
                <li>Tim's</li>
                <li>The Den</li>
            </ol>
            <h2>Favourite lessons</h2>
            <dl>
                <dt>First Webpage</dt>
                    <dd>Got me hooked</dd>
                <dt>Images and videos</dt>
                    <dd>Endless joke possibilities</dd>
            </dl>
    </aside>

Answer №1

Enclose them in div tags and use CSS to float the div elements.

<div class="first">
<ul>...</ul>
</div>

<div class="second">
<ol>...</ol>
</div>

<div class="third">
<dl>...</dl>
</div>

CSS Code :

.first, .second, .third{
    float: left;
    margin-right: 50px;
}

Fiddle Link : http://jsfiddle.net/cmmabu8n/

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

What is the process of integrating unique themes into a non-Wordpress website?

In the process of developing my website, I am using PHP7, HTML5, CSS3, JQuery, and JavaScript5 instead of WordPress. One feature that I want to incorporate is the ability for users to customize their theme beyond the default option. How can this be achie ...

Is a webpage's sluggishness in Internet Explorer due to its lengthy page structure causing issues while loading quickly on other browsers?

My application has a page that is particularly long, around 8Mb of source HTML mainly comprised of tables. I am aware that this indicates poor architecture, but unfortunately, I am unable to make immediate changes due to certain constraints. In most brows ...

D3 and Select struggling to conform to HTML layout

I've been putting in a lot of effort working with D3 to align my HTML layout, but I'm struggling to get my charts to align as desired. What I'm aiming for is: BAR CHART 1st PIE CHART, 2nd PIE CHART, FIELDSET So, what I need ...

Exploring the differences between pseudo-elements when styled as display:block versus display:inline

I'm currently honing my CSS skills by following a Youtube tutorial from freecodecamp.org Here's the code I've been working on: p::before{ content: "hello "; color: white; font-size: 60px; background: salmon; margin-bottom: 20px ...

Using Selenium to locate and identify content based on HTML attribute names

To confirm the presence of specific HTML content or items on a page using known unique identifiers, I am seeking to utilize Selenium (or a similar framework). While I have the ability to mark HTML tags with an attribute, I sometimes encounter situations w ...

Customizing badge colors in Bootstrap using data from MySQL

Is it possible to dynamically change the color of Bootstrap badges based on MySQL data using PHP only? For example, if I have a column with 'status = 1', which is a TINYINT datatype and can have one of three different status values, I want each ...

Encountered a problem while trying to update a list item in Vue.js

Greetings Everyone, I've successfully implemented a basic CRUD functionality in VueJS. The values are being inserted into a list, from which I can read and delete them. However, I'm facing an issue with updating any value. When I try to ...

How can SQL databases be retrieved and showcased on a webpage?

Aside from JSP, PHP, and ASP.Net, what other methods are available for retrieving data from a database? Using jQuery, Bootstrap, and AngularJS is one option. Are there any other recommendations? ...

The HTML table fails to refresh after an Ajax request has been made

I am currently utilizing Ajax to delete a row from the Roles table. The functionality allows the user to add and delete roles using a link for each row. While the deletion process works properly and removes the row from the database, the table does not get ...

What is the best way to incorporate a percentage-based width scrollbar?

Help needed: I want to implement a scroll feature for the parent div but here's the catch - the width of the text inside the div needs to be in percentage. So, if there is a long name, it should scroll within the parent div. HTML: <div id="list"& ...

Adjusting the size of images using CSS

Assuming an image has dimensions of 200px by 200px and is assigned a CSS class with the same measurements, will the browser retain the image size or still attempt to resize it through CSS? Lately, I have been investigating ways to decrease page loading ti ...

There appears to be a CSS problem cropping up on the right side of my website

Kindly pay a visit to the following URL: dev.dgconcepts.com.pk https://i.stack.imgur.com/sBC4Dm.jpg I am puzzled by the fact that whenever we swipe left or right on mobile responsive, the website shifts slightly on both sides. I am unable to identify ...

What is the best way to initiate a JavaScript AJAX call within a PHP function?

My PHP if statement currently just reloads the page: header('Location: index.php'); Check out the site here Instead, I am looking to use a basic AJAX request in JavaScript to load a page called register-success.php into the div: function load ...

Is there a way to make the content overlap the video when I scroll down?

My goal is to create a scrolling effect where the content in the div underneath slowly overlaps the video as I scroll down, similar to the design on the Minecraft homepage. ...

Issues with FlexItems not fully occupying available space when using flex wrap

Before presenting my question, here is the relevant code snippet: const App: FC = () => { const [boardWidth, _setBoardWidth] = useState<number>(1400); const [boardHeight, _setBoardHeight] = useState<number>(1000); const [cellWidth, _se ...

As you press down on the mouse button, the number starts to slowly decrease and then picks up speed in decrementing

Having encountered a perplexing MouseDown issue, I find myself seeking guidance. Here's what I need in "pseudocode" While ("#arrowUp").mouseDown(function() { counter++; //Increments immediately upon press if(MouseDownTime > 500){ //After 5 ...

Trouble with jQuery click event on dynamically generated elements

I have a jQuery function that iterates through each element inside a specified div (#container) and triggers a JavaScript alert whenever a span is clicked. Everything functions correctly when the spans are static. However, when I include code like this: ...

Adding an overlay to a material UI table row: Step by step guide

My code is rendering a row in the following format: `<TableRow key={row.name} > <TableCell>{row.empId}</TableCell> <TableCell>{row.userId}</TableCell> <TableCell>{row.name}</TableCell> <TableCell>{r ...

Choosing the Following Date from the Datepicker using Selenium IDE

I need the selenium IDE test case to automatically select a date following the steps outlined below: Start by clicking on the departure date to open the datepicker Loop through the dates starting with the currently selected day until the next available d ...

What is the process for securing a photo to a canvas?

I have included <input type='file' id="image"> in my HTML code. How can I display the uploaded image on my canvas using p5.js? What is the best way to add an event listener to this action and transfer the uploaded file onto the ca ...