在图像顶部的中心离子图标(Center Ionic icon on top of image)
通过中心读取悬停图像上方的字体真棒图标及其相应的答案后,我仍然无法使用离子图标复制此答案。
我正在使用的代码如下:
<div class="video-thumbnail"> <img src="image here" /> <i class="icon ion-play"></i> </div>
我正在使用的CSS是:
.video-thumbnail { position: relative; margin: 0 auto; display: inline-block; } .video-thumbnail img { position: absolute; } .video-thumbnail i { position: absolute; top: 50%; transform: translateY(-50%); }
我已经让它在彼此之上,但似乎无法找到中间点。 希望水平和垂直居中。 我不是在寻找任何悬停状态只是图像上的明显图标。
谢谢!
After reading through Center a Font Awesome icon over the image on hover and it's corresponding answers, I'm still having trouble replicating this answer with an Ionic Icon.
Code I'm using is as follows:
<div class="video-thumbnail"> <img src="image here" /> <i class="icon ion-play"></i> </div>
CSS I'm using is:
.video-thumbnail { position: relative; margin: 0 auto; display: inline-block; } .video-thumbnail img { position: absolute; } .video-thumbnail i { position: absolute; top: 50%; transform: translateY(-50%); }
I've got it to go on top of each other but can't seem to find the middle point. Looking to center horizontally and vertically. I'm not looking for any hover states just a blatant icon over image.
Thanks!
原文:https://stackoverflow.com/questions/32257288
最满意答案
我曾经参与过基于国际金融C#的软件包,该软件包必须支持多种货币,并且我们支持6位小数位。 我们有几位非常有经验的设计师告诉我们,这足够了。
I once worked on an international financial C# based package, which had to support numerous currencies, and we supported 6 decimal places. We had a couple of very experienced designers who told us that would be sufficient.
相关问答
更多-
QString:具有最大2个小数位且没有结尾零的数字(QString:number with maximum 2 decimal places without trailing zero)[2022-10-22]
文档很清楚你应该做什么: 精度也用参数格式指定。 对于'e','E'和'f'格式,精度表示小数点后的位数。 对于'g'和'G'格式,精度表示有效数字的最大数量(省略尾随零)。 因此,请使用'g'或'G'格式。 main.cpp中 #include#include int main() { qDebug() << QString::number(96400.0000001 / 1000.0, 'g', 5); qDebug() << QString:: ... -
在货币兑换率中,使用的最大小数位数是多少?(In a currency exchange rate what is the maximum number of decimal places used?)[2022-01-23]
我曾经参与过基于国际金融C#的软件包,该软件包必须支持多种货币,并且我们支持6位小数位。 我们有几位非常有经验的设计师告诉我们,这足够了。 I once worked on an international financial C# based package, which had to support numerous currencies, and we supported 6 decimal places. We had a couple of very experienced designers w ... -
确定汇率的算法(Algorithm to determine exchange rate)[2024-03-11]
您正在寻找有向图中的最短路径,其中货币是顶点并且给定的汇率是边缘。 如果仅为一个方向提供汇率,则可以以较高的成本为相反的方向添加一个汇率。 You're looking for the shortest path in a directed graph, where the currencies are the vertices and the given exchange rates are the edges. If an exchange rate is given only for one dire ... -
如果您这样做的唯一原因是出于显示目的,您是否有机会这样做? DECLARE @fuelPrice FLOAT = 2.099 SELECT '$' + cast(@fuelprice as varchar(10)) The Standard Numeric Format Strings allow you to specify a precision. Use C3 as the format instead: DECLARE @fuelPrice FLOAT = 2.099 SELECT FORMAT( ...
-
我发现问题出在货币十进制符号上。 该平台设置为在小数点后不使用数字,因此它将总和降低。 如果遇到此问题,请转至本地化 - >货币 - >选择您的币种 - >启用小数点。 应该对所有货币做出工作。 I found out that the problem was in the currency decimal sign. The platform was set to use no digits after the decimal sign so it was flooring the sum down. I ...
-
使用下面的代码从数字格式化程序中删除小数点: [currencyFormatter setMaximumFractionDigits:0]; 使用上述代码的完整代码: NSDecimalNumber *someAmount = [NSDecimalNumber decimalNumberWithString:unformattedString]; NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorel ...
-
不确定,但会: double d = 2.0; if ((long) d == d) { // then } 为你工作? 那只是在这个特殊情况下回答你的问题。 Not sure, but would: double d = 2.0; if ((long) d == d) { // then } Work for you? That only answers your question in that particular case.
-
在printf()使用*标记你想要的小数位数: #include
int main(void) { int a; printf("Upto which number of decimal places you want to print value of '2.554648' ?"); scanf("%d", &a); printf("Value of '2.554648 upto %d number of decimal places = %.*f" ... -
首先修整小数位数,然后将文本与前导美元符号连接起来。 function sendNotification() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var cell = ss.getActiveCell().getA1Notation(); var cellvalue = ss.getActiveCell().getValue().toString(); va ...
-
货币兑换 - 如何从onclick调用函数内的函数(Currency Exchange - How to call a function within a function from onclick)[2022-03-31]
由于您需要在页面加载时自动检索值,因此需要使用xhr请求。 $.get( "your-url", function( data ) { $( "where you want to insert it" ).html( data ); //or call your-custom-function(data); }); 如果要在click事件上获取值,请将上面的代码作为函数插入到jquery click事件处理程序中 Thanks so much @Anmol. I got it working with t ...