Questions tagged [height]

The property which determines the size of an object on the Y-axis. Please don't use this tag, it has no taxonomic value in your post.

The property which determines the size of an object on the Y-axis. Most likely, it has no taxonomic value in your post, and you should not be using it. Consider e.g. , or .

6209 questions
2647
votes
42 answers

How to make a div 100% height of the browser window

I have a layout with two columns - a left div and a right div. The right div has a grey background-color, and I need it to expand vertically depending on the height of the user's browser window. Right now, the background-color ends at the last piece…
mike
  • 26,535
  • 3
  • 16
  • 4
1083
votes
25 answers

Make body have 100% of the browser height

I want to make body have 100% of the browser height. Can I do that using CSS? I tried setting height: 100%, but it doesn't work. I want to set a background color for a page to fill the entire browser window, but if the page has little content I get…
bodyofheat
  • 10,833
  • 3
  • 15
  • 5
640
votes
16 answers

Make iframe automatically adjust height according to the contents without using scrollbar?

For example: I want it to be able to adjust its height according to the contents inside it, without using scroll.
akashbc
  • 6,415
  • 3
  • 14
  • 4
576
votes
11 answers

Setting width/height as percentage minus pixels

I'm trying to create some re-usable CSS classes for more consistency and less clutter on my site, and I'm stuck on trying to standardize one thing I use frequently. I have a container
that I don't want to set the height for (because it will…
Matt
  • 23,363
  • 39
  • 111
  • 152
514
votes
47 answers

Creating a textarea with auto-resize

There was another thread about this, which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clientHeight value comes back as the full size of the…
DisgruntledGoat
  • 70,219
  • 68
  • 205
  • 290
454
votes
18 answers

jQuery get the rendered height of an element?

How do you get the rendered height of an element? Let's say you have a
element with some content inside. This content inside is going to stretch the height of the
. How do you get the "rendered" height when you haven't explicitly set the…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
447
votes
27 answers

make div's height expand with its content

I have these nested divs and I need the main container to expand (in height) to accommodate the DIVs inside ...
patrick
  • 7,369
  • 5
  • 20
  • 14
441
votes
12 answers

Why doesn't height: 100% work to expand divs to the screen height?

I want the carousel DIV (s7) to expand to the height of the entire screen. I haven't an idea as to why it's not succeeding. To see the page you can go here. body { height: 100%; color: #FFF; font: normal 28px/28px'HelveticaWorldRegular',…
Earl Larson
  • 5,051
  • 6
  • 27
  • 29
357
votes
10 answers

Div width 100% minus fixed amount of pixels

How can I achieve the following structure without using tables or JavaScript? The white borders represent edges of divs and aren't relevant to the question. The size of the area in the middle is going to vary, but it will have exact pixel values…
Removed_account
  • 3,999
  • 3
  • 20
  • 15
340
votes
30 answers

How to get div height to auto-adjust to background size?

How do I get a div to automatically adjust to the size of the background I set for it without setting a specific height (or min-height) for it?
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
282
votes
6 answers

CSS – why doesn’t percentage height work?

How come a percentage value for height doesn’t work but a percentage value for width does? For example:
#working{ width:80%; height:140px; background:orange; } #not-working{ …
Web_Designer
  • 72,308
  • 93
  • 206
  • 262
279
votes
10 answers

How to get the width and height of an android.widget.ImageView?

╔══════════════════════════════════════════════╗ ^ ║ ImageView ╔══════════════╗ ║ | ║ ║ ║ ║ | ║ ║ Actual image ║ ║ | ║ ║ ║ …
AZ_
  • 21,688
  • 25
  • 143
  • 191
273
votes
11 answers

How to make a floated div 100% height of its parent?

Here is the HTML:
Test
And here is the CSS: #inner { float: left; height: 100%; } Upon inspection with the Chrome developer tools, the inner div is getting a height of 0px. How can I force…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
243
votes
17 answers

Div height 100% and expands to fit content

I have a div element on my page with its height set to 100%. The height of the body is also set to 100%. The inner div has a background and all that and is different from the body background. This works for making the div height 100% of the browser…
Joey
  • 10,504
  • 16
  • 39
  • 54
221
votes
15 answers

CSS Div stretch 100% page height

I have a navigation bar on the left hand side of my page, and I want it to stretch to 100% of the page height. Not just the height of the viewport, but including the areas hidden until you scroll. I don't want to use javascript to accomplish…
Tom
  • 4,341
  • 9
  • 27
  • 21
1
2 3
99 100