小编NiK*_*PrO的帖子

如何在CSS中设置超薄"font-weight"(小于100)?

我想让文字超薄,不到

font-weight: 100
Run Code Online (Sandbox Code Playgroud)

这可能与CSS有关吗?

像这样,但与helvetica: 在此输入图像描述

css fonts

7
推荐指数
2
解决办法
6450
查看次数

Javascript 函数 - 样式更改不起作用

我创建了 2 个简单的函数,但函数 2 不起作用,我尝试将其更改为style.font-weight = "bold";但随后所有崩溃,该怎么办?

function validate() {
  if (document.getElementById('remember').checked) {
    document.getElementById("text").innerHTML = "HELLO WORLD!";
  } else {
    document.getElementById("text").innerHTML = "hello world!";
  }
}

function validate2() {
  if (document.getElementById('remember2').checked) {
    document.getElementById("text").style = "bold";
  } else {
    document.getElementById("text").style = "normal";
  }
}
Run Code Online (Sandbox Code Playgroud)
<div id="text" style="font-weight: normal">hello world!</div>
<input id="remember" type="checkbox" onclick="validate()">Caps</input>
<br>
<input id="remember2" type="checkbox" onclick="validate2()">Bold</input>
Run Code Online (Sandbox Code Playgroud)

这是镀铬问题还是什么?

html javascript css

3
推荐指数
1
解决办法
4966
查看次数

JQuery - 随机.replace()错误

我有随机.replace()的问题,它总是显示相同的随机数,我试图用不同的随机数替换$ random $.

$(document).ready(function() {
  var arr = [
    '1',
    '2',
    '3',
    '4',
    '5',
    '6',
    '7',
    '8',
    '9',
    '10'
  ]
  $("#present-users").children('li.present-user').each(function() {
    arr.push($(this).find('img')[0].title);
  });
  var random = arr[Math.floor(Math.random() * arr.length)];
  var text = "$random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$ $random$".replace(/\$random\$/g, random);
  alert(text)
});
Run Code Online (Sandbox Code Playgroud)

jsfiddle的例子

谢谢,尼古拉

javascript random variables jquery replace

3
推荐指数
1
解决办法
220
查看次数

标签 统计

css ×2

javascript ×2

fonts ×1

html ×1

jquery ×1

random ×1

replace ×1

variables ×1