Click here to Skip to main content
15,997,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI friends,
I'm developing android application, in my application I want to create 3 buttons for
1. Add task<br />
2. Delete Task<br />
3. Save Task


I'm making use of Div instead of buttons as following
<div id="actions" class="divActions topMargin">
            <div id="divAdd" class="button floatLeft">
                Add Task
            </div>
            <div id="divDelete" class="button floatLeft">
                Delete Task
            </div>
            <div id="divSave" class="button floatLeft">
                Save Tasks
            </div>
    </div>


I have Given following style
CSS
.divActions{height:5em;}
#divAdd, #divDelete, #divSave, #prev, #taskno, #next{width:32%;}
.button
{
    border: 1px solid #C7C7C7;
    height: 3em;
    background: #FCFCFC;
    vertical-align: middle;
    text-align: center;
    width: 10%;
    cursor: pointer;
    color: #2489CE;
}


My problem is it if working fine in some mobiles, but as resolution changes the 3 div are not in straight line one of the div goes in next line.

Can anyone give idea how the width of my 3 div can automatically takes the 1/3 of the screen width?

Thanks in advance
Posted

1 solution

Set a particular adjustable div width in percentage for your container div i.e:divActions

.divActions{height:5em;width:80%;}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900