Distinguishing CSS Variances on ASP.Net Site with Android 4+

I am encountering an issue with my current ASP.Net Mobile Website design. It is rendering correctly on android phones pre 4, iPhones, and Blackberries. This problem requires a bit of setup to explain...

CSS

tr
{
    color: #00ff00;
}

#MasterBackButton
{
    text-decoration: none;
    border-radius: 5px;
    background-color: #2f7ac1;
    padding: 5px;
    cursor: pointer;
    color: #ffffff;
}

Below is the sample page with HTML generated by ASP.NET (NOTE: No table tags are used)

<!DOCTYPE html>

<head>
    <title>CSS Problem</title>
    <link id="MainStyleSheet" rel="stylesheet" type="text/css" href="http://10.0.0.108/m/styles/default.css">
</head>
<body id="Body1">
<form method="post" action="/m/" id="MainForm" autocomplete="off">
     <div class="aspNetHidden">
         <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTcwODg1MTE2Ng9kFgJmD2QWAgIBD2QWAgIBDxYCHgZhY3Rpb24FAy9tL2RkHHvpHhoukujQ1p/Rk9kY9OLmIKo=" />
     </div>
     <div style="float: right;">
          <div id="MasterBackButton" onclick="javascript:history.back()">
              Back
          </div>
     </div>
</form>
</body>

This page displays a rounded button for navigation.

It renders correctly on Android 2.3:

However, when viewed on 4.03:

The text suddenly turns green... The tr styling is applying to the div element even though there are no table elements present on the page.

Switching to desktop mode in the browser:

The issue disappears. Strange! I downloaded the exact HTML using wget and hosted it on the server:

And now it works fine! So why does the ASP.NET page show this behavior? I cannot figure out why the tr styling affects the div element. Changing the CSS from tr to table still results in the same issue. It's like the stock Android browser treats everything as a table element in standard mode.

This behavior was confirmed on a real Galaxy S3 device, not just the emulator.

This is just one simplified example from a website that has several errors. A previous question I had posted was downvoted and eventually closed, which contained full site screenshots showing similar issues. Here is the link if you want to view those screenshots:

Edit: Picture shows that the ASP and HTML pages have identical markup.

Answer №1

After much troubleshooting, I finally uncovered the source of the issue. It turns out that having 51degrees installed to auto redirect mobile users was causing problems on my website. When I created a new website and added back all my existing references, the bug resurfaced. Surprisingly, even without any configuration for 51degrees or any reference to it in the web.config file, simply mentioning it was enough to trigger the problem. We had plans to upgrade to the premium version this week, but the design errors held us back. These errors seem to be interfering with how new Android browsers interact with the website.

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

unable to retrieve element values using class names

I have created multiple h1 elements with the same class names listed below. <h1 class="h1">One</h1> <h1 class="h1">Two</h1> <h1 class="h1">Three</h1> <h1 class="h1">Four</h1> I have also added a button that ...

Steer clear of using inline styling when designing with Mui V5

I firmly believe that separating styling from code enhances the clarity and cleanliness of the code. Personally, I have always viewed using inline styling (style={{}}) as a bad practice. In Mui V4, it was simple - I would create a styles file and import i ...

JavaScript Functions for Beginners

I'm currently facing some challenges with transferring the scripts and HTML content from the calendar on refdesk.com. My task involves moving the JavaScript to a separate stylesheet and utilizing those functions to replicate the calendar on an HTML pa ...

Opening Tags in Selenium for HTML

Is it possible for Selenium with XPath to properly work with HTML that is not in the form of XML, and contains open tags like <col> and <input>? I'm curious if anyone can confirm this. I ask because our automation testing team has noticed ...

I am looking to navigate between tabs on a multi-part form in order to submit all the form data

My current form consists of five questions, each on a separate tab. What I am trying to achieve is the following: When the user submits the form data on the fifth tab An Ajax request sends the form data to a background script for processing Simultaneousl ...

Leveraging Affix in Bootstrap version 2.3.2

Hey there, I'm currently working on building a sidebar similar to the one you can find here. The issue I'm facing is that my sidebar overlaps with the footer at the bottom of the page. What I need is for the sidebar to move up when the user scrol ...

Having trouble getting CSS media query to work in my Rails mailer template

Is it true that media queries do not work in email templates? I have a simple test template and a query BUT can't seem to get it to function properly. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DT ...

What could be the reason for the mouseleave event not functioning properly?

I have a JSFiddle that is working perfectly. Check out my Fiddle here. In my code, I am trying to make a div change colors when hovered over and then back to its original color when the mouse moves out. It works fine on JSFiddle but not locally. When I r ...

What is the best way to perfectly center my CSS menu in a fluid style layout?

Can you assist me with this issue? I am trying to center my CSS menu precisely in the middle of the user's screen, both vertically and horizontally. Since users have varying screen resolutions, I need a fluid example to achieve this. Below is the HT ...

Creating an application for inputting data by utilizing angular material and javascript

I am looking to create an application using Angular Material Design, AngularJS (in HTML), and JavaScript. The application should take input such as name, place, phone number, and email, and once submitted, it should be stored in a table below. You can fin ...

Having trouble with less.modifyVars not functioning properly in Visual Studio?

I attempted to dynamically change the LESS variable using HTML within an AngularJS function. The code worked fine on XAMPP with simple HTML and CSS, but when I transferred it to an enterprise app in Visual Studio, it stopped functioning properly. While the ...

Is there a way to update the value of a variable with the help of a checkbox?

When I check the checkbox, the specOrder const gets updated as expected. However, I am struggling to figure out how to remove the value when the checkbox is unchecked. Below is the code I have been working on: const SpecialtyBurgers = () => { cons ...

What is the best way to extract words from a string within a textarea using javascript?

Currently, I am focused on improving my skills in JavaScript and HTML. In one of my projects, there is a text area where the user inputs a CSV format like this: 17845 hello bye 789 After input, I get 17845,hello,bye,789. Now, the challenge is t ...

Customizing the styling of a TextField component in ReactJS using material-ui

I am currently working with Reactjs and material-ui. I am looking to apply some custom styles to a TextField using css. Specifically, I would like to change the color of the TextField underline and label when the input is clicked. Although I know it can b ...

What is the best way to conceal a CSS div through PHP if the div is empty?

I need some help refining my previous question to ensure clarity. Is there a straightforward method for hiding a div when it doesn't contain any information, without causing confusion for the client? This specific div receives information from Jooml ...

Incorporating JavaScript to dynamically load an HTML page into an iframe

I am attempting to have each option load a unique page within a frame <!DOCTYPE html> <html> <head> <script> function selectCountry() { var mylist=document.getElementById("country"); document.getElementById("frame").src=mylist.opti ...

I'm curious about the specific purpose of /1 in font styling at 16px

Can anyone explain the purpose of /1 in the font: 16px/1 style declaration? I removed the /1 from the code and noticed increased spacing between lines. What is the specific role of /1 in this situation? body { font: 16px/1 'Open Sans', sans ...

Is it wise to use position absolute when floating a React JS tag around a component?

I am eager to dive into a challenging project. My goal is to replicate the design shown in the image below using React JS. Initially, I considered using position: absolute and manipulating the positioning of my divs accordingly. However, upon closer inspec ...

I cannot locate the dropdown list anywhere

As a beginner in html and css, I decided to follow a tutorial on youtube. The tutorial focuses on creating a navigation bar with dropdown menus using html and css. I wanted the names Ria, Kezia, and Gelia to be displayed when hovering my mouse over the Su ...

A situation where the event onclick fails to occur within NextJS

index.js: function Home () { return <div> <html> <head> <title>Site</title> </head> <body> <div class= 'v5_3' onclick = "func_click()"></div> </b ...