Take the 2-minute tour ×

I have a problem with an existing ASP.Net Mobile Website that current renders correctly under android phones pre 4, iphones, and blackberries. This question will take a little bit of set up but..


    color: #00ff00;

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

Here is the sample page with html being produced by asp.net (NOTE: NO tables tags at all)

<!DOCTYPE html>

    <title>CSS Problem</title>
    <link id="MainStyleSheet" rel="stylesheet" type="text/css" href="">
<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 style="float: right;">
          <div id="MasterBackButton" onclick="javascript:history.back()">

Just a page with a rounded button to go back.

Here it is under android 2.3 as expected:

enter image description here

Now here is that same page under 4.03

enter image description here

Suddenly the text is green.... For some reason the tr's styling is applying to the div even though there is not a single table element on the page.

Now, I hit desktop mode on the browser and:

enter image description here

And it suddenly works. WEIRD. Ok, i use wget and to download the exact html and put that file on the web server:

enter image description here

And it works! So why is the ASP.Net page all messed up? I cannot for the life of me figure out why the tr's styling is effecting the div. If I change the CSS from tr to table it still changes it. So far any table element I have tried does it. It is almost like in standard more the stock android browser is treating everything like a table element.

I can confirm this all happens on a real Galaxy S 3 and not just the emulator.

This is only a single as simplified as possible example that I can get for a website that has numerous errors. I had a previous question that was ranked down and eventually closed that has full site screen shots that you can see of this happened. And even that is better than some of the pages within the site. Mobile CSS Broke Android 4+ If you want to see those screenshots.

Edit: Picture showing that the asp and html pages have the same identical markup.

share|improve this question
I don't think it has anything to do with ASP.NET. You could try resetting your css before using normalize.css or similar. –  Steve Nov 15 '12 at 20:03
Before stripping it down to the bare bones it was using YUI's css reset. If I change the tr color to yellow the text becomes yellow. Only on Android 4+ and only when served as a asp.net page. –  jheizer Nov 15 '12 at 20:12
Does anyone know if there is a way to force android to render in the "desktop mode" like you can with IE? –  jheizer Nov 15 '12 at 23:25

1 Answer 1

up vote 0 down vote accepted

Well I finally figured it out. I have 51degrees installed to auto redirect mobile users. I created a fresh web site and once I added back all my existing references this bug roared its ugly head again. Even if I have no config for 51degrees, nothing in the web.config referring to it just referencing it is enough to cause the problem. We were jsut about to upgrade from the lite to the premium version this week until I was stopped by the design errors. They must some how be interfering with responses to new android browsers.

share|improve this answer

Your Answer


