How to create a css for in-line text underdot style?

12 views
Skip to first unread message

ycproject

unread,
Apr 20, 2023, 1:03:45 AM4/20/23
to sphinx-users
I want to create a custom css for in-line text underdot effect. I am able to implement custom css for text color, but I can't write css for  underdot.

I also refer to MDN and it always fails to work.

ycproject

unread,
Apr 22, 2023, 9:11:23 PM4/22/23
to sphinx-users
Problem solved.

First, create a custom.css in _static/css/, then mark it in the conf.py: html_css_files = ['css/custom.css,']

Second, in the rst file:

.. role:: underdot
   :class: underdot

This is a test for underdotted text inline :underdot:`underdotted text`


----------------------------------------------------------------------
Here is the custom.css file:
.underdot {
   text-emphasis: dot;
   text-emphasis-color: #ff0000;
   text-emphasis-position: under;
Reply all
Reply to author
Forward
0 new messages