如何在博客园添加markdown提示框

博客园中使用Markdown实现提示框效果,需通过自定义CSS样式+HTML代码实现。以下是具体操作步骤:

打开 https://i.cnblogs.com/settings,往下翻找到"页面定制css代码"

  1. 添加CSS样式
    在其中添加以下代码

    /* 提示框样式 */
    .tip-box {
        border-left: 5px solid #3498db;
        background-color: #f0f8ff;
        padding: 12px;
        margin: 10px 0;
        border-radius: 4px;
    }
    .tip-box::before {
        content: "提示";
        font-weight: bold;
        color: #3498db;
        margin-right: 8px;
    }
    
  2. 在Markdown中使用HTML标签
    编写文章时,用<div>包裹内容并指定类名:

    <div class="tip-box">
    这是提示内容。
    </div>
    

这是提示框效果:

这是提示内容。
posted @ 2025-05-10 14:43  cjy_cnblogs  阅读(90)  评论(0)    收藏  举报