You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I finaly decided to read the ASP.NET 4.0 version. Everthing is going good, except for one minor thing I can't figure out. I believe I may have had a similar problem when I did the ASP.Net 3.5. I cannot remember for the life of me what ou told me to do to fix the problem.
TheProblem:
The masterpage looks fine in VWD, however when I bring it up in the Browser for some reason there appears a 3/8" gap at the top before the web page.
I've tried several tings with no effect. Do you have any solutios? Do you need to see specifc files? let me know.
With the MasterPage open in VWD I press CTRL & F5 and the browser immediately shows the page with a 3/8" gap at the top before the webpage. Setting the margin and padding to 0 didn't help.
I looked at my @Page as you mentioned and the only difference I could see was that my Doctype had one word different. Mine says Transitional, yours said strict. I tried your version and still have the gap before the webpage.
Here is my version:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
* view generated source of page in runtime.
* remove all styles and add them one by one and test the result after each step
* test your style over plain html file (not aspx pages)
* etc!
these are tests that you can make to find source of problem. the key point in testing is atomic test -> remove all related states that can affect the result and add them step by step and test each step
__________________
happy every time, happy every where
Reza Baiat
Last edited by irProject; February 14th, 2012 at 03:26 AM.
margin: auto only affects the left and right margin and doesn't change the vertical position of an element.
In your case, the behavior is caused by the <p> element in your Header. It appears to have margin which causes the whitespace to appear. Modify your headerText rule set as follows: