首页 \ 问答 \ 将HTML特殊字符集相对于父级对齐(Aligning HTML special charaters bottom relative to parent)

将HTML特殊字符集相对于父级对齐(Aligning HTML special charaters bottom relative to parent)

所以我正在为WordPress中的客户建立一个网站,并且设计在几个标题上有正方形句号,但他们使用的字体有完整的句号。

我用短代码'[stop]'解决了这个问题,这将返回以下代码:

<span class="square-stop">&#9632;</span>

这是一个HTML方形符号■包裹在样式的范围内。

但我似乎可以让它与文本对齐。 在这里查看示例: http//jsfiddle.net/9a8x844n/

<h1>This is a heading of some kind<span class="square-stop">&#9632;</span></h1>

So I'm building a website for a client in WordPress and the design has square full stops on a few headings but the font they have used has round full stops.

I have solved this issue with a shortcode '[stop]' and this will return the following code:

<span class="square-stop">&#9632;</span>

This is a HTML square symbol ■ wrapped in a span for styling.

But I can seem to get it to align bottom with the text. See an example here: http://jsfiddle.net/9a8x844n/

<h1>This is a heading of some kind<span class="square-stop">&#9632;</span></h1>

原文:https://stackoverflow.com/questions/26296350
更新时间:2022-04-23 12:04

最满意答案

setTimeout是异步的(它在执行回调之前返回),并且回调将在新的空栈帧上执行。 这是完整的目的。

它不是递归调用,因此需要保留范围(在非尾部调用优化函数的情况下)。 但这也意味着该功能被阻塞,这不是你想要的。


setTimeout is asynchronous (it returns before executing the callback), and the callback will be executed on a new, empty stack frame. That's the whole purpose.

It is not a recursive call, for which scope (in case of a non-tail-call-optimized function) would need to be retained. But that would also mean that the function became blocking, which is not what you want.

相关问答

更多
  • 在大多数情况下,浏览器执行线程处于空闲状态 ,不会运行任何代码。 当你使用setTimeout注册一些要执行的函数时,它会在给定的毫秒数之后执行。 现在:如果在给定的时间量之后执行一些其他代码(如事件处理程序或长循环),则浏览器工作线程正忙,您的功能将不得不等待。 考虑这个代码: setTimeout(f, 500); for(var i = 0; i < 10000000; ++i){ //... } setTimeout立即返回,允许执行循环。 如果这个循环运行超过500毫秒,它不会被打断,你 ...
  • 你想要setInterval var intervalId = setInterval(function() { doGeneration(); }, 1000); // call this to stop it clearInterval(intervalId); You want setInterval var intervalId = setInterval(function() { doGeneration(); }, 1000); // call this ...
  • setTimeout是异步的(它在执行回调之前返回),并且回调将在新的空栈帧上执行。 这是完整的目的。 它不是递归调用,因此需要保留范围(在非尾部调用优化函数的情况下)。 但这也意味着该功能被阻塞,这不是你想要的。 setTimeout is asynchronous (it returns before executing the callback), and the callback will be executed on a new, empty stack frame. That's the who ...
  • setTimeout稍后运行代码,while循环运行“now”。 你不能成功地将两者结合起来。所以,你必须以不同的方式编写你的代码,这样的事情应该有效: let downSeconds = 5; function doCountDown() { downSeconds--; $("#timerDisplay").text = downSeconds; if (downSeconds > 0) { setTimeout(doCountDown, 1000); } ...
  • setTimeout可能正常工作,您需要做的是为测试启用async 。 对于Qunit,你需要调用assert.async(); docs: http : //api.qunitjs.com/async/ setTimeout is probably working fine and what you need to do is enable async for the test. For Qunit you need to call assert.async(); docs: http://api.qun ...
  • 你在idh之前没有var (或const或let ),这使得它成为一个隐式的全局 。 这意味着每个对你的函数的调用都会共享相同的闭包变量并覆盖它的值。 要解决这个问题,请声明它的作用域为: var idh = id.replace(/^#/, ''); 我还建议在您的JS文件的顶部添加“use strict”编译指示,这将有助于捕捉这样的问题。 隐含的全局变量是个坏消息。 You do not have var (or const or let) before idh, which makes it an ...
  • 你没有在第二个例子中传递setTimeout函数d ; 而是传递d() ,这是调用d的结果。 调用d的结果是undefined因为它没有返回任何东西,它将转换为字符串"undefined" ,然后进行eval ,完全没有。 关于callstack,由于你在c中调用d ,所以你在callstack中看到c 。 为了澄清,你的第二个例子与之相同 function c() { var temp = d(); setTimeout(temp, 1000); } function d() { ...
  • 不知道我是否完全理解了这个问题,但根据您的期望,其他时间间隔应该是: interval - (Date.now() - records[totalCalls-maxCalls])) 因为一旦回调被调用, totalCalls就会增加。 所以,要么添加totalCalls++; 作为else块的第一条语句(在setInterval()之前)或者不期望值递增(建议编号1)。 Not sure if I understood the problem entirely, but based on your exp ...
  • 在摩卡我设置超时如下: it("send message", function(done) { this.timeout(15000); setTimeout(() => { ... done() }, 5000); }) 注意一件事:我使用“功能”,以便“this”是正确的对象。 从网站 In mocha I set the timeout as follows: it("send message", function(done) ...
  • 出现问题:当不透明度<0时,将其设置为0,然后执行: if (opacity < pEndOpac) 。 pEndOpac为0,因此0 <0的计算结果为false,永远不会清除超时。 解决方法是if (opacity <= pEndOpac) : function fadeIn() { opacity = opacity + opacityChangePerFrame; if (opacity >= pEndOpac) { clearTimeout(timeoutVar); ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。