Give it a display:inline-block
in CSS – that should let it do what you want.
In terms of compatibility: IE6/7 will work with this, as quirks mode suggests:
IE 6/7 accepts the value only on elements with a natural display: inline.
More Related Contents:
- Canvas is stretched when using CSS but normal with “width” / “height” properties
- How to get div height to auto-adjust to background size?
- How to make a floated div 100% height of its parent?
- Div height 100% and expands to fit content [duplicate]
- Set div height equal to screen size
- Canvas is stretched when using CSS but normal with `width` & `height` attributes
- How would I achieve a shadow that won’t show through transparent text?
- Fill in text in HTML5
- How to place two divs next to each other?
- Why does height 100% work when DOCTYPE is removed?
- Setting width/height as percentage minus pixels
- HTML 5 strange img always adds 3px margin at bottom [duplicate]
- Changing three.js background to transparent or other color
- Actual table Vs. Div table
- What is the current state of the “scoped” attribute for the style element in HTML5?
- Proper way to apply CSS to HTML5 custom elements
- Adjacent divs with angled borders? [duplicate]
- How to position a div in the middle of the screen when the page is bigger than the screen
- Nested rows with bootstrap grid system?
- How do I line up 3 divs on the same row?
- CSS: How to align vertically a “label” and “input” inside a “div”?
- Preventing an image from being draggable or selectable without using JS
- Div side by side without float
- Full background image with fade effect
- Can I replace the expand icon (▶) of the element?
- How to add bordered triangle over a div tag
- CSS Floating Divs with different height are aligned with space between them
- Trouble (vertically) Centering Text in another DIV with relative % sizing
- Horizontal scroll in DIV with many small DIV’s inside (no text)
- CSS 100% height layout