0

I have a Div box with an Webpartzone in it. But when i'm rendering my page, the webpartzone is to large. I thought a webpart zone has the width of 100% of his parent container. But not in my case.

.ProjectBox{
    float: left;
    margin-right: 15px;
    width: 250px;   
}

<div class="ProjectBox"> 
   <WebPartPages:WebPartZone runat="server"  ID="Top" Title="loc:Top">
      <ZoneTemplate></ZoneTemplate>
   </WebPartPages:WebPartZone>
</div>
0

you can overcome this by setting css on WebPartZone by giving it a class name and calling that is css then seting its properties to inherit.

If the parent is big then the child(WebPartZone) would also be big as its in % and at a 100 meaning it will be the full width of the parent unless stated.

So you have everything right just add to ProjectBox:

overflow: hidden;

and another .css class for WebPartZone to make the position relative :)

  • Changing like this: <WebPartPages:WebPartZone runat="server" class="ProjectTop" ID="Top" Title="loc:Top" > <ZoneTemplate></ZoneTemplate> </WebPartPages:WebPartZone> – Active_t Aug 15 '12 at 12:33
  • .ProjectBox{ float: left; margin-right: 15px; /*width: 250px; */ overflow:hidden; } .ProjectTop{ position : relative; background-color: Green; } Does not fix the problem – Active_t Aug 15 '12 at 12:34
  • ok thats no problem, you need to use f12 developer or firebug to see they layout of the css, if the webpart zone is sticking out of the div or the div is relative to the parent and the child so the child is still within the Div and you can see the css for the div and for the webpartzone? – Ali Jafer Aug 15 '12 at 14:26
0

My problem was that i was using an image webpart. The image loaded on the webpart wat to big. The image size i've changed with css. But in the edit mode, the image webpart is taking the size of the image, and showing the image on the right size.

It was a styling issue in combination with the imagewebpart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.