Content backcolor question (I'm doing this wrong)

  • Thread starter Thread starter dgk
  • Start date Start date
D

dgk

I'd like to set the background color for a content region but the
content placeholder doesn't have such a property, so I tried using a
panel. The panel doesn't seem to grow as it should to hold all the
controls and tables and such. I have to manually set the height which
seems wrong.

Any suggestions greatly appreciated.
 
dgk said:
I'd like to set the background color for a content region but the
content placeholder doesn't have such a property,

No, the content placeholder is only used to manage the content on the
server side, it isn't rendered into any html code, so it can't have any
style.
so I tried using a
panel. The panel doesn't seem to grow as it should to hold all the
controls and tables and such. I have to manually set the height which
seems wrong.

If you position elements by floating or absolute positioning, they don't
affect the size of the parent.

You can place an element with the style clear:both; after elements that
float. This will place it after the floating elements, but as the
element doesn't float itself, it does affect the size of it's parent.
 
Why not have your original content in a <div> element.

<content region>
<div style="background-color: Yellow;"> Your Original Content here </div>

</content region>
 
Why not have your original content in a <div> element.

<content region>
<div style="background-color: Yellow;"> Your Original Content here </div>

</content region>

Oh, because that would be too simple and work too well. Excuse me
while I kick myself. Sometimes I just get too caught up in the
controls and forget good old html.

Thanks.
 
No, the content placeholder is only used to manage the content on the
server side, it isn't rendered into any html code, so it can't have any
style.


If you position elements by floating or absolute positioning, they don't
affect the size of the parent.

You can place an element with the style clear:both; after elements that
float. This will place it after the floating elements, but as the
element doesn't float itself, it does affect the size of it's parent.

Thanks, I was using tables. It's a simple layout but of course things
can grow depending on what ends up there. LVP suggested using a div
and that works well.

I would have thought a panel would do the same as a div but apparently
not.
 
Back
Top