The ASP Classic site is not displaying the expected styles on its elements

Currently, I am revamping an ASP Classic website. The entire site relies on a major CSS file named Main which houses all the styles used. In this file, there are not many styles as the current design is quite basic. Some elements on certain pages have their styles coded directly into the HTML.

The task at hand initially seemed simple enough. I updated the styles for all the basic elements in Main.css to match the new design. However, I encountered an issue where the styles of some elements on specific pages refused to change, even when specified inline. Some elements did alter certain properties but overall did not conform. In addition, applying new styles sometimes disrupted the layout of the pages in ways I couldn't comprehend.

Main.css is included on these problematic pages. These pages contain a significant amount of ASP code embedded within them, handling the business logic. As someone who isn't an expert in ASP Classic, I am left wondering what could be causing these elements to disregard standard HTML and CSS styling?

For illustration purposes (I am from Russia), here is a snippet of the ASP page code:

Here is the resulting output:

And here is the observation from the styles watcher in IE9:

An input button styled inline:

An input button styled via Main.css:

It's curious to note that when using inline styling, only part of it seems to take effect, which is perplexing. Furthermore, applying the style from the Main.css file only inherits from the BODY tag and does not apply to the selector input[type="button"]. Interestingly, this selector works fine on other pages.

UPD1. After making changes like modifying </link/> to </link> and doing the same for input, strange tags were eliminated from the resulting page. Yet, the problem persisted - the page still recognizes the existence of Main.css and applies parts of it (such as BODY tag styling) to my buttons, but fails to recognize the style associated with the buttons themselves.

UPD2. A peculiar anomaly was discovered. The version of Main.css received by the problematic pages differs from the original! Some attributes present in the original file are missing in the received version, for example:

Original Main.css:

INPUT.button {
    min-width: 143px;
    font-face: Arial;
    height: 34px;
    border: 1px solid grey;
    background: #FCFCFC;
    border-radius: 7px;
    box-shadow: 0 0 2px grey;
    padding-left: 10px;
    padding-right: 10px;    
}

Received Main.css:

INPUT.button {
    min-width: 143px;
    font-face: Arial;
    height: 34px;
    border: 1px solid grey;
    background: #FCFCFC;
    padding-left: 10px;
    padding-right: 10px;    
}

It appears that certain attributes are omitted in the received file. How can this occur??

Answer №1

When working with Asp, the key is to examine the applied styles after the rendering process. I would suggest using Chrome for this task. Simply right-click on an element and select "Inspect Element" to reveal a panel showing all styles applied to that particular element. From there, you can easily pinpoint the conflicting style and its source.

Chances are, there is an inline style embedded in one of your included asp pages that is causing the conflict with your new styles. By using Chrome to identify the injected style, you can then locate where it is defined and troubleshoot accordingly.

Answer №2

It turned out that the issue stemmed from certain pages lacking the <!DOCTYPE html> tag. Additionally, these problematic pages contained ASP code before the <html> tag, causing the entire page to display incorrectly. The solution involved relocating all ASP code within the <head> tag, resulting in successful rendering of the page.

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

Conceal the slider thumb within the material-ui framework

I've been attempting to conceal the slide thumb, initially without using a library. However, I started considering utilizing material-ui as it might make the process easier. Hence, I'm seeking assistance here. Below is my code snippet: import * ...

Accordion menu causing Javascript linking problem

After following a tutorial, I managed to create an accordion menu in JavaScript. In the current setup, each main li with the class "ToggleSubmenu" acts as a category that can hide/show the sub-lis. Now, my query is this: How can I retain the link functio ...

How can a Vue component be created with a template that solely consists of a property's text?

Looking for a way to incorporate plain text within a Vue component template area? The current method involves wrapping the text in a div, but this causes layout issues when concatenating components with other text fragments. This results in awkward spacing ...

Is there a way to verify if a checkbox has been checked?

Having trouble with this code: if($('#primayins').prop('checked')) { $("#tx_nm0x0_pricingplan").val(1); } else { $("#tx_nm0x0_pricingplan").val(2); } It keeps returning false consistently ...

Date Selector Tool for Input Field

Does anyone know how to change the color of the date picker that appears in certain browsers but is unsure about the selector's name? HTML: <form action="pledge.html" method="post"> <input type="date" id="birthday" name="user_bda ...

Learn the steps to update PHP headers on a specific website using AJAX

contactfrm.php <?php // Server side validation $name = $_POST['name']; $surname = $_POST['surname']; $bsubject = $_POST['subject']; $email= $_POST['email']; $message= $_POST['message']; $to = " ...

The shade of gray on Google Maps is distinctive

Why is my Google Maps script gray when the page loads? When I inspect the elements, it seems like it's due to resizing. Can anyone help me with this issue? Thanks in advance for any assistance. Below is the HTML code for the map which is included with ...

Parent div not properly adjusting its height

I am currently working on developing a fluid layout, however I have encountered a minor issue with the height of the container. The outer <div> (highlighted in yellow, ip_A-1) is not adjusting its height according to its child elements. You can view ...

Enhanced spacing of characters in website text

Currently working on a client's website, I find myself once again being asked by my boss (who is the designer) to increase letter-spacing in the text for aesthetic reasons. However, I strongly believe that this practice can actually lead to eye strain ...

The issue of the JQuery div failing to center itself persists even after refreshing the page

I have implemented a script to centrally align the main content div within the viewing area. It works perfectly on page load or resize, but upon page refresh, the content div shifts to the left side of the page. You can see the issue here when pressing re ...

Using an image instead of a checkbox when it is selected (Angular 4/Ionic 3)

Is there a way to swap out the checkbox for an image? I want this image to change dynamically based on whether the checkbox is checked or not. Unfortunately, adding a class doesn't seem to do the trick as it modifies all icons in the same column. The ...

Guide on choosing a specific div element from a different page using AJAX

I have a Social Media platform with posts, and I am trying to display the newest ones using JavaScript (JS) and AJAX. I attempted to reload my page using AJAX and insert it into a div element, but now the entire website is loading within that div element, ...

Exploring the wonders of Bootstrap 3 panels and stylish floating images

Is it possible to create a responsive design using Bootstrap 3 panel along with a floating image positioned next to it? I want the panel to seamlessly fit into the available space, without overlapping the image. Can anyone provide guidance on achieving thi ...

Is there a way to redirect the user directly to the upload page without displaying the response?

Recently, I came across this code snippet that adds a progress bar to an upload form. Currently, the code displays the response from the upload page below the form. However, my goal is to redirect the user to the upload page so they can view the response t ...

Managing Positioning of PHP Print Statement

Recently, I developed a PHP script for my site that facilitates user registration and login specifically for membership purposes. If a user successfully logs in, the script redirects them to a landing page for members. However, if the login fails, the scri ...

CSS is effective when styling table elements such as 'tr' and 'td', but encounters issues when trying to include 'th'

I have a variety of tables on my website, most of them without borders. However, I want to add borders to some of them. In my CSS, I am using a specific class for those tables: table { padding: 2px; border-collapse: collapse; table-layout: auto; te ...

The information submitted through the form is not displaying on the console after being gathered using the post method in Express

When attempting to add products using a form on the admin page, the data (including an image file) is not being displayed in the console as expected. Instead, the following message appears: "{} POST /admin/add-product - - ms - -" Below is th ...

What is the best way to update a canvas chart when the side menu is hidden?

I am facing an issue with the layout of my webpage, which includes a left side menu and a canvas chart. The left side menu occupies the first 155 pixels of the width, leaving the rest for the canvas chart set to a width of 100%. However, when I close the ...

Disappearing act: The vanishing act of the Bootstrap 4 Smart Scroll Mobile

Utilizing the Smart Scroll feature from in Bootstrap has been successful on desktop, but issues arise on mobile devices. When scrolling down and returning to the top, the navbar experiences glitches by hiding again. Attempting solutions from Bootstrap 4 S ...

Initiate an "execute.document" command directly from the address bar

While reviewing my old website, I stumbled upon this snippet: <input type="image" id="QuickPass" name="QuickPass" src="/images/QuickPass.gif" alt="Quick Pass" onclick="document.pressed=this.value" value="QuickPass" /> nestled within this form: & ...