width

Change div width live with jQuery

℡╲_俬逩灬. 提交于 2019-12-18 14:29:11
问题 Is it possible to change a div 's width live with jQuery? And if it is, how? What I want is to change its width depending on the browser's window width in real time, so if/when the user changes the browser window, the div 's dimensions are changed as well in realtime. 回答1: You can use, which will be triggered when the window resizes. $( window ).bind("resize", function(){ // Change the width of the div $("#yourdiv").width( 600 ); }); If you want a DIV width as percentage of the screen, just

Setting div width to 100% minus certain amount of px

空扰寡人 提交于 2019-12-18 13:33:53
问题 Have been searching the net for the past hours to find a solution to this, but couldn't find it, so here I am. I need the width of the div to be 100% minus the width of the left div . So that the div to the left of it stays the same width (390px) but the other div adjusts its size depending on the resolution . I have found the solution where it has a fixed width div on both sides, but just cant figure this out. 回答1: Simple solution: <div id="content"> <div class="padder"> </div><!-- .padder -

Width of input type=text element

廉价感情. 提交于 2019-12-18 12:53:04
问题 How come when I do this: <input type="text" style="width: 10px; padding: 2px"/> <div style="width: 10px; border: solid 1px black; padding: 2px"> </div> the input ends up 2 px wider than the div in both IE6 and FF3? What am I missing? EDIT: As many people have said, the border is the issue. If I set border: 0px on the input, it will have the same width as the div with a 0 px border (verified by wrapping it inside a bordered SPAN). However, when I measure the elements in paint, the div has a 14

100% width is bigger than parent's div

笑着哭i 提交于 2019-12-18 11:46:39
问题 I'm working on vBulletin theme, but on thread list, every thread has 100% for its width but threads are also bigger than their parents, but when i remove border of threads, they will fit parent's div:). so think this problem is on borders. You can see that better on jsfiddle (thread is white shape with black border) <body> <div class="after-body"> <div class="body-wrapper"> <div class="threadlist"> <ol class="threads"> <li class="threadbit"><div class="thread"></div></li> <li class="threadbit

CSS: How can I adjust my font size fill all the space in a justified layout?

一曲冷凌霜 提交于 2019-12-18 09:46:12
问题 How can I make my text look like the image below using CSS? 回答1: First of all you need to use a mono-space font. You can find some pretty nice looking ones over at Google Fonts. The font in the image is Ubuntu Mono. Secondly, we are going to be using Viewport Width, or 'vw' unit (If you clicked the link, you'd see that it is well supported by browsers). You need to make sure the top line of text is the width you need it be to fit the width. This also means that each line needs to be it's own

C# Processing Fixed Width Files

女生的网名这么多〃 提交于 2019-12-18 08:58:13
问题 I have a collection of fixed width files with a varying number of columns and field sizes. The top of the file starts with a line like: AAAAABBCCCCCCCCCCDDD and so on The change in character denotes the end of one field and the start of another. I am guessing this can someone be used to work out what the field sizes are with code and then apply the same values to the actual data lines below. I then want to output all the read data into a XLS file or even a DataGrid, but my issue is I have no

C# Processing Fixed Width Files

风格不统一 提交于 2019-12-18 08:58:09
问题 I have a collection of fixed width files with a varying number of columns and field sizes. The top of the file starts with a line like: AAAAABBCCCCCCCCCCDDD and so on The change in character denotes the end of one field and the start of another. I am guessing this can someone be used to work out what the field sizes are with code and then apply the same values to the actual data lines below. I then want to output all the read data into a XLS file or even a DataGrid, but my issue is I have no

Div width = 100%?

那年仲夏 提交于 2019-12-18 06:35:45
问题 I have JS generated content and want a div EXACTLY around it. I don't know why, but the div parent is always 100% wide. I thought I have div width: 100% somewhere, but surprisingly it looks almost the same in jsfiddle: http://jsfiddle.net/f2BXx/2/ So why the outer div is always 100% wide? And how to fix that? I was trying with display: inline, but it sets width to 0px ;/ CSS: .outer { border: solid 1px red; } .item { height: 300px; width: 400px; border: solid 1px blue; } .allright { height:

how to get innerWidth of an element in jquery WITHOUT scrollbar

大兔子大兔子 提交于 2019-12-18 05:56:01
问题 Given a div that has a scrollbar in it (e.g. b/c of overflow:auto), how do I get the accurate innerWidth of the element? In my example: http://jsfiddle.net/forgetcolor/2J7NJ/ width and innerWidth report the same width. The number I want should be less than 100. HTML: <div id='box1'> <div id='box2'> </div> </div> <p id="w"></p> <p id="iw"></p>​ CSS: #box1 { width:100px; height:100px; overflow:auto; } #box2 { width:200px; height:200px; background-color:#aaa; } Javascript: $('#w').text("width is

“width: calc(100% / 3);” not working properly in any IE

送分小仙女□ 提交于 2019-12-18 05:43:31
问题 I have a 3 column layout that should fill the whole screen so on my columns I am using: width: calc(100% / 3); So lets say for example my screen is 782px wide: 782 / 3 = 260.66̅ However the problem I have is in Internet Explorer, where it rounds the pixels to two decimal places (260.67) 260.67 * 3 = 782.01 So at certain widths, I lose a 1/3 of my page as it wraps underneath. Here's an example: function onResize() { $('ul').each(function() { var H = eval($(this).height() / $(this).children('li