{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 覆盖 Tailwind 的默认样式\n", "\n", "Tailwind 会重置 HTML 元素的默认样式,例如本例中的 `h2` 元素的字体大小。您可以通过添加一个类型为 `text/tailwindcss` 的 `style` 标签来覆盖这些默认值。如果没有这个类型,样式将被过早地评估并被 Tailwind 覆盖。" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from nicegui import ui\n", "\n", "ui.add_head_html('''\n", " \n", "''')\n", "ui.html('

Hello world!

')\n", "\n", "# ui.run()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "py311", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" } }, "nbformat": 4, "nbformat_minor": 2 }