如何更改标题样式.并使其在文本上单击以显示HTML中任何标签的标题 [英] How Do I Change Styles Of Title. And Made It On Text Click Appear Title Of Any Tag In Html

查看:186
本文介绍了如何更改标题样式.并使其在文本上单击以显示HTML中任何标签的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的密码是赫拉

点击它

所以,如何改变我的头衔风格.因为它只是出现在黄色背景中.我想将其显示为粗体和红色,如果可能的话,请单击该文本,然后将其显示.并在5秒后完成.

Hera is my code

Click on it

So , How to change my style of title . Because its just appear in yellow back ground. and I want to show it bold and red and if possible That when i clicked the text then appear it. and after 5 second its finished.

推荐答案

对于您想要的方案,尚无明确的想法,但我仍然尝试提供一种解决方案根据我对您问题的理解.

据我了解,您拥有标题,并且希望在单击标题时显示标题的样式,并且5秒钟后它将自动消失.
因此,可以说您的标题是ID为" spanTitle "的跨度,如下所示:
There is no clear idea is given on the scenario on which you want a scenario, but still i have tried to give one solution as per my understanding of your question.

What i understand you have a title and you wan to appear a style for the title on click of it, and after 5 seconds it will disappear automatically.
So let say your title is a span with ID = ''spanTitle'' as below :
<span id="spanTitle">Sample Title</span>



我们有一个css类,它将根据您的需要应用字体样式,如下所示:-



We have a css class which will apply font style as you want like below :-

.headerStyle{
    font-weight:bold;
    color:red;    
}



现在,这里是jQuery代码,它将在单击它时为其设置样式,并且5秒钟后它也会自动恢复正常.
例如:-



Now here is the jQuery code which will set the style for it on click of it, also it will automatically be normal after 5 secs.
Ex :-


(文档).ready(函数(){
(document).ready(function(){


(' #spanTitle').click(函数(){
('#spanTitle').click(function(){


这篇关于如何更改标题样式.并使其在文本上单击以显示HTML中任何标签的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆