Questions tagged [width]

The property which determines the size of an object on the X-axis. The most common form of this measurement is in pixels or millimeters.

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

6050 questions
2485
votes
43 answers

How can I make a div not larger than its contents?

I have a layout similar to:
I would like for the div to only expand to as wide as my table becomes.
George Snider
640
votes
25 answers

How to set up fixed width for ?

Simple scheme: A B C D I need to set up a fixed width for . I've tried: tr.something { td { width: 90px; } } Also td.something { width: 90px; } for…
user984621
  • 46,344
  • 73
  • 224
  • 412
510
votes
26 answers

How to make a div fill a remaining horizontal space?

I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to fill the remaining space. #search { width: 160px; height: 25px; float: left; …
alexchenco
  • 53,565
  • 76
  • 241
  • 413
486
votes
15 answers

How to make an element width: 100% minus padding?

I have an html input. The input has padding: 5px 10px; I want it to be 100% of the parent div's width(which is fluid). However using width: 100%; causes the input to be 100% + 20px how can I get around this? Example
Hailwood
  • 89,623
  • 107
  • 270
  • 423
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
350
votes
6 answers

What are the differences between flex-basis and width?

There have been questions and articles about this, but nothing conclusive as far as I can tell. The best summary I could find is flex-basis allows you to specify the initial/starting size of the element, before anything else is computed. It can…
jpeltoniemi
  • 5,320
  • 7
  • 24
  • 34
322
votes
15 answers

How to get Linux console window width in Python

Is there a way in python to programmatically determine the width of the console? I mean the number of characters that fits in one line without wrapping, not the pixel width of the window. Edit Looking for a solution that works on Linux
Sergey Golovchenko
  • 18,203
  • 15
  • 55
  • 72
312
votes
11 answers

Does height and width not apply to span?

Total noob question, but here. CSS .product__specfield_8_arrow { /*background-image:url(../../upload/orng_bg_arrow.png); background-repeat:no-repeat;*/ background-color:#fc0; width:50px !important; height:33px !important; …
Kyle
  • 65,599
  • 28
  • 144
  • 152
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
269
votes
13 answers

CSS Input with width: 100% goes outside parent's bound

I'm trying to make a login form with two input fields with an inset padding, but they end up exceeding the parent's bounds. What's causing this? JSFiddle snippet: http://jsfiddle.net/4x2KP/ #mainContainer { line-height: 20px; …
peelz
  • 2,820
  • 2
  • 17
  • 16
244
votes
13 answers

Tab not taking full width on Tablet device [Using android.support.design.widget.TabLayout]

I have setup tabs as UPDATE 29/05/2015 this post. Tabs take full width on my Nexus 4 mobile but on nexus 7 tablet it in center and not cover full screen width. Nexus 7 screenshot Nexus 4 screenshot
Max
  • 5,733
  • 4
  • 30
  • 44
228
votes
4 answers

resizes wrong; appears to have unremovable `min-width: min-content`

Problem I have a to resize so it is never wider than its parent, even if it has to cut off its displayed text. max-width: 100% should do that. Before resize: What I…
Rory O'Kane
  • 29,210
  • 11
  • 96
  • 131
221
votes
15 answers

CSS: 100% width or height while keeping aspect ratio?

Currently, with STYLE, I can use width: 100% and auto on the height (or vice versa), but I still can't constrain the image into a specific position, either being too wide or too tall, respectively. Any ideas?
Weston Watson
  • 5,344
  • 6
  • 24
  • 25
219
votes
4 answers

What is the meaning of \9 in this width property value declaration?

What is the meaning of this? I am guessing it is a browser hack, but I have not been able to find what exactly it does. width: 500px\9; What is the significance of \9?
well actually
  • 11,810
  • 19
  • 52
  • 70
1
2 3
99 100