tags:

views:

163

answers:

4

I have a which needs to be auto adjusted according to the content in it.. how can i do this, right now my content is coming out of the

the class i have used fo that div is as follows

box-centerside  {
background:url("../images/greybox-center-bg1.jpg") repeat-x scroll center top transparent;
float:left;
height:100px;
width:260px;
}

pls help

A: 

just use following

height:auto;
Salil
Great answer, though unless there is a conflicting declaration higher in the tree, `height` will imply as `auto` by default.
Delan Azabani
Neither Height:auto is working for me nor min-height: working for me, i am using mozilla firefox, latest version
OM The Eternity
try then overflow:auto;
Salil
-ve that gives me vertical scrollbar, that i dont want
OM The Eternity
A: 

Don't set height ... or use min-height and max-height instead of height.

Delan Azabani
Neither Height:auto is working for me nor min-height: working for me, i am using mozilla firefox, latest version
OM The Eternity
A: 

<div> should expand automatically. I guess that the problem is that you're using fixed height:100px;, try replacing it with min-height:100px;

Tomasz Zielinski
Neither Height:auto is working for me nor min-height: working for me, i am using mozilla firefox, latest version
OM The Eternity
Like *Neurofluxation* said, you need to have `.` or `#` before `box-centerside` to match classes or IDs. At the moment, your code matches elements of node name `box-centerside` - of which none exists.
Delan Azabani
I am aware of that this code has been copied from firebug hence not displayed with "."
OM The Eternity
+5  A: 

Try with the following mark-up:

<html>
<head>
  <style type="text/css">
    box-centerside  {
      background:url("../images/greybox-center-bg1.jpg") repeat-x scroll center top transparent;
      float:left;
      min-height:100px;
      width:260px;
    }
  </style>
</head>
<body>
  <div class="box-centerside">
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
    This is sample content<br />
  </div>
</body>
</html>
Neurofluxation
will not work on IE 6? Neurofluxation fan...
ccppjava
if someone is still using ie6 its their own fault its broken... << I may think it but i still have to support that garbage... or at least the content has to survive....
WalterJ89
I agree with Walterj89, however I also disagree - IE6 *should* be supported at least until IE9 comes out properly. In general I don't think anyone should support IE.
Neurofluxation
Neither Height:auto is working for me nor min-height: working for me, i am using mozilla firefox, latest version
OM The Eternity
This works fine on my FireFox 3.6 and IE8 - what version of FireFox are you running?
Neurofluxation
i am using 3.6.3
OM The Eternity
Please try the new mark-up i've included.
Neurofluxation
I dont why but suddenly it gave me the output i needed.. thanx for ur help bud...
OM The Eternity
no problemo!!!!
Neurofluxation