w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Setting body { font-size: 100% } results in font-size: 12px; and not font-size: 16px; Why?
If you inspect the inline box using a browser’s Developer Tools (hit F12 to open them), you can see that its height is indeed 12px, as set in your code. This happens because there is nothing in it that would require more height; in general, the exact calculation of heights of inline blocks is browser-dependent. The font size of the text is still the browser default, typically 16px. The font size does not mean the height of any particular letter. It is just a fundamental property of the font; typographers usually design characters so that they - together with ascenders, descenders, and diacritic marks - fit into the limits set by the font size (or extend over them just a little), and normally most letters have smaller height.

Categories : CSS

How to change the tabControl tab pages label font, font color and font size in VB 2012
This has been reported as a bug and, if I'm reading correctly, MS have confirmed it. Here's the bug report with a programmatic workaround. Hope this helps :)

Categories : Vb.Net

Adjust the font size to fit for several UIButton's so that they all have the same font size
The approach I ended up taking is to figure out the ideal font size for each button, and then setting all of the buttons to the smallest of the sizes. - (float)idealFontSizeForButton:(UIButton *)button { UILabel *label = button.titleLabel; float width = button.bounds.size.width - 10; assert(button.bounds.size.width >= label.bounds.size.width); CGFloat actualFontSize; [label.text sizeWithFont:label.font minFontSize:label.minimumFontSize actualFontSize:&actualFontSize forWidth:width lineBreakMode:label.lineBreakMode]; debug(@"idealFontSizeForButton %f", actualFontSize); return actualFontSize; } .... // Set text and make sure both buttons have the same font size [_button1 setTitle:title1 forS

Categories : IOS

how to add custom font name and font size in ajax html editor extendor?
You need to download ajaxcontroltoolkit sources from the codeplex site and tweak a bit HtmlEditorExtenderBehavior.pre.js file in Client/MicrosoftAjax.Extended project (this is a link to this file on codeplex: HtmlEditorExtenderBehavior.pre.js Add your font families and font sized to appropriate arrays in _createButton function. After that, you can rebuild project and use custom AjaxControlToolkit dll

Categories : Asp Net

How to set font-size of text box in bounded fields of grid view template fields?
In the OnRowDataBound event hander do something like this. TextBox txtTextBox1 = RowObject.FindControl("TextBox1"); txtTextBox1.Style["font-size"] = sTextSize + "px"; This is a dummy code. Just check how you get the rowobject in below link. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx

Categories : C#

How to preserve text formatting in RichTextBox like Bold, Italics, font color, font size, etc?
RichTextBox supports rtf content, you can't past directly Word content in your RichTextBox. You need to convert the word document into .rtf file. Best way is to use the save As dialog in Microsoft Word. Then you could deploy the document with your application and then load rtf content in your RichTextBox using LoadFile method. RichTextBox1.LoadFile("Help-File.rtf") Obviously, it supposes that basic formatting like mentioned in title (Bold, Italics, font color, font size, ...) are enough for this purpose, since the rft format does not support obviously all MS Word features. Otherwise you may have to implement your own parse/interpretation logic.

Categories : Vb.Net

Change font size of Canvas without knowing font family
Update: (from comments) There is no way around specifying font. The Canvas' font is modeled after the short-hand version of font in CSS. However, there is always a font set on the canvas (or a font type) so what you can do is to first extract the current font by using it like this: var cFont = ctx.font; Then replace size arguments and set it back (note that there might be a style parameter there as well). A simple split for the sake of example: var fontArgs = ctx.font.split(' '); var newSize = '12px'; ctx.font = newSize + ' ' + fontArgs[fontArgs.length - 1]; /// using the last part You will need support for style if needed (IIRC it comes first if used). Notice that font-size is fourth parameter, so this will not work if you will have/not have font-variant(bold,italic,oblique), font

Categories : Javascript

How to define CSS font size within font tags?
Of course you can. Try adding this to a css style included in your page: font[size="2"] { font-size: 20px; } font[size="3"] { font-size: 30px; } Naturally you have to choose the size you prefer. By the way, the <font> tag is obsolete, and you should not use it. Use <span> and assign it a class, instead. Further reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font

Categories : HTML

iOS - Is hard coding the font / font size bad?
iOS is not as versatile as other platforms for those kind of things, and setting the size and the font in code is a common practice, either in your class or in a external Contanst class, or just set them in Interface Builder if you are using it. As a personal preference, setting the fonts in Interface Builder makes them harder to see, I prefer to have all the fonts set in my class and see them together. Then, if I change a font, the rest of them will change at the same time, I dont have to go one by one with all the elements in the xib. In any of the solutions you'll have to recompile every time you change the font. What I can think in terms of adapting it for different languages could be resizing the label where the text is set doing something like: myLabel.minimumFontSize = 8.; myLab

Categories : IOS

dynamically changing the size of font size based on text length using css and html
Getting the size in pixels of a string of text is a hard thing to do and depends a lot on the browser and the user's settings, so it will probably be hard to come up with a solution that works in all cases. By "display user entered text" do you mean the user is typing into a textbox? If so, you can attach a keypress listener that checks the length of the value of the text, then adjusts the font-size accordingly. Here's an example, though you will probably need to change the lengths and font-sizes to meet your needs: Working Demo $('#text').on('keypress', function(e) { var that = $(this), textLength = that.val().length ; if(textLength > 30) { that.css('font-size', '5px'); } else if(textLength > 20) { that.css('font-size', '10px'); } else

Categories : Javascript

Automatically changing font size as parent control changes size
How about this - it has the view box in each grid cell and a textbox as it's content. It will resize the content as you resize the app <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="286" Width="440"> <Grid> <Grid.RowDefinitions> <RowDefinition ></RowDefinition> <RowDefinition ></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinitio

Categories : C#

Relationship between Font size and Label size in Xcode
NSTextField is a control which is inherited from NSControl. And if you check here, you will find - (void)sizeToFit. Resizes the receiver’s frame so that it is the minimum size needed to contain its cell.

Categories : IOS

How to make font-size relative to container size
$(".container").each(function(){ //if container is a class $('.text', $(this)).css({'font-size': $(this).height()+"px"}); //you should only have 1 #text in your document, instead, use class }); you can dynamically resize in jQuery like this: $(window).resize(function(){ $('#body #mytext').css('font-size',($(window).width()*0.5)+'px'); });

Categories : CSS

Adjust image size based on the font size
If you set the size of your font in the <p> tag, you should just be able to use height: 1em; on p img to set the image's height to that of the font. Here's a jsfiddle to show what I mean: http://jsfiddle.net/6GXAE/ And if you want it to be double the size of the font, you'd just set the height of the image to 2em.

Categories : HTML

How to get the size of a row in a text with Jquery without ".css('lineHeight');" and ".css(font-size);"?
Try with outerHeight(): var height = $('#element').outerHeight(); Or maybe you are looking for innerHeight(): var height = $('#element').innerHeight();

Categories : Javascript

Dynamically resize font size to fit container size
I think you could check this question: JavaScript Scale Text to Fit in Fixed Div As I understand that's what you need. EDIT: I found something really interesting in Gist: https://gist.github.com/mekwall/1263939

Categories : Javascript

use different font-size for different font in the same page?
You can change font size using tags or CSS. I suggest CSS because it is more organized and easier to read. CSS .firstfont{ font-size: 10px; (or whatever you want) } .secondfont{ font-size: 12px; (or whatever you want) } In the HTML <div class="firstfont"> This is the first font's text </div> <div class="secondfont"> This is the second font's text </div> Alternatively if you don't want to use CSS you can do <div style="font-size:10px"> This is the first font's text </div> <div style="font-size:12px"> This is the second font's text </div>

Categories : Javascript

pdf /F font size size is not real size?
you should also apply Tm text matrix transformations for this value. "A font defines the glyphs for one standard size. This standard is arranged so that the nominal height of tightly spaced lines of text is 1 unit. In the default user coordinate system, this means the standard glyph size is 1 unit in user space, or 1 ⁄ 72 inch. The standard-size font must then be scaled to be usable. The scale factor is specified as the second operand of the Tf operator, thereby setting the text font size parameter in the graphics state."

Categories : Pdf

How do you change the size of a size of an angular ui bootstrap date picker popup?
This size of the datepicker can be changed by overriding the css for the bootstrap form-control and btn classes as shown in the following example: .my-datepicker .form-control { height: 10px; padding: 11px; } .my-datepicker .btn { padding: 1px 2px; } then apply the my-datepicker class to the datepicker input-group <span class="input-group my-datepicker"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="validToDate" is-open="opened1" min-date="minDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" /> <span class="input-group-btn"><button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyph

Categories : Twitter

why constant size of struct despite having a vector of int
A vector will store its elements in dynamically allocated memory (on the heap). Internally, this might be represented as: T* elems; // Pointer memory. size_t count; // Current number of elements. size_t capacity; // Total number of elements that can be held. so the sizeof(std::vector) is unaffected by the number of elements it contains as it calculating the sizeof its contained members (in this simple example roughly sizeof(T*) + (2 * sizeof(size_t))).

Categories : C++

bootstrap constant box within tabbed content
This is how you can accomplish this... bring your static content out of the .tab-pane div but still under the .tab-content div. Live Example <div class="tab-content"> <h2>Design Elements</h2> <ul> <li>This is the content that need to be static</li> <li>Skill: I'm skilled!</li> <li>Skill: I'm skilled!</li> <li>Skill: I'm skilled!</li> </ul> <div class="tab-pane active" id="design"> <p>Content that needs to be switched between tabs 1</p> </div> <div class="tab-pane" id="video"> <p>Content that needs to be switched between tabs 2</p> </div> <div class="tab-pane" id="web"> &l

Categories : HTML

How to export constant based on size of table
You have a third option: Move MIN_LEVEL and MAX_LEVEL to library.c and create new functions get_min_level() and get_max_level() declared in library.h and implemented in library.c that simply return MIN_LEVEL and MAX_LEVEL respectively. These functions will be visible from consumer.c without revealing the library's internal data structures.

Categories : C

Reducing UIButton size with constant centre
Use CGRectInset on the current frame to produce a new frame which is smaller (or larger) than the original while maintaining the center point. [button setFrame:CGRectInset(button.frame, button.frame.size.width * 0.5, button.frame.size.height * 0.5)];

Categories : IOS

constant for android HD contact photo size
I'm not too sure what you mean by storing the photo twice? Yes, a lot of the devices out there will generate thumbnails, but thats more due to the fact that displaying thumbail images is a regular use case. Have you tried fetching the user ID and using that to query the contacts data table? This may be a long winded approach but, (pseudocode) Fetch contact id using the URI RawContacts.CONTENT_URI Fetch Photo id using the URI Contacts.CONTENT_URI Fetch Photo using the URI Data.CONTENT_URI, the projection you want here is Photo.PHOTO (this will give you a blob) Google should provide easy to read examples of these actions :)

Categories : Android

Keep object size constant when rotating 3-D Matlab plot
The axis function is your friend here. Try adding axis vis3d From the help, "axis VIS3D freezes aspect ratio properties to enable rotation of 3-D objects and overrides stretch-to-fill." If you're interested The same this can be accomplished via ax = gca; props = {'CameraViewAngle','DataAspectRatio','PlotBoxAspectRatio'}; set(ax,props,get(ax,props));

Categories : Matlab

multipule text font size for font in one text box
Use a richtextbox instead. richTextBox1.SelectionFont = new Font("Arial", 12, FontStyle.Bold); richTextBox1.AppendText("Two of the peak human experiences are"); richTextBox1.SelectionFont = new Font("Tahoma", 16, FontStyle.Bold); richTextBox1.AppendText("good food and classical music");

Categories : Wpf

Constant enum size no matter the number of enumerated values
The size of an enum is implementation-defined -- the compiler is allowed to choose whatever size it wants, as long as it's large enough to fit all of the values. Some compilers choose to use 4-byte enums for all enum types, while some compilers will choose the smallest type (e.g. 1, 2, or 4 bytes) which can fit the enum values. The C and C++ language standards allow both of these behaviors. From C99 §6.7.2.2/4: Each enumerated type shall be compatible with char, a signed integer type, or an unsigned integer type. The choice of type is implementation-defined,110) but shall be capable of representing the values of all the members of the enumeration. From C++03 §7.2/5: The underlying type of an enumeration is an integral type that can represent all the enumerator values d

Categories : C++

Different ways to show an image according to its size and window size
One way to do this is with simple CSS. Check this out: http://jsfiddle.net/panchroma/XBuGc/ I removed all your javascript and added some CSS .img-header{ width:100%; height:auto; min-width:450px; /* adjust as necessary */ } Hope this helps!

Categories : Jquery

In C, how do I create a `static` array of constant size with zeroed values, but without calloc?
An array that only has some positions initialized to a value will have zeroes at the remaining positions. static const int kFrameCOuntSample = 250; static float samples[kFrameCOuntSample] = { 0 }; Should do the trick.

Categories : C

CSS increase font size
I used the following PHP script to convert all font-size: [0-9]+px values into em: <?php $filename = "MyCss.css"; $css = file_get_contents($filename); $css = preg_replace('/font-sizes*:s*([0-9]+)s*px/ie', '"font-size: " . ($1/16) . "em"', $css); file_put_contents($filename, $css); Your example CSS above became: body { font-size: 0.8125em; } h1 { font-size: 2em; } h1.smaller { font-size: 1.9375em; } h2 { font-size: 1.625em; } I'd then recommend setting a baseline font-size on the HTML element: html { font-size: 16px; } Then, if you want to globally affect all font sizes on the page, you can change this single value, and all fonts using em units will scale. You could also use percentages if you'd rather, but em's are usually preferred. (Sorry, Ruby is one of the few languag

Categories : CSS

Font size is bigger than set
Try it with another 2 or 3 fonts: give them each an extra 15% vertical space and see if they all universally fit. If they don't, then the answer to your question is no (as I suspect). A font has no contract that for a given point size it must actually fit in it; it's merely a suggestion that the font designer has the liberty to play with. Read the second paragraph here: http://en.wikipedia.org/wiki/Point_(typography) I don't see why the same idea wouldn't apply to pixels in digital typography as well, especially since pixels have no standard use as measuring devices in digital typesetting.

Categories : Android

SVG font-size not having effect
It is having an effect just not one that is obvious. The height and width value of the SVG node are scaling the drawing overall. <svg xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="full" height="297mm" version="1.1" viewBox="0 0 210 297" width="210mm"> Watch what happens as you increase and decrease the font-size of each letter, and then the height and width of the svg node (here is a demo) While I'm sure what layout you are looking for here is modified version of the SVG you were building (without mm as the unit for the size of the svg node) and with a slightly larger font that is centered): (demo) <svg xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmln

Categories : Python

Change the tag-it font size
It is in the color specifc css file, tagit-stylish-yellow.css for example. Look for ul.tagit { cursor: text; font-size: 14px; color: #333; } and change the font-size. I found this by going to the demo site in Chrome, start the inspector by pressing F12, selecting the tag and looking at the css directives that affect it.

Categories : Misc

Animate font size from a div
Change this line: var div=$("div"); to this var div=$("#test"); Read up on selectors in the jQuery documentation for more information on selecting DOM elements http://api.jquery.com/category/selectors/

Categories : Jquery

Why not use percentage for font-size?
General best practice, when taking mobile devices into consideration, is to use ems. They tend to be represented better for mobile, and there are several articles you can Google to find references of this. I have only recently switched from px to ems, and now my plan is to switch to rem for my font size. Rem will be calculated from the html root font size, whereas ems can be tricky when nested as they calculate from their parent. Hope this helps.

Categories : Javascript

What is the default font-size in IE9?
font-size is being set on every element in that stylesheet in em eg h3 { display: block; font-size: 1.17em; font-weight: bold; margin: 1em 0; page-break-after: avoid; } h4 { display: block; font-size: 1em; font-weight: bold; margin: 1.33em 0; page-break-after: avoid; }

Categories : HTML

Can a   have a CSS font-size?
There's no need to put something into a button to give it a size. Here's how you can give a button a 20x20 size : HTML : <button id=a></button> CSS : #a { weight:20px; height:20px; } Demonstration

Categories : HTML

Font size does not affect value 0.1 to 0.4 em
em is a relative font size. If you put your example inside another div that has a large font-size set, you'll notice that you do see a change at the 0.1 - 0.4em range, because it evaluates to a reasonable actual font size (above the browser's minimum). HTML <div class=outer> <span class="text_menu_link">Home</span> </div> CSS .outer {font-size: 30pt;} span.text_menu_link {font-size: 0.3em;} See this for an example Edit An example setting font-size at the body level

Categories : HTML

How to set the default font size on vim?
For the first one remove the spaces. Whitespace matters for the set command. set guifont=Monaco:h20 For the second one it should be (the h specifies the height) set guifont=Monospace:h20 My recommendation for setting the font is to do (if your version supports it) set guifont=* This will pop up a menu that allows you to select the font. After this type set guifont? To show what the current guifont is set to. After that copy that line into your vimrc or gvimrc. If there are spaces in the font add a to escape the space. set guifont=Monospace 20

Categories : Vim

How to change font size?
This line: font: 78%/130% 'Oxygen',sans-serif; breaks down to: font-size: 78%; line-height: 130%; font-family: 'Oxygen', sans-serif; If no font size is given explicitly, the browser's default value is used, which is actually 16px.

Categories : CSS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.