Solved

button to the right

Posted on 2014-03-31
3
387 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Web Application Architecture 6 77
pay per click 3 157
502 - Web server received an invalid response 4 88
Windows Tool to Build Android and iOS App 3 74
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

776 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