Content backcolor question (I'm doing this wrong)

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.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 
L

LVP

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

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

</content region>
 
D

dgk

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.
 
D

dgk

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top