Tips for adjusting Default ASP page size in Visual Studio for big screens?

My ASP page is not fitting the entire screen on large screens. How do I make it responsive?

The CSS file contains the following styling:

    /* DEFAULTS
----------------------------------------------------------*/

body   
{
    background: #b6b7bc;
    font-size: .80em;
    font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
    margin: 0px;
    padding: 0px;
    color: #696969;
}

/* More CSS styles here */

I attempted to modify the .page section as follows:

   .page
    {
        height: 100%;
        width: 100%;
        background-color: #fff;
        margin: 20px auto 0px auto;
        border: 3px solid #496077;
    }

However, this only partially worked for the width and did not adjust the content positions. Any ideas on how to resolve this issue?

Here is the code for the site master file:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>

<body>
    <form runat="server">
        <div class="page">
            <div class="header">
                <div class="title">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Styles/TUClogo2.png" style="margin-left: 0px" Height="82px" Width="408px" />
                </div>
                <div class="loginDisplay">
                    <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                        <AnonymousTemplate>
                            [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                        </AnonymousTemplate>
                        <LoggedInTemplate>
                            Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                            [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                        </LoggedInTemplate>
                    </asp:LoginView>
                </div>
                <div class="clear hideSkiplink">
                    <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                        <Items>
                            <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                            <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                        </Items>
                    </asp:Menu>
                </div>
            </div>
            <div class="main">
                <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="footer">

        </div>
    </form>
</body>
</html>

Answer №1

Using the height property in this scenario will not have the desired effect. To resolve this, include the following CSS code:

body {
    height: 100%;
}

Implementing this will ensure that the body element takes up 100% of the available height. I trust this solution proves to be beneficial.

Answer №2

Not only should you increase the height of the html element, but also the body element as shown in the following code snippet:

html, body 
{ 
width: 100%;
height: 100%; 
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The Safari browser is having trouble rendering the website's CSS and HTML properly

Check out this example of how the website should look on Chrome for Android: https://i.stack.imgur.com/RzUSp.jpg And here is an example from Safari on iPad Mini 2: https://i.stack.imgur.com/PAj2i.jpg The Safari version doesn't display the proper fon ...

Disabling Highchart datalabels when the window is resized

While attempting to implement a pie chart using Highcharts, I have encountered an issue with the datalabels getting cropped on very low resolutions. I tried adding a windows.resize within the formatter function but it did not work. Below is the current c ...

Unable to update div CSS using button click functionality

I have been working on this HTML/CSS code and I am trying to change the style of a div using a JavaScript button click event so that the div becomes visible and clickable. However, despite my efforts, it doesn't seem to be working as expected. Whenev ...

Safari doesn't seem to recognize z-index property

Currently, I am utilizing a responsive template to develop a website. An issue arises in Safari where the footer overlaps the navigation bar at the bottom of the page, despite being positioned above it earlier. It appears that the z-index attribute is not ...

Can search criteria be saved for later use?

I operate a classifieds website that allows users to search through ads. I am contemplating ways to save search criteria so that users can easily reuse them for future searches without having to input the same details over and over again. For instance, th ...

What is the best method for transferring data from PHP to Python?

I am currently running a Python application that requires receiving and processing data. I have a PHP server that is able to access this data. I am looking for a way to send JSON data from PHP to my Python application. Is there another method aside from ru ...

How to locate every JavaScript event connected with an HTML element by utilizing Google Chrome

Looking for an easy method to identify all JavaScript events linked to a specific HTML element in Chrome? For example: HTML element <a href="#" class="cancel_link refresh_page">Cancel</a> Script: <script type="text/javascript"> $ ...

What is the reason behind an inline element being able to have an explicit width when floating?

When trying to set the width for an inline element <span> within a table-row containing multiple span elements, I encountered difficulty. However, after adding float: left, I was finally able to adjust the width. What is the reason behind the initia ...

What is preventing the input box from shrinking further?

I created a search box using CSS grid that is supposed to shrink when the page is resized. However, it doesn't seem to shrink as much as I expected it to. Here is how it appears when fully extended: https://i.stack.imgur.com/tPuCg.png And here is how ...

Populate an HTML table using a JavaScript array containing objects

Greetings, fellow coders! I am new to the coding world and this community, and despite my efforts in searching for a solution, I couldn't find exactly what I was looking for. So, here is my question: I have an array structured as follows: const arr ...

What does ASP.NET use as default mode for handling cookies in the web config when there are none present?

What is the default setting for using cookies in the web configuration of ASP.NET? ...

"Implementing jQuery to dynamically set the href attribute for a link when

My website features a tabbed menu that displays content from various WordPress categories including Cars, Trucks, and Buses. The active tab is randomly selected each time the page is reloaded. However, there seems to be an issue with the "View More" button ...

Issue detected in EF Core: There is a new operation initiated on this context before the completion of a prior operation

Encountered a peculiar error in my web API application: A second operation started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe. The problem arises during a process to calculate the payda ...

Steps to center the search form in the navbar and make it expand in Bootstrap 5

I'm utilizing Bootstrap v5.1.3 and have included a navbar as shown below: navbar Here is the code for that implementation: <div class="container"> <nav class="navbar navbar-expand-lg navbar-light bg-light& ...

Can anyone help me with coloring Devanagiri diacritics in ReactJS?

I am currently working on a ReactJS project and I have come across an issue. I would like for the diacritic of a Devanagiri letter to be displayed in a different color than the letter it is attached to. For example: क + ी make की I was wondering ...

C# - Converting a String to a Time String

Is there a way to convert the given string values? For example, if we have string Time = "2324"; and string Time = "1024"; The desired outcome for the first case should be another string "11:24 PM" , while the second case should result in "10:24 AM". I ...

Could anyone provide some insight into the reason behind this occurrence?

I just came across the most peculiar situation I've ever experienced. Check out this unique test page: <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script language=javascript> fun ...

Revamping Tab Styles with CSS

Currently, I am working on a mat tab project. The code snippet I am using is: <mat-tab-group> <mat-tab [label]="tab" *ngFor="let tab of lotsOfTabs">Content</mat-tab> </mat-tab-group> If you want to see the liv ...

Bootstrap modal within a nested clickable div

Utilizing the bootstrap MODAL plugin with nested divs, I have a requirement where clicking on the inside div should display the EDIT form, and clicking on the container div should show the ADD NEW form. Here is the code snippet: <div id="container" sty ...

Avoiding the appearance of a scrollbar when content extends beyond its containing block

I am struggling with writing markup and CSS to prevent a background image from creating a scrollbar unless the viewport is narrower than the inner content wrapper: The solution provided in this post didn't work for me: Absolutely positioned div on ri ...