The browser automatically breaks up words at a hyphen when wrapping text

Here is an h2 element:

<h2>ENHANCE YOUR DIGITAL FOOTPRINT WITH PERSONALIZED E-COMMERCE</h2>

While it displays correctly in Firefox, the word E-COMMERCE gets split into two words in IE and Chrome when the HTML is rendered. How can I resolve this issue?

Answer №1

When it comes to hyphens, they are meant to break. To prevent this from happening, use the U+2011 NON-BREAKING HYPHEN character:

E&#x2011;COMMERCE

Check out the demo — experiment with resizing the window.

(HTML does not provide a named entity for this character, so you either need to insert it directly or use a numeric reference.)

Answer №2

Have you given it a shot?

<nobr>E-Commerce</nobr>

Alternatively, have you considered the updated html & css method:

 <div class=nobr>E-Commerce</div>

.nobr { white-space:nowrap; }

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

The options in Bootstrap select are not visible because the select element is too large

I am encountering an issue with a populated bootstrap select tag. Initially, it looks like this: https://i.sstatic.net/1PWOf.png It is working perfectly fine, displaying all items for selection. However, when I decrease the height of the select using CS ...

Insert a design layout into a text entry box

Currently developing an application with AngularJS and seeking a solution for adding a "template" to an HTML input field similar to a placeholder. Specifically, I have a date-field requiring user input in the format of dd/MM/yyyy or through a datepicker se ...

iOS 7.1's sleek user interface is creating issues with the viewport height CSS unit (vh) in web design

Ever noticed how the viewport size changes when scrolling down a page in iOS 7.1? But even though the viewport changes, 100vh doesn't update. Is there a way to prevent the minimal UI or update the viewport on scroll? Check out an example site here. ...

When submitting a form in HTML, ensure that the input checkbox returns 'On' instead of 'True'

My MVC3 app is using Project Awesome from http://awesome.codeplex.com/, but I'm encountering a strange issue with checkboxes. Inside a Modal popup, I have the following simple Html code: <input type="checkbox" class="check-box" name="IsDeleted"> ...

Leveraging JSON data to dynamically create HTML elements with multiple class names and unique IDs, all achieved without relying on

Recently, I've been working on creating a virtual Rubik's cube using only JS and CSS on CodePen. Despite my limited experience of coding for less than 3 months, with just under a month focusing on JS, I have managed to develop two versions so far ...

Tips for repositioning the window when linking to a different section of a website

As a beginner in HTML and CSS, I am currently working on adding a navigation bar to my one-page website. I want the navigation bar to smoothly guide users to different sections of the page when they click on a link. To achieve this, I am using anchors and ...

Having trouble vertically centering a div within a grid using bootstrap

How can I vertically center the card with the other content in the right div? https://i.sstatic.net/FSPmU.png This is my code: le="margin-bottom:100px"> I Agree With the terms and service Request Code <link href="https://stackp ...

Obtain the text content of a div using JavaScript

Hello, I am new to Javascript! I have a table structure that looks like this: <table id='master_tbl'> <tbody> <tr id="master_hr'> <td class="myclass"> <table> <tbody ...

What is the process of providing a thumbnail image to external websites?

When a user shares a link from a website on social media platforms like Reddit or Facebook, an image is usually attached to it. Is there a way to specify which image should appear in the header of the HTML file? I assume that there must be a meta tag, lik ...

What is the best way to trigger card opening - through clicking or hovering?

Once the Set tag/status button on the left is clicked, I aim to display a card similar to this one on the right side. What would be the best approach to achieve this in React? Should I use regular CSS, Material UI, or React-bootstrap? https://i.stack.img ...

Ensure that the Bootstrap image element maintains its full height without resizing

While working on my Angular application, I encountered an issue with designing a side list-group of recent blogs using Bootstrap 4. When the aspect ratio is changed to mobile view, the images resize and become smaller to fit into the div as the title lengt ...

Angular 2 sidebar icons appearing vertically instead of in a row

Greetings! I've been struggling for hours to display a sidenav using Angular 2, with links listed as rows. Here is what my current setup looks like: https://i.sstatic.net/fmmAR.jpg Here is the code I've been working on: <md-sidenav-containe ...

I've encountered an issue when attempting to use innerHTML for DOM manipulation

I've been attempting to remove a specific list item <li> from the inner HTML by assigning them proper IDs. However, I'm encountering difficulties in deleting it. How can I delete these list items after clicking on the cross button? Feel fr ...

Troubleshooting Problem with CSS and Javascript Dropdown Menu

Greetings, fellow web designers! I am relatively new to the world of web design and currently, I am immersed in the process of creating a website. My current project involves implementing a dropdown menu using CSS and Javascript. While I have made signific ...

Managing sessions and cookies for Firefox forms

On my webpage, there is a poll form where users can vote and see the results through an ajax request. When a user votes, a cookie is created to prevent them from voting again upon returning to the page. However, I have encountered an issue with Firefox wh ...

Do LI elements need to be floated left for right alignment within a container?

I have a code where the LI elements are floated left and aligned to the left of the container. I want to change their alignment to the right using CSS. How can I achieve this? For example: [Item1..................................Item2] Below is the HTML ...

Is it possible to apply a modal to a v-for item?

I am receiving a GET request from my API to display all users, and I want to potentially modify the name or email of each user using a modal. However, I am facing an issue where if I have 3 users displayed, clicking on one modal button triggers all 3 modal ...

Troubleshooting a Custom Menu Control in HTML

Would you mind taking a look at the menu I have set up in this fiddle: http://jsfiddle.net/Gk_999/mtfhptwo/3 (function ($) { $.fn.menumaker = function (options) { var cssmenu = $(this), settings = $.extend({ title: "Menu", ...

Adjust the parent's height to match the child element using relative and absolute positioning

I am struggling with a seemingly basic issue and can't seem to figure it out. Basically, I have a parent element with a relative position, and a child element with an absolute position. How can I make the parent element expand to match the height of ...

Issue encountered while attempting to attach an event listener to an element within a class

Upon running the code, I encountered an error message that reads: Uncaught TypeError: this.startButton.addEventListener is not a function and I'm unsure of how to resolve it. Although I can successfully console.log the button inside the class, adding ...