Chandra Eskay
Chandra Eskay

Reputation: 2203

Child page style affecting master page

I have a master page displaying subject menu on left side(Vertical view) and child page displays mails on the right side.

Child page will display HTML content and varies when the subject menu are clicked. Problem is that the child page html style is getting applied to the master page and also child page shrinks or grows depending on the content.

I tried placing the child page inside div and fixing the div size to static but this doesnt work and also I'm not able to control style which is applied to master page from child page.

How to fix this.

Upvotes: 0

Views: 864

Answers (2)

Abhitalks
Abhitalks

Reputation: 28437

Why can't you just remove all css from individual pages (master and child), and just use themes instead? Just create a "default" theme folder inside "App_Themes" and put one css file over there. Then use specific classes to style elements on whatever page they are. Make sure there are no conflicts.

You have to enable theming though. Either thru web.config or on the page declaration.

Upvotes: 1

nunespascal
nunespascal

Reputation: 17724

In the end you render it as one page.
All your CSS is going to come together.

If you need it to be separate, use a different container CSS class, and use that to differentiate the styles.

If you have no control over the content, you can't fix the size. But you can decide how it overflows, using the CSS overflow property. You can make it show a scroll bar or hide it.

.mail{
  overflow: auto;
}

Refer: overflow

Upvotes: 2

Related Questions