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

Finding a nested HTML element within a frame using Selenium without the presence of an iframe

Currently, I am delving into the world of Selenium using python to automate form filling on a particular website. However, my efforts have hit a roadblock as I am struggling to identify any elements within a frame and encountering a dreaded NoSuchElementEx ...

Ways to divide background color in half using CSS

Looking for some help with CSS - I want to split an HTML page into two sections, with a background and text/login form on top. Can anyone provide sample CSS and HTML code? This is what I've tried so far in CSS: .logindiv { height: 200px; width: ...

What is the best way to adjust the size of a div element so that it is

I am facing an issue with a table that contains a TreeView within a cell. The code snippet is shown below: <style> #leftPanel { width:60px; height:'100%'; border:1px solid red; ...

How to target and append individual table cells to a particular table row using JQuery

Here is a snippet of code to consider: <tbody> <tr class="wsui-table-row-odd"> <td>IamaTextFieldBox</td> <td class="im-label-required">Label required</td> </tr> <tr class="wsui-table-row ...

Can someone assist me in figuring out how to solve selecting multiple radio buttons at once

<script type="text/javascript"> let x = "1.html"; let y = "2.html"; function redirectPage(form){ for(let i=0; i<form.length; i++) { if(form.answerq[i].checked && form.answerw[i].checked && f ...

Generate a two-dimensional array of pixel images using HTML5 canvas

Hey everyone, I'm trying to copy an image pixel to a matrix in JavaScript so I can use it later. Can someone take a look and let me know if I'm using the matrix correctly? I'm new to coding so any help is appreciated. Thanks! <canvas id= ...

Scraping Information on Pokemon from the Web

I am currently researching the number of moves each Pokemon from the first generation could learn. After some exploration, I came across a helpful website that provides this information: The website lists 151 Pokemon, and for each of them, their move set ...

Ways to optimize view caching to prevent unnecessary file reads and rendering

My current code includes multiple view render calls: router.get('/mcn', (req, res) => { res.render('product/mcn', { layout: 'product/layout', contactKey: 'mcn' }); }); router.get('/agency', (req, res ...

Utilize Bootstrap button dropdown to automatically assign a selected value to a list item

I have a form with a select box that transforms into a bootstrap button after the page loads. However, I am unable to set the selected value for the converted bootstrap button drop-down li. <button type="button" class="btn dropdown-toggle btn-default" ...

Session-related issue occurred

Encountering an issue here. I am using a login control and storing the session in the login button. Below is the code snippet: protected void LoginButton_Click(object sender, EventArgs e) { Session["username"] = Login1.UserName; } However, when atte ...

Combining LESS with cultural designations

Currently working on a multi-lingual website project and facing the challenge of switching out CSS based on different languages. I am passing the culture code into the page and exploring ways to use it to reference specific selectors for each language. H ...

Avoid repeated appending of data in JavaScript and HTML

I am working with an HTML table and I need to ensure that the values in the second column do not repeat within the grid. Below is the JavaScript code I have written for this purpose: var $addedProductCodes = []; function getProductData(value){ $t ...

Issue with division operation in HTML not functioning

I've been working on a division calculation within an HTML file, but so far I haven't had success using PHP or JavaScript. While {{ property.listprice }} is correctly displaying a number in the HTML file, the other elements are not functioning as ...

What is the method for identifying which individual element is responsible for activating an event listener?

While working on a color picker project in JavaScript for practice, I encountered an issue. I needed the #screen element to display the selected color when clicked. How can I determine which color has been clicked and pass its value to the function so that ...

Error: The specified method in ASP.NET MVC 2 cannot be found

After launching my asp.net mvc 2 site on a shared hosting platform, I encountered the following issue: Method not found: 'Void System.Web.Mvc.DataAnnotationsModelValidatorProvider. set_AddImplicitRequiredAttributeForValueTypes(Boolean)'. Upon c ...

What is the process for assigning default values to dynamically generated form elements?

I have been working on building a single-page application (SPA) using JavaScript and jQuery. During the process, I encountered an issue with a dynamic form. The user is able to add specific fields as needed, but if they don't generate and utilize all ...

Guide to Embedding Dynamic Images in HTML Using VUE

I am venturing into the world of VUE for the first time, and I find myself in need of a header component that can display an image based on a string variable. Despite my best efforts to search for tutorials, I have not been able to find a solution. Header ...

Add some pizzazz to your design using jQuery!

I have been working on a web application using asp.net c#. I have a div element where I applied the following style to it at the server side: spanNivelRiesgo1.Attributes.Add("style", "display:none; visibility:hidden"); Now, I have a radiobutton list and ...

Vue.js app does not have the capability to display JSON data as a table

I successfully fetched JSON data in my vue app from the endpoint '/v1/api/sse?raceId=1', but I'm struggling to convert this JSON into a table format. The JSON is displaying correctly, but I'm unsure how to structure it into a table. He ...

What is the best way to deploy an ASP .NET application on IIS with complete trust?

We've got this complex industrial system that can be controlled through some C++ DLLs. To make things easier, I created a .NET wrapper in order to manage the system and then integrated this into an ASP .NET web application for remote control access. ...