Utilize CSS to style and highlight Arabic text

I need help with highlighting Arabic text. When I try to mark individual letters, the connected nature of Arabic characters causes the word to break. Does anyone have a solution for this?

For example: original word: سلام I only want to highlight the second letter

original word:

    <span>سلام</span>

add tag after highlighting:

    <span>س<span class='highlight'>ل</span>ام</span>

this change will result in displaying "سلام" as "س‌ل‌ام"

Answer №1

Avoid using span and instead use p and span

<p>س<span class='highlight'>ل</span>ام</p>

This will not disrupt your formatting...

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

Flask caches JSON files automatically

I am currently working on a visualization app using js and python. The functionality of my app is as follows: There is a textbox in the browser where I input an URL The URL is then sent to Python via Flask In Python, the URL is processed to create ...

Is there a way to regularly extract the most up-to-date HTML code from a dynamic website for designers to work

Our team of designers is responsible for creating graphical mockups, initial html, css, and image sprites for new designs. They also maintain these files. Once the hand-off is complete, our developers then take everything and work it into .Net code, templa ...

Alert will only occur once the done function in jquery's .ajax method is executed

Something seems off and I'm struggling to understand the situation. I've used jQuery's .ajax() function to run a script that retrieves data from the database. The script is functioning properly and the data is being returned as expected: $. ...

Automatic capitalization of menu options in Bootstrap dropdown

Is anyone else curious about why the menu items are in all caps while the markup is in lower case? What steps can be taken to prevent this from happening? https://i.stack.imgur.com/S86RO.png ...

Overlapping floating action buttons

I am trying to display two floating action buttons (FABs) on top of each other, but currently they are overlapping as shown in the picture below. Although I know this may be a common issue, I have not been able to find a solution using Vuetify. https://i ...

How to align button text and other ion-col text at the bottom in Ionic 2

Here is the code snippet I am working with: <ion-row><ion-col ><button ion-button outline no-padding large (click)="setUserName()">D</button>ay in the life </ion-col></ion-row> I find the layout unattractive as the le ...

Unable to display PHP variable in HTML

I am currently facing an issue while attempting to display user input that includes double quotes in an HTML form. When I echo the input, everything before the double quotes is being shown. For example, if the input is "6" Tropical Premium $8.99", only "6" ...

Instructions for setting a cookie to conceal a notification bar upon the second page load

I am looking for the following scenario: When a new visitor lands on my website, a notice bar fixed to the bottom of the screen becomes visible. After clicking on a menu item to navigate to another page, a cookie is set upon the second page load. This co ...

Is it possible to enable auto play on HTML5 Video for iPad similar to BBC iPlayer?

Can HTML5 Videos automatically play on iPads? I used to believe that it wasn't possible because of iOS restrictions, but after trying BBC iPlayer on my iPad, I noticed that the videos did autoplay upon loading. Could this indicate that it is indeed ...

What is the best way to place a semi-transparent black overlay on an image?

<html> <head> <style> #contain_main {background-color:black; width:100%; height:auto;} #main {width:100%; height:700px; background-image:url("https://www.sappun.co.kr/shopimages ...

"Enhancing Your Web Pages: Generating and Inserting HTML Elements on the Fly Using

For my master's degree project, I am working on developing a shopping web app. The issue I am facing is that I need assistance with creating a div and adding it to the HTML file with an ID matching the category name from the .ts file when the addCate ...

Scrolling through UL elements using Jquery

I am struggling to implement jQuery for scrolling a UL list, with two span elements for moving up and down. It works fine for a single li child, but how can it work for a dynamically filled ul? Any help would be greatly appreciated, as I am completely lo ...

Use Angular to update the text input value

I am currently working with a basic input that is showing a timestamp in milliseconds, which is stored on the scope. However, I am interested in having it display formatted time without needing to create a new variable. I am exploring a potential solutio ...

Arranging an array of objects in Angular based on the value inside each object

How can I retrieve objects by filtering the key value within the object? In the example below, I need to extract data only with session_id:23. data = [{ name: "First Name", session_id : "23", login: "date" }, { name: "Second Name", ...

Adjust the background image to align with the bottom of the element

Looking to center the background image horizontally while keeping the bottom of the image at y=350px vertically. I attempted using calc(100% - 350px) but it seems to be calculating from the top of the image rather than the bottom. ...

Is there a way to position the button at the bottom right corner of my div box?

Having trouble positioning the button in the bottom-right corner of the parent div? I attempted using float: right;, but it ended up outside of the box. How can I keep the button within the box and align it to the bottom-right corner? If you have a solutio ...

Using setTimeout with jQuery to dynamically generate tables.Incorporating SetTimeout

Trying to implement a dynamic table using jQuery to display live data updates. Utilizing a setTimeout function to auto-refresh the content on the HTML page. $(document).ready(function update_data() { $.ajax({ dataType: "json", url: "/wire ...

Is it possible to gradually open or close a div element?

Looking for a way to add an effect to the code below that opens/closes a div on mouseover above an image. Any examples or suggestions? I'm not exactly a javascript expert. HTML: <div> <div class="under"><img src="http://oi60.tinypic.c ...

Disable the hover effect on the add to cart button by utilizing HTML and CSS

I'm currently developing an E-commerce application, but the theme I am using displays the "Add to Cart" button only on hover. I want to make the "Add to Cart" button always visible. You can view the live version of the website at the following URL: ...