I am trying to set a fixed width on a webpartzone, and no matter which webpart that later will be added to that zone, wont exceed the width of the webpartzone. I have tried different things, I have set a width property on the zone with a maximum width, but nothing happens. I have tried to put the zone in a div with a fixed size, but if the webpart is bigger then the width of the div, the div expands.

Please help with this Best regards



AFAIK WebPartZone is just a container for the WebParts and unfortunately its width is defined by the Web Part in it! Its as simple as if you have a div with fixed width and you put any control in it, then div will expand according to the width of the control.. So its not the WebPartZone you need to fix width for, instead set appropriate width to your WebPart inside WebPartZone!

  • Thanks for the good explanation! but thats where my problem is, that these zones will not contain just one webpart from the begining. the person that are going to use this site, should have the possibilty to choose any webpart that they like, both custom made and thoose that that comes out of the box. My goal was that any webpart that would be added to that area, should be sized according to the size of the zone. But after you explanation, i assume that it isnt possible..?
    – David
    Dec 2 '12 at 13:49
  • I don't think its possible, SharePoint handles the width's of the zones automatically! But I will suggest wait for the other experts to view the question, if they have anything to add! :) Dec 2 '12 at 13:57
  • I think your right, feels that i have tried the most. Big thanks for your response Arsalan! :)
    – David
    Dec 2 '12 at 14:03
  • @David np, anytime ;) Dec 2 '12 at 14:04
  • @David, please mark the answer to close the question.. :) Jun 4 '14 at 22:19

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.