小编Oli*_*ver的帖子

如何在JS中选择具有类的所有元素

我想用JS修改所有类。有没有办法在不手动设置数组索引的情况下选择它们(例如 [0] 或 [1] 或 [184])?

示例代码:

<div class='message'>something:</div>
<div class='message'>something</div>
Run Code Online (Sandbox Code Playgroud)
const element = document.querySelectorAll(".message");
element.classList.add("color");
Run Code Online (Sandbox Code Playgroud)

它仅在我添加[0]并且仅适用于具有该类的第一个元素时才有效。但我想用类修改所有元素。

html javascript

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

Meta tags for URL with description and image (In Skype, Discord)


When somone send link in Skype or Discord, it can create image and description, like is shown on screenshots:
Skype(Img + Descr)
不和谐(Img + Descr)

I think its because of <meta> tags in HTML <head>. But in HTML can be hunderts of <meta> tags.. I found this page on GitHub, Link: https://gist.github.com/lancejpollard/1978404 And that's so many tags. Is there someone who know only tags, which is making these images and descriptions on Skype and Discord?

I tried adding some meta tags, favicon, and title, but …

html meta html5 skype discord

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

在没有 OpenGL 的 Linux 窗口中用 C 绘制像素

如何以最佳性能在 Linux 窗口内手动绘制像素?

我不想直接写入帧缓冲区,但我也不想使用 OpenGL 或类似的库/API 为您做所有事情。是否可以创建彩色像素的二维数组,然后将它们打印在窗口内?

像这样(但有更多颜色):

_________________
| My App      -ox|
_________________|
|RRRRGGBBRRRGGBBB|
|RRGGRGRGGRGRGGRR|
|RRGGGGBBBBRRGGBB|
|________________|
Run Code Online (Sandbox Code Playgroud)

c linux graphics pixel

2
推荐指数
1
解决办法
2644
查看次数

标签 统计

html ×2

c ×1

discord ×1

graphics ×1

html5 ×1

javascript ×1

linux ×1

meta ×1

pixel ×1

skype ×1