Solved

button to the right

Posted on 2014-03-31
3
385 Views
Last Modified: 2014-04-04
Hi,

I have a piece code but it is always displays to the left  and if i want to shift to the right how i can do

Thank you

<html>
<body>
 <FORM NAME="form1" METHOD="POST">
          <INPUT TYPE="BUTTON" VALUE="Button 1" ONCLICK="button1()">
            <INPUT TYPE="BUTTON" VALUE="Button 2" ONCLICK="button2()">
        </FORM>
</body>
</html>

Open in new window

0
Comment
Question by:roy_sanu
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Tej Pratap Shukla ~Dexter earned 200 total points
ID: 39968438
Hey there

Well always use css to define styling . In the code below i used inline css where i declared a class form1 and mentioned a style named float to right.

<html>
<head>
<style>
.form1
{
       float:right;}
</style>
</head>
<body>
 <FORM NAME="form1" METHOD="POST" class="form1">
          <INPUT TYPE="BUTTON" VALUE="Button 1" ONCLICK="button1()">
            <INPUT TYPE="BUTTON" VALUE="Button 2" ONCLICK="button2()">
        </FORM>
</body>
</html>


If you need to do further changes feel free to revert back
0
 

Author Comment

by:roy_sanu
ID: 39969713
Thank you again

One of my issue i have  three button.. I need to show,  let us say button1 to left ,button 2  and button 3  to the right corner...  How can this be done...
Do i need to use div  for  each button...
0
 
LVL 11

Assisted Solution

by:Tej Pratap Shukla ~Dexter
Tej Pratap Shukla ~Dexter earned 200 total points
ID: 39971249
Hey there

First of all there is absolutely no need to create separate divs.Simply just create two classes left align and right align .Inherit them to the buttons or the objects you want for example to left align button 1 call the left align class and vice-versa.Here's the code elaborating the concept further:

<html>
<head>
<style>
.ra
{
       float:right;}
       .la
       {
             float:left;}
</style>
</head>
<body>
 <FORM NAME="form1" METHOD="POST" class="form1">
          <INPUT TYPE="BUTTON" VALUE="Button 1" ONCLICK="button1()" class="la">
            <INPUT TYPE="BUTTON" VALUE="Button 2" ONCLICK="button2()" class="ra">
             <INPUT TYPE="BUTTON" VALUE="Button 2" ONCLICK="button2()" class="ra">
        </FORM>
</body>
</html>

Thanks
~Dex
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now