Experiencing a problem with line breaks while testing a mobile application on an actual device (iPhone using Safari)

I have developed a mobile application with an icon that I manually created - a circle with text and a number inside. When testing it on a PC, everything looks and functions perfectly; however, when viewed on a mobile device, the text breaks to a new line even though there seems to be enough space for it.

My query is regarding what could be causing this issue (potentially something wrong in my CSS) and how can it be resolved (such as forcing the text to stay on the same line).

CSS

.title-circle {
  width: 65px;
  height: 65px;
  background-color: #eb5505;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-right: 0.9375rem;
}
.title-circle-txt {
  position: relative;
  top: 0.2em;
  color: #fff;
  text-align: center;
  font-size: 9.5px;
}
.title-circle-txt span {
  font-size: 24px;
  display: block;
  line-height: 1;
}

HTML

<span class="title-circle">
<span class="title-circle-txt">
Point
<span>1</span>
</span>
</span>

Answer №1

To resolve the issue, make sure you have set the CSS property for the class .title-circle-txt span to display: block;. This may be causing the problem. Try changing it to display: inline-block; and the issue should be fixed.

.title-circle-txt span {
  font-size: 24px;
  display: inline-block; /* changed from block to inline-block */
  line-height: 1;
}

You can view an example here.

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

Tips for Positioning Sidebar Elements Relative to Content IDs

My goal is to have sidebar elements align with specific id tags in the main content, rather than just stacking up one after another. I want the sidebar elements to align with certain id tags mentioned in the main post content. The image at shows the basic ...

Using RadStyleSheetManager for Optimizing CSS Caching

After implementing the RadStyleSheetManager in my master pages using the given code snippet, I noticed a significant improvement in the performance of my web application. In Internet Explorer 8, the number of dynamically generated WebResource.axd files had ...

Customizing the DatePicker with a unique button in material-ui

For my current project, I am utilizing a Datepicker component. I am looking to incorporate a custom information button in the upper right corner of the calendar layout, similar to the example image provided below: https://i.stack.imgur.com/fHMbn.png Unfo ...

Unlocking the secrets of CSS3 3D Transform Perspective

While experimenting with CSS3 3D Transform on Safari, I realized that the 3D model is quite complex for me to grasp initially. Upon referring to the official W3C Document, I discovered that all transform rules in CSS3 are converted into a transform matr ...

Divergent display of WordPress form input CSS between Firefox and Chrome

Trying to create an email opt-in box using Wordpress with a pre-installed theme. The box appears correctly in Firefox but is displaying incorrectly in Chrome. Issues include no padding in the text fields, different font colors, and extra padding above and ...

Align the content to the center

Currently, I am in the process of creating a profile card view and utilizing Bootstrap to achieve this. I have set up two div elements - one with the class col-lg-3 and the other with col-lg-9. However, I am facing an issue where the content within col-lg ...

Is it possible to alter the location of a button through a click event

On the left side of the container, there is a button with the text "Go Right!". When clicked in this position, the button moves to the right side of the container. When the button is on the right side, the text changes to "Go Left!" and clicking it will m ...

Display a CSS animation upon hovering the mouse

I'm looking to create a unique animation that involves drawing angled and straight lines, along with displaying text from left to right upon hovering over a button. I am relatively new to this concept and would appreciate any guidance. Additionally, I ...

When generating a docx file with html-docx-js, it lacks the capability to incorporate external CSS class styles into the document

I have been utilizing the html-docx-js module to convert html content into docx format. However, I am facing an issue where most of my CSS is externally loaded and html-docx-js does not apply any styles. Here is a simplified code sample: const html = &ap ...

Strange behaviors when using setinterval with classes

Currently working on enhancing a slider functionality, and I have observed that everything is functioning smoothly - function Slider(element) { this.i = 0; this.element = element; var self = this; this.timer = window.setInterval(functi ...

Adjusting the sensitivity of mousewheel and trackpad using JavaScript

I am currently utilizing CSS3 to smoothly move a div up and down based on the direction of scrolling. By monitoring the mouse wheel event, I can detect when a user scrolls down and trigger a CSS3 transition to slide the div up. However, I am encountering a ...

Tips for ensuring compatibility of CSS in IE7 and IE8

Despite using the following styles to dynamically display alternative colors in my HTML code, I am facing compatibility issues with IE7 and IE8. Surprisingly, everything works perfectly fine on IE9 and above. It seems these styles are not supported by IE7 ...

Positioning an item beneath two floating objects

Trying to create a visually interesting element on my website with 2 circles overlapping their parent element and 1 overlapping below. How can I make the third one centered below the first two? I've experimented with float left and right, but not sur ...

Design elements using CSS within the <th> tags

When working with HTML tables, the use of a <th> element allows for the implementation of a scope attribute. This attribute serves to indicate whether the header cell is associated with its subsequent column, row, or group. Is it feasible to leverage ...

Tips for customizing the color of mat-select placeholder text?

I've been attempting to modify the color of a mat-select placeholder. It functions properly when using 'background-color' but not when using 'color'. Below is my CSS code: /deep/ .mat-select-placeholder { color: red; } .mat-s ...

Step-by-step guide on creating a clickable button that triggers the appearance of a block showcasing a dimmed photo upon activation

Is there a way to create a button that triggers a pop-up block featuring a darkened photo when clicked? ...

Display sub navigation when clicked in WordPress

I currently have the default wordpress menu setup to display sub navigation links on hover, but I am interested in changing it so that the sub navigation only appears when the user clicks on the parent link. You can view my menu here https://jsfiddle.net/f ...

Is it possible to adjust the left property following the concealment of an element with JQuery?

My goal is to move an image element using the 'left' property after hiding a div. To achieve this, I am using JQuery's '.promise()' function. Here is my code: HTML code: <div id="outerContainer"> <div id=" ...

Customizing Thickness for Tab Labels in MUI 5

I have been trying to adjust the thickness of the label inside a tab using MUI 5, but so far I haven't had success. Here is what I have attempted: interface TabPanelProps { children?: React.ReactNode; index: number; value: number; } funct ...

What is the best way to ensure that images on a webpage adjust to a maximum width without distorting smaller images?

I'm working on my website blog and I need to create a specific area for images at the top of my articles. I want these images to have a maximum width so they don't exceed a certain size, but I also want smaller images to remain unaffected. Curren ...