Sign in
|
Join
in
Phil Scott's WebLog (blog)
Original ASP.NET Community Bloggers (group)
(Entire Site)
ASP.NET Weblogs
Home
Blogs
This Blog
Home
About
Syndication
RSS
Atom
Comments RSS
Recent Posts
Booting Windows 7 and VS 2010 on SSD in 18 seconds
404 Errors with FileUpload with IIS7
Watch Out for Request.Browser.MajorVersion in ASP.NET 2.0
Installing Ubuntu on Virtual PC 2004
Accessing the Html Header in ASP.NET 2.0
Tags
General Software Development
SSD
Visual Studio
Windows 7
Mine!
Natty Sci
Archives
November 2009
(1)
February 2009
(1)
December 2005
(1)
October 2005
(1)
August 2005
(1)
July 2005
(1)
June 2005
(1)
April 2005
(3)
February 2005
(1)
January 2005
(2)
November 2004
(2)
September 2004
(1)
August 2004
(1)
July 2004
(2)
June 2004
(3)
May 2004
(10)
April 2004
(5)
March 2004
(4)
February 2004
(3)
January 2004
(4)
December 2003
(16)
October 2003
(2)
September 2003
(7)
August 2003
(16)
July 2003
(5)
June 2003
(13)
May 2003
(7)
April 2003
(22)
March 2003
(32)
February 2003
(50)
January 2003
(3)
Phil Scott's WebLog
Quite exciting this computer magic
February 2005 - Posts
Bug or Not?
Hmmm, I forget how the box model is supposed to do things in CSS, but this seems a little off to me. What I had was a div tag with a width of 500px. Within that I have a nested div with a margin of 25px. I WAS trying to avoid having to do a box model hack to make sure things look OK in IE 5.x.
So everything is hunky dory until I take this layout and put it into a masterpage in VS2005. I drop the ContentPlaceHolder and suddenly my 500px div is 550px large. It seems VS2005 is trying to figure out how wide to make the ContentPlaceHolder "container," and forgetting about the margins (or padding (or borders)). This also happens when you have a panel or anything else set to a width of 100%. So it is just pushing it wider. And since I'm using floats to do the layout, in VS2005 it is pushing my sidebar down because it is too wide to fit into the container. IE 6.0 and Firefox seem to be getting this "right," but honestly I'm not too sure when Firefox is immulating bugs in IE or when IE is in compliance mode anymore.
I'm leaning towards bug. If anyone is curious, here's the fancy code that is screwing stuff up:
<div style="width: 500px">
<div style="padding: 25px; background-color: Orange; border: solid 1px black">
<asp:Panel runat="server" ID="test" style="width:100%">
jyeretjetjetj</asp:Panel>
</div>
</div>
<div style="width: 500px; border: solid 1px black">
another 500px div
</div>
Take out the panel and just put normal text (or even just a div with width=100%) and it displays fine.
So, bug or not?
Posted
Feb 02 2005, 02:34 PM
by
Phil Scott
with
2 comment(s)
More Posts
Terms of Use