鼠标移动到、移出DIV时修改DIV的颜色:

1.Change the font and Div background color--function

<div style="width:200px;height:200px;border:1px solid #ccc;color:#555" onmouseover="size()" onmouseout="size1()" id="d1">     sajdaskjdaslkj </div>
<script language="javascript">
function size(){
document.getElementById("d1").style.color = "red"/*修改字体颜色*/
document.getElementById("d1").style.backgroundColor = "red"/*修改背景颜色*/   
}
function size1(){
document.getElementById("d1").style.color = "#888"/*修改字体颜色*/   
document.getElementById("d1").style.backgroundColor = "red"/*修改背景颜色*/  
}
</script>

2.Change the font and Div background color

<DIV style="BACKGROUND-COLOR: #fcc" id=leftOuthosRecord class=labeldiv onmouseover="javascript:this.style.backgroundColor='blue';" onmouseout="javascript:this.style.backgroundColor='#CCC'"  onclick="HiddendivContent('#rightOuthosRecord','#leftOuthosRecord','#CCC')">TEST</DIV>

javascript改变背景/字体颜色(Through the javascript to change the background and font color)的更多相关文章

  1. linux终端c语言改变输出字体颜色

    Linux下C改变输出字体颜色 例: #include int main() { printf("\033[31mThis is RED.\n\033[0m"); return 0 ...

  2. linux下 C编程改变输出字体颜色

    格式: echo "\033[字背景颜色;字体颜色m字符串\033[0m"例如:echo "\033[41;36m something here \033[0m" ...

  3. 【iOS学习笔记】改变状态栏字体颜色

    Step1. info.plist中设置UIViewControllerBasedStatusBarAppearance为NO Step2. AppDelegate.m中添加 - (BOOL)appl ...

  4. python改变输出字体颜色==>colorama

    colorama是python第三方库中一个可以改变输出流颜色的玩意儿, 安装可以通过: pip install colorama 简单介绍 from colorama import Fore, Ba ...

  5. Excel之批量改变特定字体颜色(转载)

    改变单元格内部分特定字符的颜色,如果批量操作,需要用宏处理, 如下例,将范围内 所有字母A 变成红色 操作步骤:右键点击工作表标签,查看代码,如下代码复制进去Private Sub CommandBu ...

  6. MarkDown编辑器中改变文本字体颜色大小

    法一 有点类似前端里 <font face="微软雅黑" size=4 color=red>输入的文字</font> 其中 face对应字体 size 大小 ...

  7. vs 中怎么用c改变部分字体颜色

    // test.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <windows.h> #include< ...

  8. 怎么改变 placeholder字体颜色

    ::-webkit-input-placeholder{color: #888}::-moz-placeholder{color: #888}:-moz-placeholder{color: #888 ...

  9. wpf改变网格字体颜色

    1.创建个转换器 public class ColorConvertor : IValueConverter { public object Convert(object value, Type ta ...

随机推荐

  1. ubuntu 12.04 安装nginx

    nginx是一个强大的高性能反向代理服务器,其特点是占内存少,并发能力强,在高并发的情况下是apache 的一个不错的代替品,能够支持高达50000个并发连接数的响应,那么这么强大的武器,究竟如何在l ...

  2. angularJs项目实战!04:angularjs的性能问题

    上一篇文章中我花了很多口舌去介绍angularjs是一个中型框架,面对大型应用时少不了第三方类库的配合.而我的核心议题是:如何以angularjs的思路使用其他类库,这里jquery是最好的例子了,谁 ...

  3. android popupwindow低版本报空指针

    在项目中使用Popupwindow pop=new Popupwindow();在2.3版本报 异常信息: Exception: null 堆栈信息: android.widget.PopupWind ...

  4. Leetcode:Largest Number详细题解

    题目 Given a list of non negative integers, arrange them such that they form the largest number. For e ...

  5. 【转】Thunderbird中配置签名

    原文网址:https://support.mozilla.org/zh-CN/kb/Thunderbird%E4%B8%AD%E9%85%8D%E7%BD%AE%E7%AD%BE%E5%90%8D “ ...

  6. 我学hash_map(1)

    本文来源:http://blog.chinaunix.net/uid-26548237-id-3800125.html  map是什么? map是键值对(key-value),复杂度是O(n).但是查 ...

  7. js一些通用方法的封装

    //封装StringBuilder function StringBuilder() { this._string_ = new Array(); } StringBuilder.prototype. ...

  8. Oracle_Q&A_03

    1.先导入SQL文件 执行语句查看表信息 select * from student;--学生信息--(stunum,stuname,classid)select * from class;--班级信 ...

  9. (3)选择元素——(15)总结(Summary)

    With the techniques that we have covered in this chapter, we should now be able to locate sets of el ...

  10. (3)选择元素——(16)延伸阅读(Further reading)

    The topic of selectors and traversal methods will be explored in more detail in Chapter 9. A complet ...