473,320 Members | 1,948 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,320 software developers and data experts.

button default style

I was hoping to style a link to look like a button using css. I thought I
might be able to use something like display:button, but it appears this
doesn't exist in the css 2.1 spec. I then looked at Appendix D to see how it
is suggested it would be styled, and found just

button, textarea,
input, select { display: inline-block }

I take it that the button-like look of buttons is therefore meant to be part
of the content, and can't be applied to something else (which I suppose
could make sense, with it being a form control).

So, is there any other way of making a link look like a button, with all the
details (such as text vertically and horizontally centred, text moves
slightly when click, two borders when being pressed on)?

In case you are wondering what the application is, it is intended to have a
"button" that takes you to another page, without using javascript. (It is
made using asp.net, so if this doesn't work I have an option to post back
the form and get it to redirect the page, but that seems a bit OTT for
changing pages, so it would be nice to just have a css solution.)

Thanks,
Martin
Jun 6 '06 #1
5 15888
"Martin Eyles" <ma**********@NOSPAMbytronic.com> wrote in message
news:12*************@corp.supernews.com...
I was hoping to style a link to look like a button using css. I thought I
might be able to use something like display:button, but it appears this
doesn't exist in the css 2.1 spec. I then looked at Appendix D to see how
it is suggested it would be styled, and found just

button, textarea,
input, select { display: inline-block }

I take it that the button-like look of buttons is therefore meant to be
part of the content, and can't be applied to something else (which I
suppose could make sense, with it being a form control).

So, is there any other way of making a link look like a button, with all
the details (such as text vertically and horizontally centred, text moves
slightly when click, two borders when being pressed on)?

In case you are wondering what the application is, it is intended to have
a "button" that takes you to another page, without using javascript. (It
is made using asp.net, so if this doesn't work I have an option to post
back the form and get it to redirect the page, but that seems a bit OTT
for changing pages, so it would be nice to just have a css solution.)

Thanks,
Martin


Actually, figure most of the styling out with inset/outset borders, but
still no idea when it comes to vertically centering the text. Also, I can't
seem to size it when styled as inline-block - this only seems to work when
styled as block.

Any Ideas?

Thanks,
Martin
Jun 6 '06 #2
Martin Eyles wrote:
I was hoping to style a link to look like a button using css.


For what it is worth, take a look at
http://lingo.uib.no/v5/buttontest.html where I made an attempt to apply
the inset reverse (3d) effect on links.

That probably didn't answer your question, but might be interesting
nonetheless.

- Daniel
Jun 6 '06 #3
On Tue, 06 Jun 2006 13:49:06 +0200, Martin Eyles
<ma**********@NOSPAMbytronic.com> wrote:
I was hoping to style a link to look like a button using css.

In case you are wondering what the application is, it is intended to
have a
"button" that takes you to another page, without using javascript.


Isn't that just what hyperlinks do? Take you to another page without using
javascript? What's the point in making a link look like a button while
still behaving like a link? You'll only confuse your visitors, who expect
links for going to different pages, and buttons to submit forms.

--
Garmt de Vries
Jun 7 '06 #4
"Garmt de Vries" <ga**********@googlemail.com> wrote in message
news:op.tartpxaajsw2os@nautilus...
On Tue, 06 Jun 2006 13:49:06 +0200, Martin Eyles
<ma**********@NOSPAMbytronic.com> wrote:
I was hoping to style a link to look like a button using css.

In case you are wondering what the application is, it is intended to
have a "button" that takes you to another page, without using
javascript.


Isn't that just what hyperlinks do? Take you to another page without using
javascript? What's the point in making a link look like a button while
still behaving like a link? You'll only confuse your visitors, who expect
links for going to different pages, and buttons to submit forms.


I have a closed user base for this program, which is used to using buttons
at the bottom of the screen to change between a number of screens on a
software system. I am now creating a version of the program which they can
access from the internet, and so in this case it is best to keep the same
look to the user interface. The reason I am trying to avoid javascript on
the "main menu", is because they will be using the system on some PCs which
we have less control over, and where the system administrators will have
added extra security. Therefore, I want to use javascript only when plain
HTML/CSS won't do.
Jun 7 '06 #5
Martin,

Were you ever able to get your links to look like a button using css? I am trying to do something similar for an existing site I am maintaining. They want a button added to a line of existing buttons at the top of the page, but the button text is long and needs to be wrapped to fit on the existing line w/o causing vertical scrollbars in the browser.

I've been unable to find a way to insert a line break in the button text and they don't want me to abbreviate the text, so was thinking I would turn the buttons into links and use css to make them look like standard html buttons so they don't appear different from other buttons.

If you got yours working, would you mind sharing your css code?

Thanks,

Carol
Jun 29 '06 #6

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

Similar topics

1
by: Philip | last post by:
Hey, Is it possible to get the default value of an element's style.backgroundColor property that's set in a css class? Example, since I'm very tired and can't word that any better ;) ...
1
by: Paul Gobée | last post by:
What is the parent element of a button (IE6 on Win, transitional mode)? Is it the BODY, the browser default stylesheet, or something else? Contra "body is parent-element": - Buttons with no...
6
by: Marek Mänd | last post by:
Can the <button><img></button> mutated via CSS so, that the inner image of <BUTTON> would entirely visually become the button itsself - I mean without the outer elements borders and so... ...
1
by: Steffen Loringer | last post by:
Hi NG, how can I write text on my asp.net buttons in windows style? For example: 'File' but with an underlined 'F'. Thanks a lot Steffen
2
by: Kurt Schroeder | last post by:
Is there a way to set the default style for all textboxes on a page, and a different one for all labels? Like the way the body style controls all body text. 1. given: I have a style called .smlbl...
5
by: Agnes | last post by:
i saw some .net demo, there is a property for the button or check box called "visualstyle" (something like that) In my.net 2000 , there is not such property. Does it belongs to 2005 ?? thanks
3
by: Rick Brandt | last post by:
I am using some buttons to hide/show various divs and am changing the style of the button to indicate which button's view is "active". My problem is that for the non-active buttons I want the...
4
by: Duncan Jones | last post by:
I'm almost certain there is no easy answer to this question, but I'd thought I'd just check.... *Ignoring* for a second why I want to do this, is there any way to specify that an element in a...
0
ThatThatGuy
by: ThatThatGuy | last post by:
This tutorial is intended to enlighten the power of XAML to build rich applications for Windows(WPF), Web(Silverlight) & Browser(XBAP). I will explain to you about building attractiveFading Glow...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.