小编Van*_*ert的帖子

Google fonts API会生成CSS 2.1验证错误

叫我一个rube,但我希望我的工作能够验证.使用Google Font API的网页验证为CSS3,但不是CSS2.1.这是href,直接来自Google说明:

<link href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css" id="googlefont" />

CSS 2.1和XHTML 1.0 Strict是不合理的限制,因此当没有可行的解决方案时(即嵌入Flash视频,也就是说,没有其他跨浏览器,我知道的易于实现的解决方案),我不反对脚本解决方法.那么,是否有可行的解决方案,如果没有,任何人都可以建议脚本解决方法吗?或者我应该只是验证CSS3并称之为好?

谢谢,

motorhobo

css w3c css3 css-validator

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

vscode API:获取行最后一个字符的位置

继续关注有关使用 VS Code API进行 VS Code 扩展的尚未解答的问题。我没有回答,因为它特别要求使用对象的方法来解决。我无法做到这一点,也无法循环遍历对象来获取最后一个字符。尝试操作选择也不起作用,因为执行开发主机开始运行后似乎不会反映窗口中的实际选择。我能找到的唯一解决方案是下面的跳环练习,它获取一行的第一个字符和下一行的第一个字符,设置一个范围,获取该范围的文本,然后减少该文本字符串的长度加 1 即可获取上一行的最后一个字符。withPositionvscode.commands.executeCommandvscode.window.activeTextEditor

function getCursorPosition() {
  const position = editor.selection.active;
  curPos = selection.start;
  return curPos;
}
curPos = getCursorPosition();
var curLineStart =  new vscode.Position(curPos.line, 0);
var nextLineStart = new vscode.Position(curPos.line + 1, 0);
var rangeWithFirstCharOfNextLine = new vscode.Range( curLineStart, nextLineStart);
var contentWithFirstCharOfNextLine = editor.document.getText(rangeWithFirstCharOfNextLine);
var firstLineLength = contentWithFirstCharOfNextLine.length - 1;
var curLinePos = new vscode.Position(curPos.line, firstLineLength);
var curLineEndPos = curLinePos.character;
console.log('curLineEndPos :>> ' + curLineEndPos);
Run Code Online (Sandbox Code Playgroud)

我显然错过了一些东西 - 使用 …

visual-studio-code vscode-extensions

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