c# - 在 asp.net MVC 中使用 string.format 时如何更改字体大小

标签 c# asp.net-mvc-5 string.format

引用问题我的代码是

 @(string.Format("{0:dd MMMM yyyy hh:mm tt}", dr[1]))

如何更改里面的字体大小

任何帮助将不胜感激

更新

我已经更改了代码 @(string.Format("<div style='font-size:10px'></div> {0:dd MMMM yyyy hh:mm tt}", dr[1]))

得到输出

enter image description here

最佳答案

如果您尝试静态更改输出的字体大小,请将其包装在 HTML 中:

<span style="font-size:2em;">@(string.Format("{0:dd MMMM yyyy hh:mm tt}", dr[1]))</span>

关于c# - 在 asp.net MVC 中使用 string.format 时如何更改字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39545229/

相关文章:

c# - 使用 XDocument 获取大写的 UTF-8

c# - "ConnectionId"中不存在属性 "http://schemas.microsoft.com/winfx/2006/xaml"

c# - 在 TimeSpan 上使用 String.Format 输出没有毫秒的完整秒数

c# - 具有空格式的 String.Format

java - 将对话消息/标题移至右侧

c# - 将参数传递给 XSLT 样式表

c# - 产量继续?

javascript - 返回部分 View 和消息

c# - 如何使用自定义 IPasswordHasher?

asp.net-mvc - 创建新 Controller - 运行所选代码生成器时出错