height

CSS word-wrap / text-overflow with fixed height [duplicate]

狂风中的少年 提交于 2019-12-04 01:30:42
问题 This question already has answers here : Is it possible to use text-overflow:ellipsis on multiline text? (12 answers) Closed 6 years ago . i have the following example. http://jsfiddle.net/qFDxp/ HTML: <div class="test">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem

How to detect if element has 'auto' height

北城以北 提交于 2019-12-04 01:24:48
Both window.getComputedStyle(element).height and element.clientHeight are returning the current height of the element in pixels, regardless of the value set in the CSS. Is there any way to find out if the height was set to auto , or other units than pixels ? One solution that @pvnarula suggests through the page he linked is to temporarily change the contents of the element, then compare heights . A little bit hacky... Update: Based on other answers and lot of online research I came up with a mix of everything in a single function. Check out the jsfiddle here: https://jsfiddle.net/oriadam

Variable width & height of UICollectionViewCell using AutoLayout with Storyboard (without XIB)

懵懂的女人 提交于 2019-12-04 00:34:16
Here is an design issue in the app that uses AutoLayout, UICollectionView and UICollectionViewCell that has automatically resizable width & height depending on AutoLayout constraints and its content (some text). It is a UITableView list like, with each cell that has it's own width & height calculated separately for each row dependant on its content. It is more like iOS Messages build in app (or WhatsUp). It is obvious that app should make use of func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath:

image height using jquery in chrome problem

有些话、适合烂在心里 提交于 2019-12-04 00:30:24
$('img').height() returns 0 in chrome, but it returns the actual height in IE and firefox. Whats the actual method to get the height of the image in chrome? As Josh mentioned, if the image has not fully loaded yet, jQuery won't know what the dimensions are yet. Try something like this to ensure you're only attempting to access it's dimensions after the image has been completely loaded: var img = new Image(); $(img).load( function() { //-- you can determine the height before adding to the DOM alert("height: " + img.height); //-- or you can add it first... $('body').append(img); //-- and then

How can I manage the height of android spinner items?

大憨熊 提交于 2019-12-04 00:29:43
I have an android spinner that's populated by a list of strings using an ArrayAdapter and it operates fine, however because of the way the spinner is displayed I'm running into a display height problem with the list items. At first glance it would seem that the ArrayAdapter can use a single layout for displaying options which leads to the problem I'm having. When displaying the current item in the spinner (when the user is not selecting a new item from the list) the spinner pads the text so that the spinner is a reasonable size for clicking on. However when the user taps on it and brings up

can't change the height of a text field in simple_form

时光总嘲笑我的痴心妄想 提交于 2019-12-03 23:07:41
I've tried #Default size for text inputs. config.default_input_size = 10 from config/initializers/simple_form.rb I've also tried <%= f.input :message, :input_html => {:size => 10} %> But neither of these change a single thing about how my text fields appear. You need to do this <%= f.input :message, :input_html => {:rows => 10} %> Html text area tag attributes has two attributes namely rows and cols which lets you specify the no of rows and columns(i.e. width) of your text area. If this is not working then open the console and see if your css is overriding the height. Passing :input_html

My content disappears when I set the HTML tag to 100% height

妖精的绣舞 提交于 2019-12-03 21:20:24
I have a vertical layout that I want to remain centered on the page. One column stays fixed on the page while the other should scroll according to the content and there are some decorative floating divs that are absolute. I want the scrolling column to display 100% vertically, even if the content doesn't require the height, but I can't seem to get this to work. I've set the html tag and body tag to height:100%, as well as all of the necessary div tags. Having the html tag set to this attribute causes all of the content except for .content and .share to disappear. Here is my html: <html> <body>

Force nested divs to have min-height of 100%?

倖福魔咒の 提交于 2019-12-03 16:38:37
问题 I know that min-height: 100% will only work to take up a minimum of 100% of its parent element's height if the parent element has some numeric value for height, but what if I have a few nested divs and I want them all to have a min-height of 100%? I tried min-height:inherit but that didn't work either? I know I can probably solve this problem with JavaScript by simply checking the browser height value on document load and then assigning that to the min-height property of my nested divs, but I

height of page in javascript

大城市里の小女人 提交于 2019-12-03 16:34:49
问题 I'm unable to get the height of a page in javascript when the page is larger than the screen. I thought this would get me the right height: $(document).height(); but that only gets the height of the screen, same as: $('body').height(); same as: document.offsetHeight; For some reason all these examples only return the height of the screen. Can somebody help? 回答1: Using jQuery (which you did specify), $(document).height() will return exactly what you're asking for. To clarify the usage of the

How to get Body element height dynamically using JQuery

痴心易碎 提交于 2019-12-03 16:27:12
I need to get the body element height and width, when i resize the browser windows Please help me to solve this problem using JQuery Use the resize event on the window object: $(window).resize(function(){ var width = $(document).width(), // or $(window).width() height = $(document).height(); // or $(window).height() }); 来源: https://stackoverflow.com/questions/1298026/how-to-get-body-element-height-dynamically-using-jquery