我想让文本的一部分变得粗体并且比文本的其他部分更大。但目前我使用的 jquery 所有文本的大小、字体粗细和颜色都是相同的。例如,从下面的代码的第一部分开始,我希望出现“硬盘驱动器:辅助存储设备”。我希望硬盘驱动器和标题采用粗体。我想要另一半正常字体粗细更小。如何使用我拥有的代码在 jquery 或 css 中设置样式?:)
如果您能提供帮助,我们将不胜感激!
这是我的 j 查询:
$('#harddrive').hover(function() {
$('#info').text('Hard drive: Secondary Storage Device');
}, function() {
$('#info').text('');
});
$('#cd').hover(function() {
$('#info').text('CD: External Secondary Storage Device');
}, function() {
$('#info').text('');
});
$('#fan').hover(function() {
$('#info').text('Fan: Used to keep the computer cool');
}, function() {
$('#info').text('');
});
$('#powerblock').hover(function() {
$('#info').text('Power Block: Provides power to the computer');
}, function() {
$('#info').text('');
});
Run Code Online (Sandbox Code Playgroud) 我有一个时钟显示当前时间小时:分钟:秒.目前时间显示为20:30:25,但我的问题是,当时间是单个数字,例如1.05(3秒)am时,它将在时钟1:5:3上显示如下.我希望它看起来像这样01:05:03.
如何才能做到这一点?
var today = new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
today = hours+':'+minutes+':'+seconds;
document.write(today);
Run Code Online (Sandbox Code Playgroud)