Sie sind nicht angemeldet.

  • »Alexey Tkachenko« ist der Autor dieses Themas

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

1

Montag, 17. August 2015, 09:02

Make some letters one color while the rest of the text is another color

Hi guys!

I was wondering whether there's some trick to highlight some word inside the text (say, make some word in the middle of the text red color) and keep the rest of it another color. As far as I can see from documentation, there's no way to achieve it except making a link. But it's clickable...
Regards,

Alexey

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Montag, 17. August 2015, 16:53

Quellcode

1
2
3
html="black [span] blue[/span][p] red[/p]"

css="font-color:#0000;span {font-color:#2175d9}p {font-color:##bb0000}
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

  • »Alexey Tkachenko« ist der Autor dieses Themas

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

3

Montag, 17. August 2015, 18:19

Thank you, Sacha, a lot for the help! ;-) And thanks Tuur for the help, I've got it working now with dynamically generated html of a textfield.
Regards,

Alexey

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

4

Montag, 17. August 2015, 22:54

You could alsoo try some css:

Quellcode

1
2
3
4
5
6
p{
  color: red;
}
p:first-letter {
  color: blue;
}


Wouldnt work for Flash tours, but should work for html5

5

Dienstag, 18. August 2015, 11:21

Hi,

I would recommend using <span> and inline styles ,

e.g. if you don't need Flash support you could do:

Quellcode

1
html="black [span style='color:#0000FF;']blue[/span] black [span style='color:#FF0000;']red[/span] black"


Adding Flash support would be possible too, but the Flashplayer would need a <font> element for changing the color (see here) - so <font> tags and color and style would need to be used together, a HTML5 browser will ignore the <font> and handle it like a <span> element.

So that would be the same for Flash AND HTML5 support:

Quellcode

1
html="black [font color='#0000FF' style='color:#0000FF;']blue[/font] black [font color='#FF0000' style='color:#FF0000;']red[/span] black"


Best regards,
Klaus