Solved

 

Posted on 2006-11-27
11
2,219 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

708 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

11 Experts available now in Live!

Get 1:1 Help Now