Modifications to the CSS layout on HTML and ASPX pages

My website is displaying different outputs on the .aspx page compared to the HTML page, even though they are using the same structure and CSS. The CSS seems to be collapsing on the aspx page. I have double-checked both codes and they are identical, yet the output is inconsistent.

Output on HTML Page: https://i.sstatic.net/dDSBu.jpg

Output on ASPX page: https://i.sstatic.net/cauR7.jpg

HTML Code:

<!--bg-img-container-starts--><div class="bg-img-container">
        <!--bg-img-starts--><div class="bg-img">
            <!--header-starts--><div class="header">
                <!--logo-starts--><div class="logo">
                    <h2><a title="Quista" href="#">Quista</a></h2>
                </div><!--logo-ends-->

                <!--menus-starts--><div class="menus">
                    <ul class="nav">
                    <li><a href="#">Home</a> <div class="pipe"></div></li>
                    <li><a href="#">Services</a></li>
                    <li><a href="#">Pricing</a></li>
                    <li><a href="#">Track Orders</a></li>
                    <li><a href="#">About Quista</a></li>
                    <li class="call"><a href="#">Call Us :- +91 1234 1245</a></li>
                    </ul>
                </div><!--menus-ends-->
            </div><!--header-ends-->
        </div><!--bg-img-ends-->

CSS

html, body{
    margin:0;
    padding:0;
    width:100%;
    height:100%
}

.clear{clear:both}

body{
    font-family:'Quicksand', sans-serif;
}

.bg-img-container{
    width:100%;
    position:relative;
    height:100%
}

.bg-img{
    width:100%;
    max-height:768px;
    height:100%;
    background:url(../Images/0000.jpg) no-repeat;
    background-size:cover;
}

.header{
    width:100%;
    max-width:1200px;
    position:relative;
    margin:0 auto;
    padding:15px 0 0 0
}

.logo{
    width:20%;
    display:inline-block;
}

.logo h2{
    font-family:'MyriadPro-BoldCondIt';
    font-size:4em;
    padding:0;
    margin:0;
    letter-spacing: 5px
}

.logo a{
    color:#fff;
    text-decoration:none
}

.menus{
    width:79%;
    display:inline-block;
}

.nav{
    marging:0;
    padding:0
}

.nav li{
    display:inline-block;
    list-style:none:none;
}

.nav li a {
    padding:15px 25px 15px 25px;
    color:#fff;
    text-decoration:none;
    display:block
}

.nav li a:hover{
    border-bottom:2px solid #FFF
}

.call{
    background:#df6b5e;
    border-radius:50px
}

.call a{
    font-weight:bold;
    padding:15px 25px 15px 25px !important
}

.call a:hover{
    border:none !important
}

I believe the issue lies with the top div (img-bg-container) as I have set the height to 100% in the CSS and its child div to max-height:768px. The problem seems to be resolved when I use min-height instead of max-height in the aspx page, but it is puzzling how the output differs when the codes are identical..

Answer №1

Perform a simple task. Simply right click on the page and select "inspect element." This will allow you to view both the page's HTML and CSS, making it easier to identify any issues with the CSS.

Additionally, make sure to review the CSS for the form tag, as in ASP.NET we typically place the form tag above all other HTML tags within the body tag. This structure is not commonly seen in typical HTML pages. Take a look and inform me of any findings.

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

Exploring the Application Domain Concept in ASP.NET

As a novice in the field, I am looking to learn more about Application Domain in ASP.NET. Could someone kindly provide an explanation or share a useful resource where I can delve deeper into this topic? Your assistance is greatly appreciated. ...

What is the best way to map a C# property to a JSON object in ASP.NET MVC?

++ Model public class ProductDetails{ public int Id { get; set; } public string Name { get; set; } public DataTable dataTable = new DataTable(); public Category productCategory = new Category(); } ++Controller ...

Tips for displaying CSS background color on top of an inline style background image

I am facing a dilemma while using Laravel - if I put a background image into my CSS style sheet, I lose my variable. Currently, this is how I have it set up: <div class="gradient"><div class="topback" style="background-image: url('/storage/c ...

Having trouble getting a DIV to appear on top of another DIV containing an image

I need help with positioning an "InfoBox" above the main header image on my website. Despite trying z-indexes and adjusting position, I can't seem to get it right. If anyone has any suggestions, please share. Thank you! For reference, here is the HTM ...

Display active button when switching content panels with jQuery upon page load

I have implemented a content panel switcher plugin from here, and with the help of code snippets found in previous posts, I was able to achieve active item highlighting when clicked. For reference, you can view the implementation here: http://jsfiddle.net ...

Scrapy XPath results may vary from those seen in a web browser

I am struggling to identify the issue here. I am using Scrapy to extract data from a website that has a structure similar to this: <li class="foo"> <span class="date1">20 hours ago</span> <span class=" ...

ASP.NET - Access control based on user types

I currently have 3 different user types in my ASP.net application, each with their own set of accessible pages: (1) User Type-A {Default.aspx, a.aspx, b.aspx and c.aspx}, (2) User Type-B {Default.aspx, d.aspx, e.aspx and f.aspx}, (4) Admin {Default.aspx ...

What steps can I take to ensure my website is optimized for a seamless viewing experience on all mobile devices

Could you please check out the link on your smartphone and let me know if it looks a bit off to you? I have centered everything and the website looks fine on desktop, but on my iPhone 5S, it doesn't seem to display properly. Is there a way to make it ...

Obtain the updated values of a DOM object in JavaScript

I need to access the DOM object in JavaScript with the updated values. Here is the code I have been using: <script> $(document).ready(function(){ $("#btnTest").click(function () { alert($("html").html()); /*further ...

What is the best way to open a browser window at a quarter of its default size?

Is there a way to open a window at 25% of its default device browser window size? I attempted the code below, which worked. However, it only accepts pixel inputs and not relative % values. This makes it non-scalable across various devices. window.resizeT ...

Ways to detect the use of vue.js on a webpage without relying on vue-devtools

One way to determine if the page is utilizing Angular or AngularJS is by inspecting window.ng and window.angular. Is there a similar method to identify whether Vue is being used on the page directly from the console, without relying on vue-devtools? ...

Adjust input dimensions dynamically with Ajax

Currently, I am utilizing an input form to collect user input in the form of an OTP. This OTP can range from 4 digits, 5 digits, to 6 digits. The approach I have taken so far is functional but lacks dynamism. It necessitates a page refresh to display the d ...

The getimagesize functionality seems to be malfunctioning

I have developed a function that resizes images to fit as a background image for a div. I provide the function with the div size and the image path. It works perfectly when the height is larger than the width, but it fails when the width is larger than the ...

Is it a:first-child or a:first-child aside?

I'm currently working on designing a sidebar and I'm trying to figure out how to remove text decoration using the first-child selector. Here is a snippet of the HTML code I am working with: <aside> <nav> <div id="guid ...

How to use PHP for setting up a MySQL database?

Currently, I am immersing myself in the world of PHP and MySQL. I decided to take a shot at creating a basic HTML form along with a PHP script to set up a MySQL database. Unfortunately, when I tried to test it out, things didn't go as planned. Upon su ...

Click the toggle ng-press attribute

I have a section with an on-click="..." action. The event slightly adjusts the section's appearance within the document so that it resembles a button. I am looking to switch between making this section clickable and non-clickable in my program. While ...

The second input box within the form is malfunctioning on the second attempt

I created this form: <form id="addChore" method="post" action="allocate.php"> <label>Enter chore name:</label> <input type="text" id = "choreName" name="choreName"> ...

Creating a layout with two distinct columns and varying rows using Bootstrap

Recently delving into the world of Bootstrap, I encountered a challenge when attempting to replicate an old design created using tables. Here is the design: https://i.sstatic.net/byoTu.png Unfortunately, my Bootstrap skills are not quite up to par in ach ...

Utilize Bootstrap 4 classes to center divs horizontally in the container at the top, middle, and bottom

I'm having trouble finding the right way to center the div elements horizontally. .d-flex.flex-row.justify-content-center div.align-self-start p Top div.align-self-center p Middle div.align-self-end p Bottom http ...

Strange height problem detected in embedded YouTube video

Currently, I have a page with an embedded YouTube video that is intended to be placed in a container with a variable width. When the video is outside of the container, the aspect ratio appears normal. However, once it is placed inside the container, the he ...