width

How does browsers compute 'auto' value?

房东的猫 提交于 2019-12-23 05:32:27
问题 I have two similar styles. When I viewed them in the chrome inspector they have different values although the styles applied are similar. The margins of the elements have the 'auto' value but when computed by the browser there is a big difference between them although the width is the same. For those who will be asking me to point it to a single stylesheet, I actually can't because the first style is for a wordpress theme and the other one is for a whmcs template. Update: added these two

Grid Column Width - mix *(star), Auto and fill left space

只愿长相守 提交于 2019-12-23 04:36:35
问题 I have a Grid width following Column Definitions: <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="320" MaxWidth="450" Width=".32*"/> <ColumnDefinition MinWidth="200" Width="Auto"/> <ColumnDefinition MinWidth="200" Width="Auto"/> <ColumnDefinition Width="Auto"/> <- (4) should fill all available space <ColumnDefinition MinWidth="250" MaxWidth="300" Width=".20*"/> </Grid.ColumnDefinitions> The problem is that setting width to Auto on column (4) zeros it's width and last column is next to

Div with a width of 100%, next to a fixed width one

╄→尐↘猪︶ㄣ 提交于 2019-12-22 12:02:12
问题 Sorry for the incredibly stupid question, I feel like in most circumstances I could do this easily, but I'm using sharepoint at the moment and trying to do anything in this is hell! Basically I have a side navigation (.menu-vertical) that is 230px wide, and a div next to it (.mainContent) that I would like to (padding aside!) fill the rest of the screen. Unfortunately there are around 798 randomly placed divs, spans and whatever else in the code too that I can't seem to strip without breaking

jquery/javascript how to calculate width faster

老子叫甜甜 提交于 2019-12-22 11:09:09
问题 I have a table with 100 columns. I'm running a loop through all the th elements, to explicitly set the width of each th. var $ths = $("table th"); $ths.each(function (i, th) { var $th = $(th); var width = $th.width(); $th.width(width); }); For 100 columns, this takes too much amount of time (more than 60s). Each "get width" call takes 500-700 ms. This is because it needs to generate layout every time, I get width. Question - Is there a faster way to get width? Reason - I'm freezing header.

Select drop down width - Chrome issue

喜欢而已 提交于 2019-12-22 10:36:12
问题 I would like to control <option> list width of <select> drop down. By default, browser calculates larger text in the <option> and accommodes drop down. It doesn't look good in sites. I had tried the following CSS snippet and found working in FF. select{ width : 120px; } select option { width : 90px; } The only trouble causer is Chrome. Could u let me know if any workarounds. Demo 回答1: Googling it didn't turn out for me. I've only script option left out. The following code does the trick.. /*

How can I animate the opposite way?

一个人想着一个人 提交于 2019-12-22 10:35:04
问题 Greetings, I am changing the width of an element which serves as a bar , and that works. However I can't make it so that it animates it in the opposite direction. I tried putting - in front of bar_width but to no avail. Width will be dynamically calculated it's just that I want the direction to go to the left rather than to the right like so <------- not -----------> var bar_width=$(this).css('width') ; $(this).css('width', '0').animate({ width: bar_width }, queue:false,duration:3500,easing:

How to fix sync issue between column-header-width and column-body-width without the use of deprecated jqGrid updateColumns method?

戏子无情 提交于 2019-12-22 10:16:00
问题 Currently I am working on restoring saved grid preferences/configuration. This is more or less working beautifully, until we get to the last last step of performing that performs a column remap, $grid.jqGrid("remapColumns", perm, true, true); and what happens is that the reordered column-header-widths are out of sync with thier corresponding column-body-widths. This remap does correctly display of both the column-header names and column-body data in the new order and based on user preferences

Fixed position element inheriting width of flex item

喜欢而已 提交于 2019-12-22 08:59:36
问题 I'm building out a UI that requires a fixed position/sticky element at the bottom of the viewport with a width constrained by a main content area. The main content area is optionally flanked by (sibling) left and/or right sidebars with fixed widths, so I'm using Flexbox to build the three column structure with flex-grow: 1 on the main content. I've learned from @Marc Audet's accepted answer at How can I make a fixed positioned div inherit width of parent? that setting width: inherit on the

Java Button Width

女生的网名这么多〃 提交于 2019-12-22 08:32:19
问题 I've tried to use this and it doesn't work singleplayerButton.setBounds(20, 20, 200, 100); I dont know why though, can anybody help me out with this? My full page code is here package gmine; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class gmine implements ActionListener { JFrame interfaceFrame; JButton singleplayerButton, multiplayerButton, optionsButton, quitButton; public gmine() { JFrame.setDefaultLookAndFeelDecorated(false); interfaceFrame = new JFrame("G

Set button height and width as wrap content and fill parent

你说的曾经没有我的故事 提交于 2019-12-22 05:58:16
问题 I'm developing a application where the user is supposed to be able to alter the apperence of a button by pressing other buttons. I use four buttons to set height as wrap content, height as fill parent, width as wrap content and width as fill parent. I googled a bit and found a solution using LayoutParams although that code didn't specify if height of width was alterd. I also got errors saying my IDE couldn't recognise "LayoutParams". What is the best way to do this? 回答1: What you need to look