Solved

 

Posted on 2006-11-27
11
2,222 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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)

929 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

10 Experts available now in Live!

Get 1:1 Help Now