Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

 

Posted on 2006-11-27
11
Medium Priority
?
2,320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

610 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