2017-10-24 3 views
-1

タグ内にタイトルをスタイルする方法はありますか? 私は例えば意味:私は知りたい入力タグ内でのタイトルのスタイリング

<input type= "submit" id="submit" title= "submit your form"> 

は、それがinputタグ内のこのタイトルのスタイルを設定することは可能でしょうか?

+1

CSS3で行うことができます。ここを見てください[アンカータグ内のTitle属性のスタイルを変更するにはどうすればいいですか?](https://stackoverflow.com/questions/2011142/how-to-change-the-style-of-title-attribute-inside-アンカータグ) –

答えて

0

いいえ、しかし、あなたはそれでいくつかのトリックを試してみてください。

$(document).ready(function(){ 
 
    var old_title; 
 
    $('.title-styled').on('mouseover', function(){ 
 
    old_title = $(this).attr('title'); 
 
    $('.title-message').html($(this).attr('title')).css('visibility', 'visible'); 
 
    
 
    $(this).attr('title', ''); 
 
    }); 
 
    
 
    $('.title-styled').on('mouseleave', function(){ 
 
    $(this).attr('title', old_title); 
 
    $('.title-message').html('').css('visibility', 'hidden'); 
 
    }); 
 
    
 
});
.title-message{ 
 
    visibility: hidden; 
 
    padding: 10px; 
 
    border: solid 1px #f9f9f9; 
 
    box-shadow: 3px 3px 3px #1a1a1a; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<input type= "submit" id="submit" class="title-styled" title= "submit your form"> 
 

 
<span class="title-message"></span>

その他のオプション:

あなたはjQueryのプラグインを使用したい場合は、visit this link

関連する問題