Solved

 

Posted on 2006-11-27
11
2,223 Views
Last Modified: 2012-06-27
hi experts

This is  my code in html

 <div align="center">
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="button" value="submit"/>
</div>

In the above code is there any way i can replace all those "&nbsp;" with a single sign or character.
thanks
J
0
Comment
Question by:jaggernat
  • 5
  • 3
  • 3
11 Comments
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18019450
Are you just trying to make that button be farther over to the right?

How about...


<div style="text-align: center;">
    <input type="button" value="submit" style="margin-left: 15em;" />
</div>

... or some other margin-left that might work better?

For that matter, setting text-align: center;  when the <div> has no particular width is a little odd in itself.
0
 
LVL 12

Expert Comment

by:enachemc
ID: 18019453
yeah ... just use a transparent gif inside an <img> tag, for which you specify the widht desired.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18019455
Alternatively...

<div style="padding-left: 15em;">
    <input type="button" value="submit" />
</div>
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 10

Author Comment

by:jaggernat
ID: 18019518
thanks
this is my actual code
++++++++++++++
             <div align="center">
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:button  property="" styleClass="button" onclick="submitmeAction('editcart');" value="Edit Cart" style="margin-left: 15em;"/>&nbsp;
      <html:button  property="" styleClass="button" onclick="submitmeAction('continueshopping');" value="Continue Shopping" style="margin-left: 25em;"/>&nbsp;
      </div>
+++++++++++++
I want to move both buttons to the right one after the other

thanks
J
0
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 250 total points
ID: 18019597
By "one after the other" I assume you mean...

                   [ Button ] [ Button ]

.. and not
                   [ Button ]
                   [ Button ]


For the former...

<div style="text-align: center; padding-left: 15em;">
    <html:button  property="" styleClass="button" onclick="submitmeAction('editcart');" value="Edit Cart" />
    <html:button  property="" styleClass="button" onclick="submitmeAction('continueshopping');" value="Continue Shopping" style="margin-left: 1em;" />
</div>

... will work fine.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18019611
Basically wherever you want space, add margin or padding around that element.  You should almost never have to explicitly code spacing into HTML.  (There are still some places that a <br /> tag is appropriate, but I think I've used about three <br /> tags total in the last, say, five months.  The stylesheet, or inline styles in this case, can almost always describe the spacing you want.)
0
 
LVL 12

Expert Comment

by:enachemc
ID: 18019632
<table width="100%">
      <tr>
            <td align="right">
                  <input type="submit" value="button1" />
                  <input type="submit" value="button2" />
            </td>
      </tr>
</table>
0
 
LVL 12

Expert Comment

by:enachemc
ID: 18019640
the above code will always allign to the right. If you use padding or spacing by fixed amounts, you will be affected by resizes of the window.
0
 
LVL 10

Author Comment

by:jaggernat
ID: 18019825
works perfect Votey!

thanks
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18019890
That's true, my code won't actually right-align, it will just push over to the right.  You can use...

<div style="width: 100%; text-align: right;">
               <input type="submit" value="button1" />
               <input type="submit" value="button2" />
</div>

... to actually align the buttons to the right.

Or, if you prefer,
               <input type="submit" value="button2" style="float: right;" />
               <input type="submit" value="button1" style="float: right;" />



Fight the urge to fall back on table layouts with everything you've got!  (-:
0
 
LVL 10

Author Comment

by:jaggernat
ID: 18020167
let it be the way it is. its working and i dont want to touch it :) :)

thanks
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

773 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