# HTML/CSS Implementation

**URL:** <https://forum.vassalengine.org/t/html-css-implementation/11631>\
**Category:** Development\
**Created:** [February 3, 2021, 2:15am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631 "2021-02-03T02:15:34Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![jomolungma](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jomolungma](https://forum.vassalengine.org/u/jomolungma)\
**Post date:** [February 3, 2021, 2:15am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/1 "2021-02-03T02:15:34Z")

</div>

Hi there,

This may have been answered elsewhere, so apologies if it was, but I couldn’t find an answer. What version of HTML/CSS is implemented in the VASSAL engine? I’m thinking the version is module agnostic but, just in case, I’m working in the VASL module. I’m trying to enter some HTML through a label and everything in my code is implemented except the CSS box-shadow property. I simply can’t get that to work, and I’m wondering if it’s because the box-shadow property is a CSS3 property. For reference, below is my sample code that I can get to work in MSFT Edge and Google Chrome, but not in VASSAL (I’ve added the comment tags for this post, they aren’t in the actual code):

Thanks for the help!

Stu

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [February 3, 2021, 3:42am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/2 "2021-02-03T03:42:16Z")

</div>

Hi Stu,

HTML/CSS is not implemented by Vassal, it is what is implemented by Java Swing which Vassal is built on. I can’t remember which version that is off hand, but it is ancient.

Regards,  
Brent.

PS. Ok the version supported by Swing is 3.2 from 1996 (no, I am not joking). Look at these links for details of what is supported:

[docs.oracle.com/en/java/javase/ … L.Tag.html](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/text/html/HTML.Tag.html)  
[docs.oracle.com/en/java/javase/ … l/CSS.html](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/text/html/CSS.html)

---

<div class="post-metadata">

**Author:** ![jomolungma](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jomolungma](https://forum.vassalengine.org/u/jomolungma)\
**Post date:** [February 3, 2021, 4:55pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/3 "2021-02-03T16:55:47Z")

</div>

> [@Brent Easton](#):
>
> Hi Stu,
> 
> HTML/CSS is not implemented by Vassal, it is what is implemented by Java Swing which Vassal is built on. I can’t remember which version that is off hand, but it is ancient.
> 
> Regards,  
> Brent.
> 
> PS. Ok the version supported by Swing is 3.2 from 1996 (no, I am not joking). Look at these links for details of what is supported:
> 
> [docs.oracle.com/en/java/javase/ … L.Tag.html](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/text/html/HTML.Tag.html)  
> [docs.oracle.com/en/java/javase/ … l/CSS.html](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/text/html/CSS.html)

Thanks for the information and links, Brent! Wow, that is old. Well, to be honest, the last time I actually really developed in HTML was the late 90s, so maybe I’ll just stick with what I know and not look up anything new 😆

I haven’t been following the non-java development of VASSAL, which I guess will be 4.0, but maybe I should dive into that a little more to see what, if any, HTML/CSS implementation will be forthcoming.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Matt](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/matt/32/9045_2.png) [@Matt](https://forum.vassalengine.org/u/Matt)\
**Post date:** [December 1, 2023, 7:14pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/4 "2023-12-01T19:14:46Z")

</div>

We really need more from HTML in the Vassal. It is really hard to get a user experience in antique HTML. I know there are a lot of requests but this one would be top of the list especially if there were support for Javascript on those pages. You could do really easy calculators there. Easier than Java since I don’t know Java… lol

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [December 1, 2023, 11:37pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/5 "2023-12-01T23:37:46Z")

</div>

Sorry, No can do.

The limitation on the ancient version of HTML supported is not from Vassal, it’s from the Java Swing UI the game is built on. There is nothing we can do in V3. V4 will have full support for modern HTML and CSS.

---

<div class="post-metadata">

**Author:** ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)\
**Post date:** [December 2, 2023, 4:21am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/6 "2023-12-02T04:21:58Z")

</div>

Amen…🙂 20 years almost there

---

<div class="post-metadata">

**Author:** ![dsmith71](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dsmith71](https://forum.vassalengine.org/u/dsmith71)\
**Post date:** [January 1, 2024, 6:17am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/7 "2024-01-01T06:17:15Z")

</div>

Hi All;  
Hope you had a nice Xmas and New Year.

I also have a html question so will ask it here. Is it possible to use html for images in right-click menus? I can get to work in the Chat window for dice etc. but not in the right-click menu text. When using this example for an image…

`<html><img src="Dice_Medical.png" width=14 height=14></html>`

…I get this…

 ![Right_Click_Menu](https://forum.vassalengine.org/uploads/default/original/2X/a/a860fc59c21441304f414c5ca8202e13d0b1fa5b.jpeg)

I can get it to work in the Chat window no prob and html also works in the right-click menu with text but not images. Might this be available at some point in the future or am I doing something wrong?

Thanks.

Darren

---

<div class="post-metadata">

**Author:** ![jrwatts](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/jrwatts/32/6972_2.png) [@jrwatts](https://forum.vassalengine.org/u/jrwatts)\
**Post date:** [January 1, 2024, 8:07am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/8 "2024-01-01T08:07:40Z")

</div>

No idea if this will work, but have you tried `img src="images/Dice_Medical.png"` instead? The root directory may be different for the right-click menu (and all the module images are stored in the `images` subfolder).

---

<div class="post-metadata">

**Author:** ![dsmith71](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dsmith71](https://forum.vassalengine.org/u/dsmith71)\
**Post date:** [January 1, 2024, 8:51am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/9 "2024-01-01T08:51:24Z")

</div>

Hello Jonathan;  
Thanks for the reply I will try your answer tomorrow after work. The Chat window uses the `images` folder but yeah I see what you mean. Thanks.

Darren

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 1, 2024, 11:12am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/10 "2024-01-01T11:12:01Z")

</div>

That’s unlikely to work anywhere except in the Chat Window and in Charts. We had to add special code to those features to get it to work. It’s not possible to add that as a generic feature in all places.

---

<div class="post-metadata">

**Author:** ![Korval](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Korval](https://forum.vassalengine.org/u/Korval)\
**Post date:** [January 1, 2024, 1:29pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/11 "2024-01-01T13:29:32Z")

</div>

FWIW, this is an example of behavior I don’t think should be modifiable by designers.

Right click context menus should have standard behavior/appearance across modules and the only change should be the ability of players (not designers) to increase font sizes for accessibility.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 2, 2024, 12:27am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/12 "2024-01-02T00:27:11Z")

</div>

> [@Korval](#):
>
> Right click context menus should have standard behavior/appearance across modules and the only change should be the ability of players (not designers) to increase font sizes for accessibility.

I concur (in part). Context menus (and other UI elements) should be consistent with the theme the user has in their desktop environment. Whether there are icons in context menus (and other things, like the color and size of text in context menus) is a property of the user’s desktop environment and should not generally be set per-application.

In the event that you can set icons, text size, text color, etc. on context menu items, this is not an intentional feature. You should not rely on it, and it could cease to work at any time.

---

<div class="post-metadata">

**Author:** ![dsmith71](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dsmith71](https://forum.vassalengine.org/u/dsmith71)\
**Post date:** [January 2, 2024, 5:02am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/13 "2024-01-02T05:02:44Z")

</div>

> [@Brent\_Easton](#):
>
> That’s unlikely to work anywhere except in the Chat Window and in Charts. We had to add special code to those features to get it to work. It’s not possible to add that as a generic feature in all places.

Ok thanks Brent

> [@Korval](#):
>
> Right click context menus should have standard behavior/appearance across modules

> [@uckelman](#):
>
> Context menus (and other UI elements) should be consistent with the theme the user has in their desktop environment.

Ok will have to settle for this..

 ![New Menu](https://forum.vassalengine.org/uploads/default/original/2X/3/3db6e39c85e28fe139d92e90c4dce465129d87e7.jpeg)

when it could be this…

 ![Hypothetical](https://forum.vassalengine.org/uploads/default/original/2X/f/f072e890ad10722bb8abc00dea24bf618365a6b1.jpeg)

Thanks guys.

Darren

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 2, 2024, 5:56am UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/14 "2024-01-02T05:56:58Z")

</div>

I strongly discourage you from doing that. You have no way of knowing how the colors you’re setting for the menu item backgrounds will contrast with the user’s desktop theme. The menu could end up totally illegible for some users.

---

<div class="post-metadata">

**Author:** ![Korval](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Korval](https://forum.vassalengine.org/u/Korval)\
**Post date:** [January 2, 2024, 12:54pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/15 "2024-01-02T12:54:18Z")

</div>

Speaking as a Vassal user, module designer, and Trekkie :\>, even if this did work, I would urge you to always use words in addition to the icons. Icons, especially small icons, are sometimes difficult to resolve for people w/ poor vision or certain cognitive issues…

Cool looking game, what is it?

---

<div class="post-metadata">

**Author:** ![dsmith71](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dsmith71](https://forum.vassalengine.org/u/dsmith71)\
**Post date:** [January 2, 2024, 8:49pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/16 "2024-01-02T20:49:13Z")

</div>

**@Korval**

It is a free Solitaire Print & Play called “Star Trek - The Dice Game”, lots of fun and easy to learn. A module has already been created for it [here](https://vassalengine.org/wiki/Module:Star_Trek:_The_Dice_Game). Mine will be a little different.

Regards;  
Darren

---

<div class="post-metadata">

**Author:** ![dsmith71](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dsmith71](https://forum.vassalengine.org/u/dsmith71)\
**Post date:** [January 2, 2024, 8:55pm UTC](https://forum.vassalengine.org/t/html-css-implementation/11631/17 "2024-01-02T20:55:16Z")

</div>

I will be using the more stable Text **only** it is a shame that Vassal does not support image html in this field IMO but no big deal. Other features that would be nice (but maybe impossible) are some of the those available in Browsers such as Fullscreen and customisable Window borders.

Regards;  
Darren
