Use space to run app.py, but gr.Markdown cannot be centered

I run the project locally and can recognize normally, but when I put it in space, nothing is displayed
Here is the relevant code

        gradio.Markdown(
        """
            # <center> VITS语音在线合成demo<br>
            # <center> 严禁将模型用于任何商业项目,否则后果自负<br>
            <div align="center">主要有赛马娘,原神中文,原神日语,崩坏3的音色</div>
            <div align="center"><a style="color: red;">结果有随机性,语调可能很奇怪,可多次生成取最佳效果</a></div>
            <div align="center"><a style="color: red;">标点符号会影响生成的结果</a></div>
        """
        )

But when running in space, the page does not have any introduction.

1 Like

Try elem_classes with CSS.

import gradio as gr

CSS = """
.test { align-items: center; text-align: center; }
"""

with gr.Blocks(css=CSS) as demo:
    gr.Markdown("a", elem_classes="test")

demo.launch()
1 Like

thank you. This is very helpful for me

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.