我想将所选文本的颜色更改为#3C3,而不是 div 2。
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="lib/jquery.mobile-1.3.1.min.css" />
<script type="text/javascript" src="lib/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="lib/jquery.mobile-1.3.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="scripts/jquery.mobile-events.min.js"></script>
<script type="text/javascript" src="scripts/jquery.scrollTo-1.4.2-min.js"></script>
<link rel="stylesheet" href="css/test.css" />
<script type="text/javascript" src="scripts/jquery.xpath.js"></script>
<script type="text/javascript" src="scripts/test.js"></script>
</head>
<body>
<div data-role="page" id="test-page" class="bg_main">
<div data-role="header" id="bookmarkheader">.............. ...............</div>
<div data-role="content" id="content" class="content_bg">
<div class="one">some text</div>
<div class="two">some text</div>
</div>
<div data-role="footer" id="footer_main">................. .................</div>
</div>
</body>
</html>
CSS
.one::selection {
background-color:#3C3;
}
上面的代码不起作用。有人可以帮我吗?