font-size

Limiting Characters to a specfic width

醉酒当歌 提交于 2019-12-02 22:09:49
问题 I have run into this problem a few times. I have no problem limiting characters in a string to a specific number. However, some characters are longer than others so it wraps to another line or makes my DIV element wider and not uniform with the rest of my website. For instance: Literacy - Is it the Sa Machu Picchu, Cuzco, Pe are the exactly the same amount of characters (23) including spaces but the Machu Pichu one is longer in terms of the actual width on screen. Is there any way to have a

How do you set the font size on a UIBarButtonItem?

不问归期 提交于 2019-12-02 21:48:52
I can't find a way to set the font size of the title in a custom UIBarButtonItem. The only way I can think of getting around this is to set it as an image which I would like to avoid. Any other suggestions? In a easy way, simply: Objective-C: NSUInteger fontSize = 20; UIFont *font = [UIFont boldSystemFontOfSize:fontSize]; NSDictionary *attributes = @{NSFontAttributeName: font}; UIBarButtonItem *item = [[UIBarButtonItem alloc] init]; [item setTitle:@"Some Text"]; [item setTitleTextAttributes:attributes forState:UIControlStateNormal]; self.navigationItem.rightBarButtonItem = item; Swift: let

原生模态框,遮罩层

匿名 (未验证) 提交于 2019-12-02 20:32:16
<! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" /> < meta name = "viewport" content = "width=device-width, initial-scale=1.0" /> < meta http-equiv = "X-UA-Compatible" content = "ie=edge" /> < title > Document </ title > < style > body { background-color : #000000 ; } ul , li { list-style : none ; padding : 0 ; margin : 0 ; } .div1 { position : fixed ; left : 0 ; right : 0 ; top : 100px ; margin : 0 auto ; width : 345px ; height : 256px ; background : #ffffff ; border-radius : 5px ; overflow : hidden ; z-index : 100 ; } .line { width : 343px ; border : 1px dashed

使用rem编写自适应屏幕网页造成div被span撑高的解决办法

匿名 (未验证) 提交于 2019-12-02 20:21:24
原始代码: <html> <head> <meta charset="utf-8"> <meta content="ie=edge" http-equiv="x-ua-compatible"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /> </head> <style type="text/css"> #content{ width:7.2rem } .price-div{ background-color:yellow; } .price-div span{ background-color:green; } .price-unit{ font-size:0.25rem; } .price-number{ font-size:0.31rem; } </style> <body> <div id="content" style="float:left"> <div class="price-div" > <span class="price-unit">¥</span> <span class="price-number">42</span> </div> </div> <script type="text

02HTML-&lt;img&gt;

匿名 (未验证) 提交于 2019-12-02 20:21:24
一、img的属性:alt/title   alt属性是替换名字,是给搜索引擎抓取使用,当图片显示不出来时,就会显示出alt的内容;        title 属性是提示文字,当鼠标移到图片上的时候会显示出来,大部分的标签都会有这个属性      *******************************alt和title属性的区别****************************** ** alt属性:   alt属性是为了在文档中图像不能显示的时候,提供给用户的文字说明。(alt text)   目标元素:img/area/input:image   图像不能显示的情况:     用户的浏览器不支持图像显示,或者图像显示被禁止     视觉障碍或者使用屏幕阅读器的用户   注意事项:     有文字的图像,通常会将alt设置为该文字     装饰性的图片可以设置alt=””,但是不能忽略,否则文字浏览器或屏幕浏览器会显示图片的文件名     alt的长度应该遵循“尽可能短,尽需要长” ** title属性   title属性能够为元素提供额外信息,(tool tip)   目标元素:除了HTML/head/meta/title/script/base/basefont/param外的所有元素   主要用途:     为链接添加描述性文字     为图像提供额外的说明信息

Minimum Font Size deprecated on ios version 6.0

两盒软妹~` 提交于 2019-12-02 19:52:46
I just upgraded to xcode 4.5 with iOS 6.0 and it's highlighting a warning on all the UILabels in my XIB files saying "minimum font size deprecated on ios version 6.0". Does anyone know what this is referring to and how to fix it? Update: image is no more available (was at https://skitch.com/hahmadi82/eyk51/cloud ) Manju minimumFontSize property of the UILabel is deprecated from iOS 6.0 onwards. An Alternative to the minimumFontSize is minimumScaleFactor . If you assign minimumFontSize/defaultFontSize to minimumScaleFactor , it works in the same way as minimumFontSize. The Code is as follows -

ContentEditable - Get current font color/size

萝らか妹 提交于 2019-12-02 19:27:40
I'm working on Rich Text Editor for web browser and I want to work with values of current font color and size in the RTE/ContentEditable element. Is there some preselected function to get these values, like execCommand, which is connected directly with ContentEditable element? Or should I use some text range jQuery library which will get these properties? You can use document.queryCommandValue() to get the colour and font size of the current selection in all major browsers: Live demo: http://jsfiddle.net/timdown/AJBsY/ Code: var colour = document.queryCommandValue("ForeColor"); var fontSize =

Find all the span styles with font size larger than the most common one via beautiful soup python

只愿长相守 提交于 2019-12-02 18:29:46
问题 I understand how to obtain the text from a specific div or span style from this question: How to find the most common span styles Now the difficulty is trying to find all the span styles with font sizes larger than the most common one? I suspect I should use regular expressions, but first I need to extract the specific most common font size? Also, how do you determine "larger than" when the condition is a string? 回答1: This may help you:- from bs4 import BeautifulSoup import re usedFontSize =

How can we increase the font size in toast?

。_饼干妹妹 提交于 2019-12-02 17:27:39
Is there any way to increase the font size in toast without customizing? I don't want to create a layout for increasing the text size. Is there any way? Thanks, Niki I believe it is achieveable by this: ViewGroup group = (ViewGroup) toast.getView(); TextView messageTextView = (TextView) group.getChildAt(0); messageTextView.setTextSize(25); Anil M H this is ... Toast toast = Toast.makeText(context, R.string.yummyToast, Toast.LENGTH_SHORT); //the default toast view group is a relativelayout RelativeLayout toastLayout = (RelativeLayout) toast.getView(); TextView toastTV = (TextView) toastLayout

Shortcut for changing font size

本秂侑毒 提交于 2019-12-02 16:02:53
Does anybody know if there is a shortcut or something similar for changing the font size in the text editor in Visual Studio 2008? What I mean is something like Ctrl + mouse wheel like in Firefox. Accessing the Options window and then selecting Environment > Fonts and Colors is fine if you don't have to change the font size all the time, but in my case, I would like to be able to change it depending on what I am doing (writing and reading code or just reading it). I guess I could create two almost identical settings files and import them whenever I want, but that is even slower. In the Macros