Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Format Certain Text in Label

I need to bold a particular word of text in a label, but not all of the label's text. How do I do that?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Format Certain Text in Label

Hello Jack,

You can use pseudoselector "first-letter" for the first letter:
https://css-tricks.com/almanac/select...

But it is impossible to use css for the part of the text.

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Format Certain Text in Label

What about html formatting? I am only talking about simple things like bold, underline and italic.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Format Certain Text in Label

Hello Jack,

You may drag/drop the HTML component and edit it like this:
pre
span class="label label-default"
span class="firstPart"First/span
span class="secondPart"second/span
/span%children%/pre
then add/use a separate file for CSS classes, adding whatever style you want:
pre.firstPart {
font-weight: 100;
color: blue;
}
.secondPart {
font-weight: 700;
color: red;
}/pre

Hero Render
Posts: 0
Joined: Thu Feb 09, 2017 9:04 am

Format Certain Text in Label

On ionic,
I want to BOLD specific part of the text, I cant use HTML for rapid and easy dev .

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Format Certain Text in Label

For this you can use CSS in your project for modifying the text string properties:

precode
.bold {

Code: Select all

 font-weight: bold; 

}
/code/pre

and for your Text component on the page add a Class: codebold/code

Hero Render
Posts: 0
Joined: Thu Feb 09, 2017 9:04 am

Format Certain Text in Label

no I want to bold a specific part of my text, not on HTML...
for example, I want to bold the high lighted part.
Image

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Format Certain Text in Label

Hello,

It is impossible to use different styles in the only one HTML tag (like a label, a button, etc.). You have to separate your text to different tags for that.

Return to “Issues”