Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2016, 09:23 AM
Authorized User
 
Join Date: Nov 2014
Posts: 91
Thanks: 2
Thanked 1 Time in 1 Post
Default Locking the Web Page at the Top

Hi Imar,

How do you lock a web page to the top of the display window? When I open my website in a browser, the default page opens several lines down from the display window. I then have to scroll it to get it to the top of the window. This behavior also applies to the other web pages.
 
Old February 16th, 2016, 10:02 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I don't understand what you're asking. Can you elaborate? And maybe post a live URL or screenshot?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 16th, 2016, 10:16 PM
Authorized User
 
Join Date: Nov 2014
Posts: 91
Thanks: 2
Thanked 1 Time in 1 Post
Default Locking the Web Page at the Top

Imar,

The web program is on my personal computer so there is no live URL. I tried to paste the screen shot, but it did not take. I will try to draw what I mean.

__________________________ top of display window
line space
line space
.
.
.
line space
line space
___________________________ top of web page


What I want to do is eliminate the line spaces so that the top of the web page aligns with the top of the display window.
 
Old February 17th, 2016, 04:13 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Maybe there are line breaks in your master? Or a top margin in your CSS?

Try posting your screenshot online somewhere, there are plenty of free services that let you do that, and as you know, a picture says more than a thousand words.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 17th, 2016, 09:27 AM
Authorized User
 
Join Date: Nov 2014
Posts: 91
Thanks: 2
Thanked 1 Time in 1 Post
Default Locking the Web Page at the Top

Imar,

I posted the screen shot on Facebook. I opened the account sometime ago but never used it. As you know, my name is Dexter Tom. I do not know if I have to friend you for you to see the post.

I did check the master page and css file and did not find extra line breaks.
 
Old February 17th, 2016, 11:14 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

There are tens or hundreds of Dexter Toms on Facebook ;-)

Try something like this http://tinypic.com/ or email me the picture directly (my address is in the introduction of the book).

Also, try Firebug for Firefox (http://getfirebug.com/) or other developer tools for other browsers to see where the whitespace is coming from. The HTML Panel allows you to point to the empty space and then show the underlying HTML and CSS which might shed some light.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 18th, 2016, 08:59 AM
Authorized User
 
Join Date: Nov 2014
Posts: 91
Thanks: 2
Thanked 1 Time in 1 Post
Default Locking the Web Page at the Top

Hi Imar,

I sent you an email of the screenshot.
 
Old February 18th, 2016, 11:35 PM
Authorized User
 
Join Date: Nov 2014
Posts: 91
Thanks: 2
Thanked 1 Time in 1 Post
Smile Locking the Web Page at the Top

Hi Imar,

Problem fixed. Happy! Happy! Happy!

Thank you very much.
 
Old February 19th, 2016, 06:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

For the benefit of the archive of this forum, would you mind sharing *how* you fixed it?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 19th, 2016, 10:35 PM
Authorized User
 
Join Date: Nov 2014
Posts: 91
Thanks: 2
Thanked 1 Time in 1 Post
Default Locking the Web Page at the Top

Hi Imar,

As you suggested, I looked at the CSS file for styles that could affect the whitespace. Instead of taking them out, I selectively commented out one style at a time, and then requested Default.aspx in the browser. I checked if the line spaces disappeared. If it line spaces did not disappear, I uncommented the style and the commented out the next style, and repeated the process. Eventually, the line spaces disappeared when the following style was commented out:
<code>
h6
{
font-size: 75px;
font-family: Trebuchet MS;
font-style: oblique;
font-weight: bold;
text-align: center;
padding: 0;
}
</code>

Why I had put "padding: 0;" there, I don't recall. But, why would this style cause the line breaks?

I decided to check the MasterPage because that is where I used the <h6> tag. Here's what I saw:
Code:
<header>
    <h6>Kenai River Hale</h6>
</header>
But, I recalled that there is style for the <header> tag in the CSS file. It was
Code:
header
{
  background-color: lightskyblue;
  width: 844px;
  height: 86px;
}
So, it appeared to me that the 'height' in the header style and the 'font-size' in the h6 style were causing the line breaks.

Through trail and error, I modified the header style as follows:
Code:
header
{
  background-color: lightskyblue;
  width: 844px;
  height: 86px;
  font-size: 75px;
  font-family: Trebuchet MS;
  font-style: oblique;
  font-weight: bold;
  text-align: center;
}
and deleted the h6 style.

The code in the MasterPage now became:
<header>
Kenai River Hale
</header>

It works.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does page scroll to top? dotnetDeveloper ASP.NET 2.0 Basics 7 July 28th, 2008 01:57 PM
Chapter 15 p.774 at the top of page shade cat BOOK: Ivor Horton's Beginning Visual C++ 2005 0 June 5th, 2007 03:04 PM
Repositioning Top Left Corner of a Page in print dontknowmuch Java GUI 0 September 30th, 2005 12:05 PM
question asked(bring flash page to the top) ExxWhyZee Flash (all versions) 1 April 13th, 2004 12:48 PM
Sync Top Frame with Web Page savoym HTML Code Clinic 1 January 20th, 2004 04:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.