Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > <button> tag

Reply
Thread Tools

<button> tag

 
 
Tree*Rat
Guest
Posts: n/a
 
      04-07-2005
Two things.

First is it ok to use the <button> tag? i understand that IE4+ and
netscape5+ support this. WHat about other browsers?


Question two.
-------------

I currently use CSS ( as i recon most done now ) but i am unsure on
how to set atributes in the CSS file for the BUTTON tag. I need to make it
transparent. Any ideas?
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      04-07-2005
On Thu, 07 Apr 2005 17:33:12 GMT, "Tree*Rat" <no->
wrote:

>First is it ok to use the <button> tag?


It it kosher HTML ?
http://www.w3.org/TR/html4/interact/...ml#edef-BUTTON

So that looks like a yes. The spec is there and free for you to use -
use it.

>i understand that IE4+ and
>netscape5+ support this. WHat about other browsers?


Somewhere there'll be _something_ that can't work with it.

As a general rule for the paranoid though, duplicate the id attribute
of form controls into their name attribute. An old browser (in living
memory) may work with button and name, but not with id.

>I currently use CSS ( as i recon most done now ) but i am unsure on
>how to set atributes in the CSS file for the BUTTON tag.


Same way you do with anything.

For <button>, I'd suggest adding a class to the button and using that
as a selector, rather than making some global CSS rule apply to all
buttons (for some settings this may be OK, but it's common to want
different stylings on them).

>I need to make it
>transparent. Any ideas?


Don't ? The notion of a transparent buttons sounds horrible - are you
going to be relying on it getting accurately placed to hint where to
click ?

If you simply want to remove the borders and "button like" appearance,
then try this (assumes CSS rendering of buttons, not some
platform-local rendering):

button.btnFoo {
border: none;
background-color: transparent;
}

 
Reply With Quote
 
 
 
 
Tree*Rat
Guest
Posts: n/a
 
      04-07-2005
Andy Dingley <> wrote in
news::

> On Thu, 07 Apr 2005 17:33:12 GMT, "Tree*Rat" <no->
> wrote:
>
>>First is it ok to use the <button> tag?

>
> It it kosher HTML ?
> http://www.w3.org/TR/html4/interact/...ml#edef-BUTTON
>
> So that looks like a yes. The spec is there and free for you to use -
> use it.
>
>>i understand that IE4+ and
>>netscape5+ support this. WHat about other browsers?

>
> Somewhere there'll be _something_ that can't work with it.
>
> As a general rule for the paranoid though, duplicate the id attribute
> of form controls into their name attribute. An old browser (in living
> memory) may work with button and name, but not with id.
>
>>I currently use CSS ( as i recon most done now ) but i am unsure on
>>how to set atributes in the CSS file for the BUTTON tag.

>
> Same way you do with anything.
>
> For <button>, I'd suggest adding a class to the button and using that
> as a selector, rather than making some global CSS rule apply to all
> buttons (for some settings this may be OK, but it's common to want
> different stylings on them).
>
>>I need to make it
>>transparent. Any ideas?

>
> Don't ? The notion of a transparent buttons sounds horrible - are you
> going to be relying on it getting accurately placed to hint where to
> click ?
>
> If you simply want to remove the borders and "button like" appearance,
> then try this (assumes CSS rendering of buttons, not some
> platform-local rendering):
>
> button.btnFoo {
> border: none;
> background-color: transparent;
> }
>
>


Thanks for that. Just to update you a bit The reason i need the button
transparent is its being replaced by an image. The reason for this is i
need to use form elemnts to pass hidden variable and not send them via a
url. As the site is theme based ( via different css files ) the button
does need to be the same as the background colour ( or transparent ) to
hid the fact its a button, sounds daft but looks better.

thanks for your help
 
Reply With Quote
 
Tree*Rat
Guest
Posts: n/a
 
      04-07-2005
"Tree*Rat" <no-> wrote in news:zSf5e.14967$vv2.13710
@newsfe2-gui.ntli.net:

> Andy Dingley <> wrote in
> news::
>
>> On Thu, 07 Apr 2005 17:33:12 GMT, "Tree*Rat" <no->
>> wrote:
>>
>>>First is it ok to use the <button> tag?

>>
>> It it kosher HTML ?
>> http://www.w3.org/TR/html4/interact/...ml#edef-BUTTON
>>
>> So that looks like a yes. The spec is there and free for you to use -
>> use it.
>>
>>>i understand that IE4+ and
>>>netscape5+ support this. WHat about other browsers?

>>
>> Somewhere there'll be _something_ that can't work with it.
>>
>> As a general rule for the paranoid though, duplicate the id attribute
>> of form controls into their name attribute. An old browser (in living
>> memory) may work with button and name, but not with id.
>>
>>>I currently use CSS ( as i recon most done now ) but i am unsure on
>>>how to set atributes in the CSS file for the BUTTON tag.

>>
>> Same way you do with anything.
>>
>> For <button>, I'd suggest adding a class to the button and using that
>> as a selector, rather than making some global CSS rule apply to all
>> buttons (for some settings this may be OK, but it's common to want
>> different stylings on them).
>>
>>>I need to make it
>>>transparent. Any ideas?

>>
>> Don't ? The notion of a transparent buttons sounds horrible - are you
>> going to be relying on it getting accurately placed to hint where to
>> click ?
>>
>> If you simply want to remove the borders and "button like" appearance,
>> then try this (assumes CSS rendering of buttons, not some
>> platform-local rendering):
>>
>> button.btnFoo {
>> border: none;
>> background-color: transparent;
>> }
>>
>>

>
> Thanks for that. Just to update you a bit The reason i need the button
> transparent is its being replaced by an image. The reason for this is i
> need to use form elemnts to pass hidden variable and not send them via

a
> url. As the site is theme based ( via different css files ) the button
> does need to be the same as the background colour ( or transparent ) to
> hid the fact its a button, sounds daft but looks better.
>
> thanks for your help
>


ok hit a problem

button.main {
background-color: #770000;
border : none;
}

the border has gone but the background color is not red? it hasnt change
at all. Why is this?
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-07-2005
"Tree*Rat" <no-> wrote:

> Thanks for that.


You fullquoted a message. This usually means you didn't really read it.

> Just to update you a bit The reason i need the
> button transparent is its being replaced by an image. The reason
> for this is i need to use form elemnts to pass hidden variable and
> not send them via a url. As the site is theme based ( via different
> css files ) the button does need to be the same as the background
> colour ( or transparent ) to hid the fact its a button, sounds daft
> but looks better.


That makes little sense without a URL. It sounds like you are trying to
create an unreliable imitation of hidden fields.

It's unknown what you want to do. So guessing on answers is rather
pointless. But if you wish hide a button from looking like a button,
then you seem to want to create problems, not solve them.

The only sure thing is that <button> is a problem, not a solution.

Please do not fix your forged From field unless you get a clue.
Thank you in advance.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      04-07-2005
On Thu, 07 Apr 2005 19:51:28 GMT, "Tree*Rat" <no->
wrote:

>the border has gone but the background color is not red?


Mine is red - I even tested it !

<button name="Woof" id="Woof" class="main" value="Bark"
>Donkey</button>



>Why is this?


No idea. We can't debug fragments if we can't see the HTML too.
 
Reply With Quote
 
Mitja
Guest
Posts: n/a
 
      04-07-2005
>>>> I need to make it
>>>> transparent. Any ideas?
>>> background-color: transparent;

>> Thanks for that. Just to update you a bit The reason i need the button
>> transparent is its being replaced by an image.


Are you sure it's not <input type="image" src="..."> you want?

> ok hit a problem
> background-color: #770000;
> the border has gone but the background color is not red? it hasnt change
> at all. Why is this?

Quite a few browsers don't support styling of form elements or provide
limited support. Intentionally, of course - to make it evident where and
what the form elements are at all.
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      04-08-2005
On Thu, 07 Apr 2005 19:29:35 GMT, "Tree*Rat" <no->
wrote:

>Thanks for that. Just to update you a bit The reason i need the button
>transparent is its being replaced by an image.


Then use CSS to set background-image

>The reason for this is i
>need to use form elemnts to pass hidden variable and not send them via a
>url.


Then use <input type="hidden" > rather than <button>

>As the site is theme based ( via different css files ) the button
>does need to be the same as the background colour


If it's "theme based", then let the CSS theme set it.

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      04-09-2005
Tree*Rat wrote:

> First is it ok to use the <button> tag? i understand that IE4+ and
> netscape5+ support this. WHat about other browsers?


Internet Explorer's support of BUTTON is *very* buggy. Better to stick to
INPUT.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Csaba Gabor
Guest
Posts: n/a
 
      04-09-2005
Toby Inkster wrote:
> Internet Explorer's support of BUTTON is *very* buggy. Better to stick to
> INPUT.


That's interesting. I'd never noticed that IE's BUTTON support is buggy.
In what way? The reason I like BUTTON is that I can underline the
relevant character if it has accessKey set.

Csaba Gabor from Vienna
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
To vlan tag or not to tag? budyerr Cisco 1 07-08-2004 03:45 AM
using param or out tag inside sql tag (jsp/jstl/tomcat) shahbaz Java 0 10-27-2003 02:46 AM
struts tag inside a tag kishan bisht Java 1 07-08-2003 11:04 PM
How to embed the <jsp:plugin> tag into a tag handler class...HELP !! jstack Java 1 07-04-2003 06:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57