Solved

 

Posted on 2006-11-27
11
2,288 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Industry Leaders: 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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

717 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