我们可以在<style>标签上使用class吗?

这是出于 js目的,我希望在发生某个事件时从我的文档中删除一个特定的CREATE OR REPLACE PROCEDURE RM_FROM_STAGE() RETURNS STRING LANGUAGE JAVASCRIPT AS $$ snowflake.execute({sqlText: `rm @mystage/test/ pattern='.*success.*'` }); $$; 标签。因此,据我所知,我为此添加了一个类,并在我的活动中将其删除,例如:

<style>

我担心的是这个HTML标准,这是一个适当的方法吗?我找不到与此相关的任何问题或答案。

sweetmessi19 回答:我们可以在<style>标签上使用class吗?

是的!这完全有效,而且似乎也是有效的语法。这是一个小示范。根据{{​​3}},您的样式标签中有一个类被认为是有效的html(如果需要,您也可以使用id)。

$("#test").click(() => {
  $(".customClass").remove();
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style class="customClass">
  p {
    color: red;
  }
</style>

<p>
  Test
</p>
<button id="test">
remove
</button>

,

您可以尝试以下代码。它可以完美删除CSS。

    public void Configure(IApplicationBuilder app,IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseStaticFiles();
        app.UseCookiePolicy();

        app.UseStaticFiles(new StaticFileOptions
        {
            FileProvider = new PhysicalFileProvider(
        Path.Combine(Directory.GetCurrentDirectory(),"wwwroot","images")),RequestPath = "/MyImages"
        });

        app.UseDirectoryBrowser(new DirectoryBrowserOptions
        {
            FileProvider = new PhysicalFileProvider(
                Path.Combine(Directory.GetCurrentDirectory(),RequestPath = "/MyImages"
        });

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",template: "{controller=Home}/{action=Index}/{id?}");
        });
    }
function removeJs(){
   $(".custome_for_remove").remove();
}

本文链接:https://www.f2er.com/3031309.html

大家都在问