faisal faisal - 1 year ago 124
C# Question

How to change font size while using string.format in asp.net MVC

Referring to the question my code is

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

How can i change the font size in it

Any help would be highly appreciated


I have changed the code
@(string.Format("<div style='font-size:10px'></div> {0:dd MMMM yyyy hh:mm tt}", dr[1]))

And got the output

enter image description here

Answer Source

If you're trying to statically change the font size of the output, wrap it in HTML:

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download