What is the best way to align the second line of the title directly below the first line without using icons?

I am facing an issue where the icon and title are not aligning properly. When the title exceeds a certain length, it wraps under the icon instead of staying next to it. I need assistance in ensuring that the title always starts on a new line below the first letter, not the icon.

https://i.sstatic.net/I4Hqq.png

<div className="notAcceptingPatients col-med-6"\>
<h6 className="font-weight-bold text-dark "\>
<i
style={{
color: '#D14444',
fontSize: 23,
marginRight: 6,
}}
class="fa fa-info-circle"\>\</i\>

This Dental Clinic is currently not accepting new patients \</h6\>
<p className="notAcceptingPatients ml-2"\>
<p\>
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\>
</p\>
</div\>
CSS
.notAcceptingPatients {
 padding: 11px ;
 background: rgba(219, 88, 88, 0.1);
 border-radius: 8px;

p {
margin: 2px;
font-size: 15px;
color: $black;
background: none;
line-height: 19px;
font-weight: 400;
padding: 1px 0px;
    }
}

Answer №1

To create a styled header, consider using flex positioning. Below is an example of how you can achieve this:

<h6 style={{ display: 'flex', alignItems: 'center' }}>
  <i style={{ color: '#3E97C9', fontSize: 20, marginRight: 8 }} class="fa fa-info-circle"></i>
  This Gym Facility will be closed for maintenance on Friday
</h6>

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

I am looking to include the "!important" rule in my animation code

Is it feasible to include !important in animations? I attempted to incorporate it in Angular in the following manner: angular.element(".myClassName").css("margin-left","100px !important"); ...

How do I use Lodash chaining to filter an array of objects and map over an object containing arrays?

Here is the structure of my filter object: var filterUpdate = { assetClass: [{id: 1, name: 'photo'}, {id: 2, name: 'thumbnail'} ] vehicleType: [{id: 1, name: 'nissan'}] } Now, let's look at the dynamic state data with ...

Retrieve text content from a specified element on a different page, not the one currently loaded, by

After implementing this dynamic content script, I realized that it is working well for the current page. However, since I cannot access the code-behind in the asp.net project, I am facing an issue when trying to fetch the text from "div.sampleheading" on t ...

Generating small image previews in JavaScript without distorting proportions

I am currently working on a client-side Drag and Drop file upload script as a bookmarklet. To prepare for the upload process, I am utilizing the File API to convert the images into base64 format and showcase them as thumbnails. These are examples of how m ...

Customizing Bootstrap tooltip appearances with CSS

After successfully setting up Bootstrap 4.5.0, I decided to experiment with customizing the styles of tooltips. The code snippet below shows how I attempted this. Initially, I included the necessary stylesheets at the top of the page: <link rel=&q ...

Unset the class upon clicking outside the div, but maintain the class unset when the div is closed

I have a div that opens when the question mark icon in the upper right corner of the document is clicked. When clicked, a class is added which transforms the question mark into a close icon. When clicking outside the div, the div closes and the class is re ...

Ways to implement a Try Again button in React Error Boundary to reset state

My Pokemon app relies on React Hook Form, React Query, and React Error Boundary libraries for functionality. When there are no requests made yet, the message No Pokemon Yet, Please Submit a Pokemon should be displayed. In case of an error, a Try Again but ...

Map through the index and render the component while closing the tag

I have a piece of code that I'm working on. How can I dynamically add a tag based on the index? My goal is to create a grid with 3 columns. <div> {items.map((row, i) => ( {i % 3 === 0 && <div className={'grid-cont ...

What is the method for centering an input field with inline CSS?

Is there a way to center align an input text box on a webpage using only inline CSS? I have tried various techniques, including the following code snippet, but nothing seems to work: <input type="text" id="myInput" style= "margi ...

Guidelines on navigating a blank page using the Nuxt-js method

I have run into an issue in my Nuxt.js project where I need to open a link in a new target when a user clicks a button. Despite trying various solutions, I haven't been able to find a workaround within the Nuxt.js framework itself. <a :href=&qu ...

Creating a Text Typer ReactJS component that functions properly regardless of whether or not it is used within StrictMode is no

My goal is to develop a custom Text Typer component that displays text character by character every 100ms. While it works perfectly fine in production, I encounter issues when testing it in the development environment. Despite trying various solutions, tw ...

Managing websites on Android when the keyboard is displayed

I am currently facing an issue with my webpage on Android (Galaxy SIII). The problem occurs when visitors try to enter their email in the form at the bottom of the page. The keyboard becomes visible, causing the design to look messy. When using Chrome, the ...

Issue with DIV positioning in IE when another DIV is animated downwards

Here's how my page structure looks like: <header> <div class="slide"> <!---- some elements here ---> </div> <nav> <ul> <li id="open"></li> <! --- other parts of the navigation ...

Automate your ReactJs application with Selenium WebDriver

Is Selenium WebDriver suitable for automating ReactJs applications? I've recently started using Selenium WebDriver, but I'm facing challenges with its performance as it's causing delays due to difficulties in locating elements within the Rea ...

use d3 to dynamically color links in a react-force-graph based on their value

I'm looking to develop an app featuring a 3D Force Graph using the resources from the following project: https://github.com/vasturiano/react-force-graph You can check out my sample implementation based on the project's documentation on Github he ...

Transferring HTML5 Video data by breaking it into segments and streaming it through several HTTP/

Looking for ways to speed up the loading time of an html5 video? Is there a method to make a browser process each webm video fragment as individual TCP streams, in order to take advantage of HTTP/2's enhanced parallelization? ...

Is there a way to access and click this image link using Selenium if it doesn't have an id attribute assigned

I am struggling to find a way to click and navigate to the href destination without an apparent id. The link in href may change unexpectedly, so I need a flexible solution for this. Can you provide code that would help me achieve this? <ul style="dis ...

Exploring React Functional Component with Hooks through Jest Testing

As I transition from using class based components to functional components, I've encountered a challenge when it comes to writing tests with jest/enzyme for the methods inside the functional components that explicitly utilize hooks. Here's a simp ...

The crossbars in the JQuery plugin Lightbox are not visible

How can I make the cross bar show when clicking the icon to display an image using this code snippet? <link rel="stylesheet" href="css/lightbox.css"> <script src="js/lightbox.js"></script> <a href="images/gallery_image/Gallery_img.p ...

ERROR: Critical issue encountered with inadequate mark-compacts near heap threshold causing allocation failure - JavaScript heap exhausted in node.js

https://i.sstatic.net/oqLj3.png Having trouble posting formdata to my own API, specifically with an array of objects. const handleSubmit = async e => { e.preventDefault() try{ const formData = new FormData() ...