White Space around the Silverlight 1.1 Root Canvas

Figured since I just spent a good bit of time chasing this down, it would make sense to post a tip about it...

I'm working on updates to the web site for ReMIX 07 Boston, and I'm in the process of adding a Silverlight-enabled Session/Speaker/Bio page. One thing I ran into is that when I initially added the Silverlight to the page, it appeared to have a white border around the root Canvas object, which I couldn't seem to figure out how to remove.

Turns out all that was required was to use absolute positioning for the <div> element that hosts the Silverlight control, and set it's left and top properties to 0px. I had tried absolute positioning earlier, and thought that it didn't work, but given how badly I type, I'm guessing I must have misspelled something in the CSS and didn't notice. Here's what the CSS code would look like:

     <style type="text/css">
        .silverlightHost 
        {
            position: absolute;
            top: 0px;
            left: 0px; 
        }
    </style>

So if you run into this, now you kn

Technorati Tags: Silverlight, Tips and Tricks

ow how to fix it.