What steps can be taken to make sure padding impacts all lines, not just the first one?

I have added padding to a span of text using Bootstrap. However, the issue arises when the text goes to the next line using < br > - the padding for that line and beyond disappears.

Here is the specific code causing this problem:

<div class="col-sm-12 d-sm-flex d-md-inline align-items-sm-center justify-content-sm-center ">
                    <div class="py-md-20 mx-md-10">
                            <span class="py-sm-40 px-sm-20 px-md-70">
                                Before any Service or Repair we will carry out a full check of the bike to ensure the bike is safe and you <br> are getting the service that best suits you and your bike. 
                            </span>

                            <span>
                                <button class="b-button__outline text-bg-info"> Book Assessment </button>
                            </span>

                    </div>
                        </div>

To see the issue more clearly, external stylesheets are required. You can visit https://codepen.io/nisofwareengineer/pen/ExxyoVR.

The phrase ''are getting the service that best suits you and your bike.'' appears to be lacking padding.

My goal is to achieve a layout similar to this: https://i.sstatic.net/QB9fX.png

What am I missing in my implementation?

Answer №1

Experiment with

span {
  display: block;
}

or test out

span {
  display: inline-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

Sending unstyled HTML content using JavaMail

Can anyone offer guidance on sending an email using JavaMail with unformatted HTML tags? Here is the code I am currently using: public void sendMail() throws MessagingException, IllegalStateException, IllegalArgumentException { Properties properties ...

How can you center the initial line of formatted text while keeping the rest left justified using just CSS?

I need help with formatting existing data without using JavaScript. The goal is to make the first line bold and centered, while the rest of the lines should be justify formatted. However, I'm having trouble achieving this as either the first line gets ...

When a value is deleted from an input in jQuery, all other changes become void

I am experiencing an issue with Javascript where even after deleting or changing the value of a field, jQuery effects still persist. Is there a way to reset all changes made when the input value is deleted? For example, you can visit , type 6 in and then ...

Is there a way for me to determine the value or array that has been passed in the form?

I am facing a challenge and need help solving it. I have a project that involves interacting with a database, where I created a CRUD HTML table for data manipulation. There are 15 tables in the relative database, and I need to insert, delete, and edit reco ...

What methods are available to create distinctive, shareable links akin to those utilized by Zoom and Google Hangouts?

I'm currently developing a group video chat app and I'm facing the challenge of generating distinct shareable links for every chat room created. Can anyone guide me on how to accomplish this? My aim is for users to easily join the chat room when ...

Web Security Vulnerability: Cross Site Scripting Detected

In our code, we are aiming to prevent XSS (Cross Site Scripting) attacks. However, the solution may involve a combination of JS (JavaScript) and HTML escaping, which could prove to be quite challenging. Below is a snippet that closely resembles our code: ...

What are your thoughts on using image maps with CSS?

My images are also links, and the code looks like this: <a href="../www.google.com"><img src="pages/squirrely.png" /></a> While they function properly as links, I want them to only be clickable if you click on the central part of the im ...

Adjusting the content of a single text box by typing in another

Is it feasible to automatically convert a Nepali date input in one textbox into an English date and display it in another textbox without any page refresh? I have a PHP function that can translate dates between Nepali and English, and I want it to execute ...

The hamburger icon seems to be frozen and unresponsive

I'm struggling to get my hamburger icon to reveal the navigation bar when clicked. The icon itself functions properly and adapts to different screen sizes, but the overlay remains stationary. Check out my code on JSFiddle! <html> <head> ...

Guide on extracting targeted information from a paragraph using htmlAgilitypack

When scraping data using htmlAgilityPack, everything seems to be working fine. However, I encountered a situation where I need to extract the description from a paragraph p tag. The paragraph p tag contains the following description: <p> <small& ...

Creating unique ID tags using AngularJS

I am struggling with creating an HTML structure that looks like this: <ul> <li id="r1_1">Root node 1 <ul> <li id="child_node_1">Child node 1</li> <li id="child_node_2">Child node 2</ ...

When accessing the defaultValue property of a select element, it will result in

Here is a typical HTML dropdown menu: <select name="email" id="email"> <option value="2" selected="selected">Before redirecting to PayPal</option> <option value="1">After payment is successful</option> <opti ...

The placement of my footer is off and not aligned with the bottom of the page

I am struggling to make my footer align with the bottom of the page rather than sticking to the bottom of the browser window and moving along with the scroll. How can I fix this issue? The goal is to have the footer remain out of sight at the bottom of th ...

I need to condense my layout from three columns to just two columns in HTML

The html code for "Date Accessed" is meant to be in one column as a header, while the actual dates should be in another column, but somehow they are all appearing in a single column. I am having trouble figuring out why. <!DOCTYPE html> {% load stati ...

What is the best method for overriding the CSS rule for input[type=checkbox]?

My checkmark follows this rule: input[type=checkbox] { display: none; } I tried to change it like this: <input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" style="display:block;& ...

Aligning the page content in perfect harmony with the footer

I've encountered variations of this question in the past, but I haven't found a solution that fits my specific needs. My challenge involves having a footer fixed at the bottom of a page, even when the content doesn't fill the entire page. Ad ...

Troubleshooting HTML image visibility issues

I've been trying to get a Tumblr icon to display in the upper-right corner of my HTML-based page, but all I see when I open it in a browser is a white box with a gray outline. The code I'm using for the image is: <img style="float: right; mar ...

Attempting to place a different span beneath the current span

Is it possible to add another span below the first span and keep it on the same line as the circle? Check out this link for reference The following is the HTML code snippet: <div class="dialog-box"> <div class="dialog-box-circle"></d ...

Storing a selected date from a Bootstrap datepicker into a MySQL database with JSP

I am currently facing an issue while trying to insert a date into a MySQL database through JSP. The date is being accepted using a Bootstrap date picker. However, I am encountering an unparsable date error despite trying to use the 'datetime' dat ...

What could be causing the variations in appearance of my HTML forms between Sharepoint and jsfiddle?

Currently, I am working on a Sharepoint Web Part mockup in this fiddle. As shown below, the second form is not yet formatted or aligned properly: https://i.sstatic.net/8JHHP.png Additionally, there are issues with the alignment of the second form, which ...