I'm experiencing an issue where articles are not appearing as inline objects on my page

I need assistance in figuring out why my articles are not displaying in one line, even though they are set to be inline-block elements (each article includes an image, h3 text, and a paragraph). Below is the CSS code I am using:

#article_1{
    width: 1000px;
    margin: auto;
}
  
article {
    max-width: 33%;
    display: inline-block;
}

article img {
    max-width: 100%;
}

Below is my HTML code:

<body>
<header><h1>News page</h1></header>

<section id="article_1">
    <article>
        <h3>Kamal has chosen the sexiest man alive!!!</h3>
        <div id="article_img" style="background:url(./photos/sex - Copy.jpg)"></div>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. texttook a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
    </article>
</section>
<br>

Answer №1

From what was shared, it seems like the text may be wrapping around?

Give this a try

section{
    max-width: 50%;
    display: inline-block;
    white-space: nowrap;
}

Keep me posted on the outcome!

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

Adjusting the height of a table cell in HTML: td without making it

Here's the issue I'm facing: I have an HTML <table> with a fixed height of 100px and no border. Inside this table, there is one row (with a 100% height) containing 5 td elements (each also with a height of 100%). Within each td, there is a ...

How to style FullCalendar to apply background-color for the entire day, not just the event using the 'addEventSource' method

Is it possible to add a background color for the entire day, rather than just for the event itself? The code I've written currently only displays the events with a background color. <script> $(document).ready(function() { $.ajax({ u ...

Access the second argument in the method `document.getElementById("box5" && "box14")`

I need help with a script that should set the variable trouve_coupable to true only if both box 5 and box 14 are checked on my HTML page. However, no matter what I do on the page, whenever box 14 (="case14") is checked, it always returns true whe ...

Background image investigation

As a newcomer to web development, I am facing challenges in achieving the desired look for my first website. Despite spending over 2 hours researching and testing various CSS properties, I have not made much progress. What I aim for is quite straightforwa ...

What steps can be taken to display database results solely for the user currently logged in and created by them?

Currently, I'm in the midst of a project that involves extracting an HTML list from JSON data using JavaScript. The list is being displayed on the logged-in user's profile, showcasing job listings from the JSON data. While I've successfully ...

Employing PHP to iterate through and separate items into disparate divs

For my project, I need to loop through 12 items and separate them into different divs. Specifically, I want to group 0 and 1 together in one div, have 2 in its own div, 3 and 4 in another div, 5 in a separate div, and so on. <!-- Grouping 0 and 1 --> ...

What is causing the .sr-only class to malfunction in Bootstrap 5?

Currently, I am working on creating a one-page form using Bootstrap 5: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge& ...

Implementing snow animation exclusively to a targeted div

I found some helpful code at and now I'm facing an issue where the snow effect is falling all over my page instead of just within the banner div... // Storing Snowflake objects in an array var snowflakes = []; // Browser window size variables v ...

Conceal a list of items within a div that has a particular class

This is a sample of my HTML code: <div class="row"> <div class="col-md-12"> <div class="scrollbox list"> <ul class="list-unstyled"> <li id="articulate.flute">articulate flut ...

Color each row in PrimeVue DataTable based on the value of a specific column item

Recently, I came across a PrimeVue DataTable with a specific structure: <DataTable value="info"> <Column header="Name" field="name" /> <Column header="Desc." field="desc" /> <Colu ...

Modifying the color of the chosen item - ion-select

Can anyone help me with changing the color of the selected item on ion-select? I've tried several solutions without success. Any suggestions? Documentation: https://ionicframework.com/docs/api/select I attempted to use the color property, but it did ...

When two unique Ids are merged to modify the same div button in distinct ways

Hey there, I'm having a little issue with getting the password_photo_galleries to appear in the right place on my website. The only solution I've found is to add an extra button to the navbar to access that information. Ideally, I want the MyGall ...

Issues with HTML Labels disrupting Bootstrap Grid Columns layout

Here is the HTML code I am working with: <div class="row"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3"> @*@Html.LabelFor(s => s.BasicInfo.FirstName)*@<label>First Name:</label> </div> <div clas ...

Is it possible to eliminate jagged edges in CSS 2D rasterization by applying anti-aliasing to subpixels?

It appears that the HTML/CSS engine automatically rounds values to the nearest whole px unit. It would be interesting to see non-discrete sizing options (floats). A closer look reveals that in Chrome, widths/heights are rounded to the nearest physical pix ...

What is the best way to align this div tag with the right side of the box?

https://i.sstatic.net/ezRuE.png .left { width: 50%; display: inline-block; float: left; } /* Second user block */ .right { border-color: lightskyblue; background-color ...

What is the best method to dual-layer backgrounds in Tailwind without causing any conflicts between them?

I want to create a unique design where one container acts as an accent for another. Essentially, I have a styled text box and underneath it, I want a similarly sized container with a different background color that can be positioned in the bottom-right cor ...

Having trouble populating the container with page content using AJAX, PHP, and JS?

Whenever I attempt to use the buttons to change the content, I keep receiving a 'There is no such page!' message. Below is the index.html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- ...

Turn off the automatic resizing of Internet Explorer 11 to fit the width of the viewport - IE11

Is there a way to stop Internet Explorer 11 from automatically zooming to fit the viewport width? I need the browser to respect my max-width rule and not scale the content to fill the entire width of the viewport on its own. This issue is happening in IE ...

Inconsistent Failures Plague JQuery-Servlet Post Requests

Recently, I have started working with JQuery and encountered a strange issue. When I try to post my HTML form data to a servlet and print it out, most of the time (about 7 out of 10 times) it works perfectly fine with new values. However, the other 3 times ...

HTML form for sending data to an express route with specific parameters

Looking for some help on routing in express. I currently have a form that collects user input and submits it to the /images route, but I would like it to instead submit to /images/:s1. This way, I can utilize the URL parameters effectively. Any suggestio ...