Okay, so there won't only and exclusively be Silverlight related posts on this blog.

I created a new website in Microsoft Visual Studio 2008 and I added a Master Page. I wanted the content of this website to be centered in the browser window so I proceeded to create a CSS stylesheet to assign the usual { margin: 0 auto; } to my main div in the Default page but it just didn't work. I added a page to which I didn't assign a Master Page and it worked fine. After numerous infructuous tries I fell into account that what was causing this, or actually not causing the desired result, was the lack of the DTD reference in the Master Page.

I copied the code from the page without a Master Page assigned to it to my actual Master Page:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

...and it worked like a charm.

Currently rated 2.3 by 4 people

  • Currently 2.25/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Comments

Comments are closed