473,385 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Margins on buttons

Hi,

I am having problem styling my asp:buttons.
I am using a background image, or several actually depending on what
the button should do.
On the left hand side of the image there is a small icon, for example a
"Save-icon" if it is a save button. Just to the right of the icon the
text "Save" comes.

To prevent that the Save-text displays over the icon I have set the
left padding to 25 pixels and also set the text align to Left.

What I have found out is that the longer text a button has, the larger
padding it gets.
This occurs if I do not style my button at all, so it seems to be a
standard behaviour.

I can just look at the three buttons below when I write this, "Cancel",
"Preview" and "Post message". The margins on "Post message" much larger
than the other two.

I do NOT want set manually set "WITH" on my buttons since my
application is multi language and all texts on labels, buttons etc is
set dynamically. So I do not really know how wide the button should be.

So:
If I have a button with padding-left: 25px, and a long text, "Click
here to do something", this button would look really funny. It takes a
lot of unneccesary space on my pages.

Do you see my problem and can someone please help me??

/Joachim

Nov 19 '05 #1
3 1281
Joachim,

To get things just write I think you will want to specify an exact width
(even though you don't want to). If you're using .NET's built in
internationalization you may be able to store the various widths you need to
set as a parameter in the same file as each button's text. Then when you
retrieve the text retrieve the proper button width at the same time.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<jo***********@astrazeneca.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Hi,

I am having problem styling my asp:buttons.
I am using a background image, or several actually depending on what
the button should do.
On the left hand side of the image there is a small icon, for example a
"Save-icon" if it is a save button. Just to the right of the icon the
text "Save" comes.

To prevent that the Save-text displays over the icon I have set the
left padding to 25 pixels and also set the text align to Left.

What I have found out is that the longer text a button has, the larger
padding it gets.
This occurs if I do not style my button at all, so it seems to be a
standard behaviour.

I can just look at the three buttons below when I write this, "Cancel",
"Preview" and "Post message". The margins on "Post message" much larger
than the other two.

I do NOT want set manually set "WITH" on my buttons since my
application is multi language and all texts on labels, buttons etc is
set dynamically. So I do not really know how wide the button should be.

So:
If I have a button with padding-left: 25px, and a long text, "Click
here to do something", this button would look really funny. It takes a
lot of unneccesary space on my pages.

Do you see my problem and can someone please help me??

/Joachim

Nov 19 '05 #2
I usually just set all the buttons on a page to a certain width. 75px
or 100px, depending on the length of the longest one.

For what it's worth, I'd recommend actually using <input type="submit"
runat=server> instead of <asp:button> if you want any control over the
actual HTML that gets rendered. Saves you the frustration of twiddling
options in a third syntax, while trying to convince ASP.NET to spit out
the HTML you want.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #3
Thanks for your replies.

No, we do not use .Net´s built in internationalization. We are having
a textfile with all texts.

So I would have specify width then...Unfortunatally the application
becomes less dynamic.

But is´nt it strange that the margins increases the longer button text
you have? Wonder why...

/Joachim

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Frances Del Rio | last post by:
when I test my stuff with the validator in HomeSite it tells me the body tag no longer reads margin attributes.. does this mean now margins are to be specified only in CSS? I work for an...
33
by: Philip Herlihy | last post by:
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a visual clue to where you are. I thought I'd...
5
by: The Bicycling Guitarist | last post by:
Hello folks. I thought my home page was all fine and dandy, until I looked at it with Firefox in a smaller browser window. Instead of the central graphic dropping down below the text as in MSIE (a...
1
by: Maurice Mertens | last post by:
Hello, I'm trying to print a report to the printer but somehow it doesn't take the margins I set. I want the report to have a margin of 0.7 cm (397 twips), so in code I use the following: ...
8
by: Tinus | last post by:
Hello all, Because you have been so helpfull the last couple of times, I thought after testing and wasting more than 20 pages (and google-ling for 3 days :-( ). I would ask you again for your...
7
by: tm | last post by:
I am trying to print a form using the following code, everything works fine but the margins are not acted upon. What I am I doing wrong? Private Sub CaptureScreen() Dim myGraphics As...
0
by: Todd | last post by:
Hi guys, Strange bug if someone could help. ... Im using printDialog, printDocument and printPreviewDialog to write my print routines for a graphics application. I want to allow the user to...
7
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
10
by: Hendrik Maryns | last post by:
Hi, Once again I’d like some feedback on the site http://www.weltladen-tuebingen.de. The situation is the following: I, as a real computer freak, have a Big Screen. The lady who is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.