I'm having a problem with a web page I'm developing, a Price Per Unit Calculator (in HTML, CSS, and JavaScript/jQuery): When viewed in the Android 2.3.3 default web browser, the menus near the top of the page, Unit type and Display unit, aren't popping up (to let the user select an item from the menu). This problem occurs in both the Android emulator and an Android phone running 2.3.3. The menus work fine with later versions of the Android web browser I've tested (4.0.3 and 4.2 in the emulator), as well as in iOS 6 and on a computer (Firefox and Chrome browsers tested).
In the Android 2.3.3 web browser, when a menu is tapped, a colored rectangle should highlight the menu on the web page, then the menu options pop up in a list on the screen. On my web page, for those menus near the top of the page, the rectangle appears (wider than the menu that was tapped), but seems to stop when it hits the bottom of the div (row) the menu is in, and no menu options pop up; see the orange rectangle in this screenshot. The menus lower in the web page work fine.
Here's the simplified HTML:
<div class="header">
<div class="global">
<div id="unitTypeDiv" class="options col1 unit"><!-- left column-->
<label for="unitType" class="label">Unit type</label><br>
<select name="unitType" id="unitType" class="unitType_input" title="Unit type">
<option value="weight">weight</option>
<option value="volume">volume</option>
<option value="length">length</option>
<option value="area">area</option>
</select>
</div>
<div id="displayUnitDiv" class="options col2 unit"><!-- center column-->
<span id="displayUnitLabel"><label for="displayUnit" class="label">Display unit</label><br></span>
<select name="displayUnit" id="displayUnit" class="displayUnit_input unit_input" title="Display unit">
<option value="oz">oz</option>
<option value="lb">lb</option>
</select>
</div>
</div> <!-- .global -->
</div> <!-- .header -->
<div id="products">
<form method="post" name="priceper" id="priceper">
<div class="product" id="product_0">
<div class="name">
<label for="name_0" class="label"><span>Product 1:</span> Name<br></label>
<input name="name_0" type="text" id="name_0" title="Product 1">
</div>
<div class="unit row">
<label for="unit_0" class="label">Unit</label><br>
<select name="unit_0" id="unit_0" class="unit_input product_unit_input" title="Please choose a unit"> <!--replace with select (pop-up menu)-->
<option value="oz">oz</option>
<option value="lb">lb</option>
</select>
</div>
</div> <!--product_0-->
</form>
</div> <!-- products -->
Edit: Here's the CSS:
body {
background-color: #ddd;
color: #222;
font-family: Helvetica;
margin: 0;
padding: 0;
}
/* HEADER STYLES */
.header {
position:fixed; /* Keep header (title) at top of page always */
top: 0;
width: 100%;
z-index:99998; /* Bring to front */
/*border: 1px dashed red;*/
}
.header h1 {
padding: 0;
text-align: center;
text-shadow: 0px 1px 0px #fff;
/*background-image: -webkit-gradient(linear, left top, left bottom,
from(#ccc), to(red));*/ /* iPhone linear shading; not working*/
/*border: 1px dashed red;*/
margin-top: -3px;
margin-bottom: -3px;
background-color: #ccc;
padding-top: 5px;
padding-bottom:3px;
text-align: center;
border-bottom: 1px solid #666;
}
.header h1 a {
color: #222;
display: block;
font-size: 20px;
font-weight: bold;
text-decoration: none;
}
.global {
/*border: 1px dashed red;*/
background-color: #eee; /* Background color */
height: 43px;
padding-top: 0px;
z-index: 9999;
/*border-bottom: 1px solid #666;*/
}
.col1 { /* Unit type menu */
float: left;
margin-left: 5px;
/*border: 1px dashed red;*/
}
.col2 { /* Display unit menu */
float: none;
overflow: hidden;
text-align:center;
/*display: table-cell;*/
/*border: 1px dashed green;*/
position: absolute;
/* center on browser window: put left at 50%, then offset left (margin-left) by half the width (half of 30% = 15%) */
width: 50%;
position: absolute;
left: 50%;
margin-left: -25%;
}
/* PRODUCT STYLES */
.product {
padding-top: 2px;
padding-bottom: 3px;
padding-left: 5px;
padding-right: 5px;
background-color: #DCDCDC;
border-bottom: 1px solid #999999;
color: #222222;
}
#product_0 {
margin-top: 100px;
}
Apparently the Android 2.3.3 web browser didn't like the last CSS property, margin-top, on a div, #product_0, below the one the problematic menus were in. Simply changing the property to padding-top worked:
#product_0 {
padding-top: 100px;
}
Here's the resulting web page (full version rather than simplified code).
Related
I have created a switchable list of "single image with text" and I only want the active to be visible. All works ok at PC browsers (tried Firefox, IE) but on mobile ANDROID browser (Chrome) I can only see the first "visible" image, while the rest keeps only displaying text.
html:
<ul class="tabs clearfix">
<li class="active"></li>
<li></li>
<li></li>
</ul><!-- tabs -->
<div class="box visible">
<div class="box-text">
<h3>Title</h3>
<p>Text.</p>
</div>
<img src="images/pic1.png" width="437" height="545" alt="">
</div><!-- box -->
<div class="box">
<div class="box-text">
<h3>Title</h3>
<p>Text.</p>
</div>
<img src="images/pic2.png" width="437" height="545" alt="">
</div><!-- box -->
<div class="box">
<div class="box-text">
<h3>Title</h3>
<p>Text.</p>
</div>
<img src="images/pic3.png" width="437" height="545" alt="">
</div><!-- box -->
css:
.tabs li {
width: 20px;
height: 20px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
float: left;
background-color: #cbcfd1;
margin: 0 13px 13px 0;
-moz-transition: background-color 0.15s linear;
-o-transition: background-color 0.15s linear;
-webkit-transition: background-color 0.15s linear;
transition: background-color 0.15s linear;
cursor: pointer;
}
.tabs li:hover {
background-color: #8bcb9d;
}
.tab li.active {
cursor: default;
background-color: #35a654;
}
.box {
display: none;
line-height: 30px;
}
.box.visible {
display: block;
line-height: 30px;
}
I understand from what I found here that there is some kind of problem with mobile Chrome but since I'm a beginner I can't make heads or tails of what I'm supposed to to with it to make it work. Can anyone help please? When I remove display: none; and put block in there, all images can be seen stacked below each other but that is not desired.
I found out that the problem only occures on a mobile phone size device. Galaxy Tab 2 tablet I tried displays everything ok.
Doing a sample webforms project w/ Bootstrap - I have a small form that asks for a user to select two items and an asp:Button for the user to submit their info:
<div class="col-md-5 col-sm-6 col-xs-12 form-horizontal">
<fieldset>
<legend>Enter Your Details</legend>
<div class="input-group" >
<label for="lstItem1">Item 1 : </label>
<asp:DropDownList ID="lstItem1" runat="server" CssClass="form-control "></asp:DropDownList>
</div>
<div class="input-group" >
<label for="lstItem2">Item 2 : </label>
<asp:DropDownList ID="lstItem2" runat="server" CssClass="form-control"></asp:DropDownList>
</div>
<asp:Button ID="btnSubmit" runat="server" Text="Let's Go!" CssClass="btn btn-success shadow-text" OnClick="btnSubmit_Click" />
</fieldset>
</div>
That piece of code is contained in a bootstrap container class.
Everything works fine, except when I test it on a mobile device (Samsung Galaxy Note II Android 4.4 & Chrome 44, and an LG G3 w/ Chrome 44 as well), the button is completely unresponsive. It's not that my event is not firing, the button has no response to it whatsoever! It's baffling.
Here is all the extra CSS I've added that pertains to this block of code:
.shadow-text{ text-shadow: 1px 1px 2px black;}
.btn-success{display: block; z-index:999;}
.input-group { margin-bottom: 15px;}
legend
{
position: relative;
font-size: 1.5em;
font-weight: bold;
padding: 6px 20px 6px 70px;
top: -30px;
margin: 0px 10px 10px -30px;
color: #EEE;
background-color: #d09d90;
text-shadow: 0px 1px 2px #bbb;
-webkit-box-shadow: 0px 2px 4px #888;
-moz-box-shadow: 0px 2px 4px #888;
box-shadow: 0px 2px 4px #888;
}
legend:after
{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 0px;
top: 100%;
border-width: 5px 10px;
border-style: solid;
border-color: #666 #666 transparent transparent;
}
.form-horizontal{
margin-top: 20px;
border: 2px solid gray;
padding: 10px;
}
.jumbotron, .form-horizontal{ background-color: #feeeea; margin-bottom:20px; }
So far I've tried:
Moving the button outside of the block of code shown above, and moved it outside of the fieldset.
Setting the z-index on the .btn class to 999.
Took out any "special effects" css, including shadow-text and legend (which is a ribbon effect for the legend).
Removed bootstrap-related input-group and form-control classes
^^ I've tried so much more but I'm fried from troubleshooting this for 6 hours, I can't even remember all that I've tried.
The one thing that did work, which is not an option, is (accidentally) I closed the surrounding container and added the button after the closing tag. This is not an option, as it screws up the flow with the rest of the columns.
Has anyone had any experience with this, and does anyone know if it's at all related to Bootstrap itself?
Final note - the btnSubmit_Click function contains one line of code, and it's a Response.Redirect that passes the selected values.
I'm trying to show two select boxes in a WebView in Android (4.2.1), but the height of them aren't the correct. In higher Android version (4.4.2) the result is correct with the same CSS. I'm using Bootstrap.
HTML code:
<div class="row col-xs-12 texto-cent barrasearch2 separacion-filas visible-xs" id="barraInbox">
<div class="col-xs-12 col-sm-6 col-md-5 ident-der">
<select size="1" name="cmd2" class="select-mod">
<option value="mg_move">Move messages to</option>
<option value="mg_copy">Copy messages to</option>
<option selected="" value="mb_change">Open mailbox</option>
</select>
...
</div>
</div>
CSS code:
.select-mod{
height: 30px !important;
font-size: 14px !important;
-webkit-appearance: menulist !important;
background-color: #fff;
line-height: 1.42857143;
}
Result in Android 4.2.1:
Correct result: (with Bootstrap CSS classes)
Thank you for advance!
It might be caused by the important marks, as usually they mess with my CSS a bit. Try a more specific path to the CSS style:
#barraInbox div select.select-mod {
height: 30px;
font-size: 14px;
-webkit-appearance: menulist;
background-color: #fff;
line-height: 1.42857143;
}
It's hard to tell without knowing what they should look like. There might be a better way to do it. Could you link an image of how it should look?
select {
height:25px;
width:100%;
border: 1px solid grey;
-webkit-appearance: listbox;
background-image: url(data:image/png;base64,R0lGODlhDQAEAIAAAAAAAP8A/yH5BAEHAAEALAAAAAANAAQAAAILhA+hG5jMDpxvhgIAOw==); /* a simple arrow img */
background-repeat: no-repeat;
background-position: right center;
padding-right: 20px;
padding-left: 5px;
}
Please try this this will work for you.
I'm working on a mobile application and I have a fixed footer menu.
<div id='footer'>
<ul class='menu'>
<li>menu1</li>
<li>menu2</li>
</ul>
</div>
#footer { height:99px; background:url(../images/black2.png)repeat-x; border-top: 1px solid black; position:fixed;bottom:0;width:100%;}
.menu { max-width:640px; margin:auto; }
I tested it on an Android device. The problem is that when I change the device orientation the menu ul's margin:auto doesn't work until I click on another menu item.
Thank you!
I resolved this by changing CSS.
#footer { height:99px; background:url(../images/black2.png)repeat-x; border-top: 1px solid black; position:fixed;bottom:0;width:100%; text-align:center;}
.menu {width:100%; max-width:640px; display:inline-block; }
I would do something like this:
HTML
<div class="footer">
<ul>
<li>menu1</li>
<li>menu2</li>
</ul>
</div>
CSS
.footer { background: black; position: fixed; bottom: 0; width: 100%; text-align: center; }
.footer ul { color: white; width: 90%; margin: 0 auto; display: block; list-style: none; }
.footer ul li { padding: .25em; display: block; }
On top of that I'd tell you to checkout the "fixed-fixed" plugin from the Filament Group (that aids in mobile fixed positioning since all phones/ tablets don't support it):
https://github.com/filamentgroup/fixed-fixed
On top of top of that, I'd recommend their entire workflow for building for mobile:
https://github.com/filamentgroup/Southstreet/
I want to show the my webpage as ##TITLE## ##VALUE##
My Html is
<div>
<div style="padding:8px; border: 1px solid black; color:#006BF2; width: 90px;">##TITLE##</div>
<div style="padding:8px; border: 1px solid black; color:#000000; text-align:left; ">##VALUE##</div> </div>
Now it is shown as
##TITLE##
##VALUE##
I know only basics of html.How to do this?
Thanks
You have need to set float property for this.
one div should be float left and another should be right like below.
for first div set style => style="float: left; width: 50%;
for second div set style => style="float: right; width: 50%;
You have to set float: left style for your title and value columns.
Below them set new empty div with clear: both style.
<div>
<div style="float: left; padding:8px; border: 1px solid black; color:#006BF2; width: 90px;">##TITLE##</div>
<div style="float: left; padding:8px; border: 1px solid black; color:#000000; text-align:left; ">##VALUE##</div>
<div style="clear: both;"></div>
</div>