How to apply BDI tag inside css code?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to apply BDI tag inside css code?



I'm using bdi tag in several places in my page.


bdi



I want to know if there is a way to apply this tag as part of a css class in some way ?



EDIT:



I'm trying to make this solution for drop down lists items, so the bdi functionality will fixed my problem with the brackets inside it:


bdi



That's what I tried so far:


<form:select id="locale" path="locale">
<c:forEach items="$locales" var="loc">
<c:choose>
<c:when test="$loc.key == currentLocale">
<option itemValue="key" value="$loc.key" selected><bdi><div>$loc.value</div></bdi></option>
</c:when>
<c:otherwise>
<option itemValue="key" value="$loc.key"><bdi><div>$loc.value</div></bdi></option>
</c:otherwise>
</c:choose>
</c:forEach>
</form:select>



enter image description here





developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi#See_also
– CBroe
Aug 8 at 11:52





Welcome to SO, please provide code you have tried so far.
– Matěj Štágl
Aug 8 at 11:53





@MatějŠtágl I guess, not all the posts in SO needs code. As in this question, OP has no hint on how to achieve the thing, so how could he produce the code for that problem. Just a thought.
– Rakibul Islam
Aug 8 at 11:58






There is no such thing as a CSS class. HTML has classes. CSS has class selectors. It's really unclear what you are asking. Are you asking how to target bdi elements with CSS (which would use a type selector, not a class selector)? Are you asking how to how to apply the semantics that the bdi element provides with a CSS rule (rule, not class)?
– Quentin
Aug 8 at 12:10






I meant to say class selectors, and I'm asking about how to apply the semantics of bdl element to a css selector
– roeygol
Aug 8 at 12:25




1 Answer
1



You can use CSS property unicode-bidi which when used along with direction property, gives the flavor of html bdi.


unicode-bidi


direction


bdi



Demo snippet below shows a working example:




.bdi
direction: ltr;


<select>
<option class="bdi">English (United States)</option>
<option class="bdi">(ישראל) עִברִית</option>
</select>



If you need more information or other use cases in this regard, here is the MDN page links of unicode-bidi and direction.





Thank you, but I need to know how to manage this solution for drop down lists, i'm having the problem also there
– roeygol
Aug 8 at 12:56





Can you please add the codes of your dropdown lists that is not working, it will be easier to debug then.
– Rakibul Islam
Aug 8 at 12:57





Please look on the original message, i've edit it
– roeygol
Aug 8 at 13:03





@roeygol Follow the edits I have made, if it helps. I'm not sure whether you are asking this or something else. Let me know.
– Rakibul Islam
Aug 8 at 13:16





I changed it to be unicode-bidi: plaintext; and it fixed the selected item and not the items in the list (when the list is opened), so we in half of the way
– roeygol
Aug 8 at 13:37



unicode-bidi: plaintext;






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard