Designing clean layouts with HTML and CSS by incorporating negative space

Is it possible for the body text to seamlessly fill the available white space next to the heading text, as depicted in the image?

Your feedback on this would be greatly appreciated.

.column {
  display: inline-block;
  column-count: 3;
  text-align: justify;
  column-gap: 20px;
  column-rule-color: green;
  column-rule-style: solid;
  column-rule-width: 10px;
}

h2 {
  column-span: all;
}
<div class="column">
  <h2>
    Inspired by the Traditions of Africa<br> BUt Ruled by a Contemporary Spirit
  </h2>
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took 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.It is a long established fact that a reader will be distracted by the readable content of a page when
</div>

Answer №1

After reviewing your responses, I have created a responsive solution for you. To add spaces between paragraphs, simply enclose each paragraph in p tags. (You can test the responsiveness by running and checking the snippet in fullpage).

<style type="text/css">
  .column {
    -moz-column-width: 30vw;
    column-width: 30vw;
    column-gap: 20px;
    column-rule-color: green;
    column-rule-style: solid;
    column-rule-width: 10px;
  }

  @media only screen and (max-width: 768px) {
    .column {
      -moz-column-width: 47vw;
      column-width: 47vw;
    }
  }

  @media only screen and (max-width: 480px) {
    .column {
      -moz-column-width: 100vw;
      column-width: 100vw;
    }
  }
</style>

<div class="column">

  <h2>Inspired by the Traditions of Africa
    But Guided by a Modern Spirit</h2>

  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took 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.It is a long established fact that a reader will be distracted by the readable content of a page when
</div>

Answer №2

Insert the following line of code into the h2 section: text-align: left;.

For an alternative effect, consider including margin-right: 50%; in the h2 as well.

<style type="text/css">
  .column {
    display: inline-block;
    column-count: 3;
    text-align: justify;
    column-gap: 20px;
    column-rule-color: green;
    column-rule-style: solid;
    column-rule-width: 10px;
  }
  
  h2 {
    column-span: all;
    /* add this line */
    text-align: left;
    margin-right: 50%;
  }
</style>

<body>
  <h2>
    Inspired by the Traditions of Africa <br> BUt Ruled by a Contemporary Spirit
  </h2>
  <div class="column">
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took 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.It is a long established fact that a reader will be distracted by the readable content of a page when
  </div>
</body>

Answer №3

The ultimate solution

 .column {
    display: grid;
    text-align: justify;
    gap: 20px;
    grid-template-areas: "header sidebar"
      "main sidebar";
  }

  h2 {
    grid-area: header;
  }

  p:first-of-type {
    grid-area: main;
  }

  p:nth-of-type(2n) {
    grid-area: sidebar;
  }
<body>
  <div class="column">
    <h2>Inspired by the Traditions of Africa But Ruled by a Contemporary Spirit</h2>
    <p>
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
    </p>

    <p>
      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.It is a long established fact that a reader will be distracted by the readable content of a page when
    </p>
  </div>
</body>

To resolve this issue effectively, one should eliminate column-span: all; from the <h2>, as only all and none are valid values for column-span. Alternatively, utilizing CSS grid can achieve a similar outcome.

 .column {
    display: inline-block;
    text-align: justify;
    column-gap: 20px;
    column-count: 3;
    column-rule-color: green;
    column-rule-style: solid;
    column-rule-width: 10px;
  }
* {
  margin: 0;
  padding: 0;
  position: relative;
  box-sizing: content-box;
}
<body>

  <div class="column">
    <h2>Inspired by the Traditions of Africa
      BUt Ruled by a Contemporary Spirit</h2>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took 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.It is a long established fact that a reader will be distracted by the readable content of a page when
  </div>
</body>

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

Issues with CKEditor's failure to save content in utf-8 character encoding

Let me explain my situation concisely. I'm encountering an issue with my PHP project that I can't seem to resolve. The problem arises when I try to update the content using CKEditor on my website. Below is the configuration and instance of CKEdi ...

Flow of Logic using HTML5 WebWorkers

I've been working with this primary js file: var worker = new Worker("../Scripts/worker.js"); worker.onmessage = function (event) { alert("Worker said : " + event.data); }; worker.postMessage("Naruto"); worker.postMessage("Sakura"); The content ...

The css property of *ngContainerOutlet is ineffective when applied to an ng-component with encapsulation

When I utilize *ngContainerOutlet to dynamically insert components, it wraps the component's template within an ng-component tag which causes my CSS styles to become ineffective. For example: <div class="my-class"> <ng-container *ngComp ...

Is it feasible to utilize Sublime Editor for building SCSS/SASS files? Learn how to compile SCSS/SASS with Sublime Editor

Despite numerous attempts, I have been unable to figure out how to effectively use the Sublime Editor for creating scss/sass files. ...

Conflict between Angular's ng-repeat directive and Sass styling

Currently, I am working on a project and encountering an issue that is causing some difficulty: In order to create a navigation bar with equally distributed list elements based on the number of items, I am utilizing ng-repeat for data binding and Sass for ...

Eliminate any undefined data in the popup map of Javascript

I am working with JSON data that is being displayed in a pop-up on a map. In cases where there is missing data (Visibility), the word undefined appears in the pop-up. Is there a way to remove the undefined text so that it does not show up in the pop-up? ...

Adjust the width of an element as its content dynamically shifts

I have a container that contains 6 input fields. Two of them are initially hidden (display: none), but when I click on a checkbox, these two inputs become visible (display: inline). I need the width of the container to adjust and increase when the other tw ...

Modify a section of text in iOS by swapping it with a new

In my string, I have the following HTML code - <html> <head> </head> <body> <p>***Some Text***.</p> <p><iframe allowfullscreen="" frameborder="0" height="360" src="//www.some-domain. ...

When I access the browser, it displays "???"" symbols instead of UTF-8 characters

When I view the website in my browser, it displays "???" instead of UTF-8 characters. How can I identify the cause and rectify this issue? Below is the content of the HTML file: <HTML> <title>Search Engine</title> <form ac ...

Main wrapper with CSS sticky footer and top margin

Currently, I am using the sticky footer code from http://ryanfait.com/sticky-footer/ and it works perfectly except for when I need to add margin or padding at the top of the page. The design I am working with includes a patterned body with all the content ...

Combining sticky user input and button side by side using CSS

I'm having trouble getting a user input and button to appear side by side and stay sticky at the top of the screen as you scroll. I've attempted using the float: left method and display:inline-block, but haven't had any success. Here is the ...

Identify whether a specific Instagram post is a video by utilizing Python with selenium

Good day, After reviewing the content on this post: () I managed to extract specific data using the following code: likes = driver.execute_script('''return document.getElementsByClassName('Nm9Fw')[0].lastElementChild.getElement ...

What is the best way to eliminate padding for a specific element within a div container?

In my bootstrap design, I have nested columns where the grey background color for my h3 element has gaps on the left and right due to the padding of the bootstrap columns. While I can remove the padding by using padding:0px, this will affect all elements ...

Does the opacity refer to the second argument in mat-color?

Does the alpha value come second when using mat-color? Here’s a demonstration: mat-color($warn, 0.15) ...

Trouble with setting the width of a fixed element within a parent div

My goal is to make an element's position fixed and have it take up the full width of its parent div. Below is the HTML I am working with: <div class="col-md-3"> <div class="player-avatar-card"> <div class="card-b ...

Guide on how to launch an Android app if it is already installed, or direct the user to the Play Store from a web

Looking to create an HTML page featuring a button with specific click event functionality requirements. If the corresponding app is already installed, it should open that app. If the app is not installed, clicking the button should redirect to the Google ...

The Ul Li tag cannot be aligned to the right

Having trouble left aligning the logo and right aligning the ul li tag? Despite using float, the code doesn't seem to work as expected. Take a look at the issue: It's puzzling because I've used the same code elsewhere and it worked perfectl ...

"Is it possible to apply CSS to all HTML elements except for a

I am looking to apply the specified styles to all elements except for a particular class and its descendants. html * { box-shadow: none !important; border: none !important; color: white; } I attempted the following but it did not work as intended: ht ...

Django authentication ensures secure access for users on

What could be causing the issue with self.request.user.is_authenticated() not functioning correctly in this specific view? class ArticleDetailView(DetailView, CategoryListMixin): model = Article template_name = 'mainapp/article_detail.html&ap ...

Exploring and Modifying CSS Styles in Element Properties

Struggling to remove a 50px gap on my website. It's built on Joomla 1.5 and the white space is highlighted in orange below. When I inspect element using Chrome, it shows a margin-bottom: 50px but doesn't specify the location. Any tips on how to ...