如何修改工具提示内容的字体大小?

时间:2017-09-11 10:49:28

标签: javascript html css tooltip

我觉得工具提示的内容字体很小。 例如,代码如下:

DatabaseReference mDatabase;

 mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("HOUSES").addChildEventListener(new ChildEventListener() {
            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {


                Map<String, String> map = (Map<String, String>) dataSnapshot.getValue();

                Houses model = new Houses(map.get("key_name"), map.get("key_name"),......);

                adapter.addItem(model);
                progressDialog.dismiss();
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) {

            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {

            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) {

            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                progressDialog.dismiss();
                Toast.makeText(FetchData.this, "Something went wrong -> " + databaseError, Toast.LENGTH_LONG).show();
            }
        });

那么如何修改显示'hello world'的字体大小!当鼠标悬停 span 元素?

2 个答案:

答案 0 :(得分:1)

首先,将以下代码放入HTML head部分: 其次,使用相应的以下代码在页面的某处嵌入工具提示

 <style type="text/css">
a.tooltip {
	position: relative;
	text-decoration: none;
	color: blue;
}

a.tooltip span {
	display: none;
}

a.tooltip:hover span {
	position: absolute;
	top: 40px;
        font-size: 40px;
	left: 0px;
	display: block;
	width: 250px;
	color: black;
	background-color: #FFFF40;
	border: 1px solid black;
	padding: 5px;
}
</style>
  <a class="tooltip" href="#">this text<span>This help text is shown in the tooltip. It spans multiple lines and works in all browsers.</span></a>

答案 1 :(得分:0)

jQuery Tooltip是个不错的选择。字体越来越大,对我来说很受欢迎。