Where we should declare font size, line height and font-family to body, before css reset or after?
Date : March 29 2020, 07:55 AM
wish helps you If you don’t reset any font property that is set within your mentioned font rule, it doesn’t matter whether you put it before or after the reset as it won’t be altered by the reset.
|
Regular expression in C# to replace font-size, font-family, line-height, etc
Tag : chash , By : Kilimanjaro
Date : March 29 2020, 07:55 AM
Any of those help Currently I'm eliminating certain formatting tags from HTML strings, and would like to learn enough about regular expressions to be able to replace any formatting. For starters, this is what I've done, but I'd like it to work with any font size, family, etc: , Helper function public static string RemoveStyle(string html, string style)
{
Regex regex = new Regex(style + "\\s*:.*?;?");
return regex.Replace(html, string.Empty);
}
string input = "color: red ; line-height: 10px ; font-family: Arial, Helvetica, sans; ";
input = RemoveStyle(input, "line-height");
input = RemoveStyle(input, "font-family");
// now, input = "color: red ;"
|
The exact height of a text line (font-size + line-height)
Tag : html , By : Mario Tristan
Date : March 29 2020, 07:55 AM
wish helps you line-height works only with the block-level elements, which mean you need to apply display: block; or display: inline-block; to your span to have line-height working. Hope this helps. http://jsfiddle.net/ghxgouba/3/span {
font-size: 50px;
line-height: 50px;
background: darkblue;
color: #fff;
font-family: Arial;
display: inline-block;
}
img {
vertical-align: top;
}
#ret {
margin-top: 30px;
}
|
font-size and line-height set, but changing font still makes an element's height change
Tag : css , By : Francesco
Date : March 29 2020, 07:55 AM
help you fix your problem I ended up solving my own problem (to an acceptable extent) by simply tweaking with the font family and size until it worked for me: body {
font-size: 15px;
line-height: 1.2;
}
body, .same-font {
font-family: Helvetica, sans-serif;
}
code {
font-family: Menlo, Courier New, sans-serif;
font-size: 0.9333em; /* 14/15 */
line-height: 1.28571; /* 18/14 */
}
<ul>
<li>Without any code - 18px height.</li>
<li>With <code>code</code> - 18px height.</li>
<li>With <code class="same-font">code.same-font</code> - 18px height.</li>
</ul>
|
Outlook 2016 - first line with default line-height, mso-line-height-rule doesn't work
Date : March 29 2020, 07:55 AM
may help you . Finally I found some workaround solution... below you can find simplyfied example. Option 1 (hidden with some text, w/o mso-hide: all style): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="cs" xml:lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style>
table {
border-collapse: collapse;
border-spacing: 0px;
}
</style>
</head>
<body>
<div style="overflow:hidden; color:transparent; visibility:hidden; width:0; font-size:0; opacity:0; height:0; line-height:0;">Some not visible text</div>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr height="1">
<td colspan="3" style="background-color: red;"></td>
</tr>
<tr>
<td width="1" style="background-color: blue;"></td>
<td width="160" style="background-color: yellow;">Some very nice text!<br />With 2 lines!</td>
<td width="1" style="background-color: blue;"></td>
</tr>
<tr height="1">
<td colspan="3" style="background-color: red;"></td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="cs" xml:lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style>
table {
border-collapse: collapse;
border-spacing: 0px;
}
</style>
</head>
<body>
<div style="overflow:hidden; color:transparent; visibility:hidden; mso-hide:all; width:0; font-size:0; opacity:0; height:0; line-height:0;">Some not visible text</div>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<!--[if gte mso 9]>
<tr height="0">
<td colspan="3" style="background-color: transparent;"></td>
</tr>
<![endif]-->
<tr height="1">
<td colspan="3" style="background-color: red;"></td>
</tr>
<tr>
<td width="1" style="background-color: blue;"></td>
<td width="160" style="background-color: yellow;">Some very nice text!<br />With 2 lines!</td>
<td width="1" style="background-color: blue;"></td>
</tr>
<tr height="1">
<td colspan="3" style="background-color: red;"></td>
</tr>
</tbody>
</table>
</body>
</html>
|