You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Alexey Tkachenko

Professional

  • "Alexey Tkachenko" started this thread

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

1

Monday, August 17th 2015, 9:02am

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

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Monday, August 17th 2015, 4:53pm

Source code

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

Professional

  • "Alexey Tkachenko" started this thread

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

3

Monday, August 17th 2015, 6:19pm

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

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

4

Monday, August 17th 2015, 10:54pm

You could alsoo try some css:

Source code

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


Wouldnt work for Flash tours, but should work for html5
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

5

Tuesday, August 18th 2015, 11:21am

Hi,

I would recommend using <span> and inline styles ,

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

Source code

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:

Source code

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


Best regards,
Klaus