font-size

Converting between WPF font size and “standard” font size

帅比萌擦擦* 提交于 2019-12-03 01:14:30
I've noticed in WPF, the default font size of 12 points is roughly equivalent to 9 points in "normal" applications (e.g. WordPad), 10 pt in WPF is roughly 7 pt standard, and when I try to match the default font size of 10 pt in WordPad in WPF, I've found 13 is the closest. First of all, why does WPF use such bizarre non-standard font sizes, and secondly, is there a reliable way to convert between the two? My reason for asking is I want to build a font size menu with "standard" font sizes of 9, 10, 12, 14, 16, 18, 24, 36, 48, but I'm pretty sure if I use those actual values they will be wildly

pc端和移动端默认样式重置

匿名 (未验证) 提交于 2019-12-03 00:22:01
首先说一下,为何要用重置样式 除了省心之外,还有两个好处 1.方便设计师/程序员发挥 白纸的感觉确实好。各种margin,padding,border的为0。。。 2. 便于发现前端代码的遗漏 用了reset后,如果“blockquote、ol、ul、hn等语义元素在没有赋以其他合理的样式”,会非常扎眼(任何人都看得出来),开发者第一反应会是“卧槽忘了写”并迅速补救。并迅速补救。但如果没reset,浏览器会提供“勉强可以”的默认样式,很多人可能就发现不了或者会想“可能就这么设计的吧”,开发者即使意识到因为遗漏导致和设计稿不一致,出于人性弱点也可能会想“还要赶下一个项目呢先这么凑合着吧”――由于破窗效应,这可能会导致越来越多的“凑合着吧” pc端: html{font-family:"Microsoft YaHei UI","Microsoft YaHei",sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%} html,body,div,object,iframe,applet,object,h1,h2,h3,h4,h5,h6,p,blockquote,pre,address,dl,dt,dd,ol,ul,li,table,caption,tbody,tfoot,thead,tr,th,td

通过js 来计算根元素px 实现响应式

匿名 (未验证) 提交于 2019-12-02 23:57:01
<!DOCTYPE html> <html lang = "zh-CN" > <head> <meta charset = "UTF-8" > <title> 单屏布局 </title> <meta name = "viewport" content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" > <meta name = "keywords" content = "123" > <meta name = "description" content = "321" > <meta name = "robots" content = "all" > <meta name = "baiduspider" content = "all" > <meta name = "googlebot" content = "all" > <meta http-equiv = "X-UA-Compatible" content = "IE=Edge,chrome=1" > <meta name = "renderer" content = "webkit" > <meta name = "format-detection" content = "telephone=no" />

清除浏览器默认样式

匿名 (未验证) 提交于 2019-12-02 23:49:02
清除浏览器默认样式的原因 一、 某些标签的默认样式不符合我们的设计要求。比如说a标签,默认它是有一条下划线,并且字体颜色也让人觉得很难看,所以我们需要清除它默认的样式,同时根据要求给它重新添加自定义样式。如图是a标签的默认样式。 二、各浏览器默认的样式各不同,所以会影响到我们的开发,因为在每次开发之前应该先对浏览器的默认样式进行一次清除,让每个浏览器保持一致的初始化样式。清除默认样式可以提高代码浏览器间的兼容性,同一个标签用在不同的浏览器中,默认样式可能不一样,比如说,行高在某个浏览器中是1,在另一个浏览器中可能是1.1,这样在布局的时候会得到两种不同的效果,从而带来兼容性问题。因此,统一清除标签的默认样式,再统一重新添加新的样式,就能避免这种问题。 1.页边距 IE默认为10px,通过body的margin属性设置 FF默认为8px,通过body的padding属性设置 要清除页边距一定要清除这两个属性值 body { margin:0; padding:0; } 2.段间距 IE默认为19px,通过p的margin-top属性设置 FF默认为1.12em,通过p的margin-bottom属性设 p默认为块状显示,要清除段间距,一般可以设置 p { margin-top:0; margin-bottom:0; } 3.标题样式 h1~h6默认加粗显示:font-weight

跟我一起做一个vue的小项目(十一)

匿名 (未验证) 提交于 2019-12-02 23:48:02
接下来我们进行的是详情页动态路由及banner布局 先看页面的效果 下面是代码部分 <template> <div> <div class="banner"> <img src="//img1.qunarzz.com/sight/p0/1409/19/adca619faaab0898245dc4ec482b5722.jpg_600x330_f922b488.jpg" alt="" class="banner-img"> <div class="banner-info"> <div class="banner-title"> 故宫(AAAAA景区) </div> <div class="banner-number"> <span class="iconfont"></span> 39 </div> </div> </div> </div> </template> <script> export default { name: 'DetailBanner' } </script> <style lang="stylus" scoped> .banner overflow:hidden height:0 padding-bottom:55% position:relative .banner-img{ width:100% } .banner-info display:flex

How can i get default font size in pixels by using JavaScript or JQuery?

风流意气都作罢 提交于 2019-12-02 23:43:17
As you know em is a relative font measurement where one em is equal to the height of the letter "M" in the default font size. An advantage in using it is because you will be able to resize the text. But how can i get default font size of current environment (in pixels) by using JavaScript or JQuery ? regards, There are a couple of situations this can be useful- function getDefaultFontSize(pa){ pa= pa || document.body; var who= document.createElement('div'); who.style.cssText='display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em'; who.appendChild

CSS汇总之CSS选择器

痴心易碎 提交于 2019-12-02 23:07:55
要使用css对HTML页面中的元素实现一对一,一对多或者多对一的控制,这就需要用到CSS选择器。 一、通配符选择器 语法: *{ } 说明:通配符选择器可以选择页面上所有的html标签( 包括body,html标签 ) 用途:练习阶段清除页面所有标签的默认样式(使用通配符清除默认样式仅在练习阶段使用) <style> * { margin: 0; padding: 0; color: red; background: lightblue; } </style> <div>这是一个div</div> <p>这是一个p标签</p> 效果:body区域的背景色渲染成了lightblue,div和p标签的字体颜色渲染成了红色 二、标签选择器 语法: 标签名 {} 说明:通过html标签名选择标签设置样式,w3c也称作元素选择器或者类型选择器 用途:常用在某些标签的特殊样式 比如a、ul、ol等 <style> ul { list-style: none; } a { text-decoration: none; color: red; } </style> <ul> <li><a href="">链接</a></li> <li><a href="">链接</a></li> <li><a href="">链接</a></li> </ul>   效果:li的小圆点去掉和a标签的默认颜色改变 三

how to set different font sizes in the same html header?

白昼怎懂夜的黑 提交于 2019-12-02 22:59:41
问题 I want to create an html header as follows "Version1: (10.3.4) vs Version2: (10.3.4)" and I want the version number be smaller than the words "Version1" and "Version2" how can I do this? 回答1: This is what you need. No special coding required. <h1>Version1: <small>(10.3.4)</small> vs Version2: <small>(10.3.4)</small></h1> 回答2: Wrap the version number inside a span and give it a different font-size. span { font-size: 0.5em; } <h1>"Version1: <span>(10.3.4)</span> vs Version2: <span>(10.3.4)<

WPF automatic resize font until it fits within parent control

我怕爱的太早我们不能终老 提交于 2019-12-02 22:35:08
I have a user control who's root element is a Grid. I also have have a ContentControl that serves as a placeholder for some text that is filled when data is loaded. This control can be moved around within the user control and so it's position can be anywhere. If the text is too long to fit within the root Grid of the user control, I want to reduce the font size of the ContentControl until the text fits. My problem is that I can't seem to find an event that I can handle to do this process. I tried using the ContentControl.LayoutUpdated event;however, the sender parameter for this always appears

iTextSharp: Why when adding a image to a pdf page the text font is different?

一个人想着一个人 提交于 2019-12-02 22:09:55
问题 I use Helvetica font and 14 px size for text. The problem is that if a page does not have any image on it the text is very clear, but in a page with at least 1 image the text is getting a little bold. You can see what I mean in images below: * Without image on page * With image on page The correct font is the one that appear in picture #1. How to make all pages have the same font even if the page contains an image or not? Thanks. Sample code: Document document = new Document(PageSize.LETTER);