asp.net - 如何通过博客计数调整两个值之间的 HTML div/链接?
问题描述
我想使用 . 放大或缩小类别的标签框transform: scale(1.x)
。例如;
A tag --> 8 blogs,
B tag --> 4 blogs,
C tag --> 3 blogs,
D tag --> 2 blogs,
E tag --> 0 blog
当有标签数的博客数一直是这样的时候,天平可以是这样的;
8 blogs--> 1.5,
4 blogs --> 1.4,
3 blogs --> 1.3
2 blogs --> 1.2,
0 blog --> 1.0
@foreach (var item in Model.BlogTag)
{
var tagCounts = Model.BlogTag.GroupBy(p=>p.BlogTagRelation).Select(p=>p.Key);
int tagCount = item.BlogTagRelation.Distinct().Count();
//0-5 arasında değişkenlik göstermeli!
int item_scale_by_count = 0;
if (tagCount > 1)
{
for (int i = 0; i < tagCounts.Count(); i++)
{
}
}
<a style="transform:scale(1.@item_scale_by_count)" href="@item.Sitemap.Permalink" class="category_box__tag_link mr-2 mb-2">@item.Title (@tagCount)</a>
}
但我想在 1.0 和 1.5 之间更改标签框比例。我怎样才能动态地做到这一点?
解决方案
推荐阅读
- qt - 如何在两个 ListView 之间共享 ItemSelectionModel
- .htaccess - .htaccess 在一次 301 重定向中将所有“+”转换为“-”
- asp.net - 如何正确地将目标框架更改为 .NET 4.0
- ios - 未找到架构 x86_64 的 MDF 国际化框架
- php - explode() 期望参数 2 是字符串,给定数组
- c - 寄存器如何作为汇编中的参数工作?
- java - 如果我在一个请求中获得四个 pojo,如何重新编写代码以进行改造?
- if-statement - Sumif 和 IF,将一列相加并将其与另一列进行比较
- c# - 运行两个任务时出现内存不足异常 (Outlook VSTO)
- real-time - 使用 RT 补丁在 linux 中为 ktimersoftd 设置默认优先级