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

CSS Button fail

Trying to make some CSS buttons, but they fall apart in Firefox and
IE.

The first set of buttons work fine in IE, but in Firefox they double
in size when mouseover.

The second set is too wide in both IE and Firefox compare to 1st set
of buttons. In Firefox, the button becomes an insert opposite to IE
and will not jump to the link page like it does in IE.

How do I get set one to work correctly for both browsers?

How do I reduce the excess space in set 2 and they are the same width?

What ever happens on this page will become a template for about 30
other pages.

I will be using a <link rel="STYLESHEET" type="text/css" href="../../
css/button.css"in place of the code that is shown on this page now.

On another note, I am updating my sight after 6 years as well not
looking at it and I am finding things that work back in 2000
correctly, but are breaking down now.

I am using class="num" in <pto centre items on the page that is
call .num {text-align:center;}. Since they fail to work, I have try
style="text-align:center" with no luck in Firefox. When I did the
testing for IE, Netscape and Opera back in 2000, everyone work
correctly then.

Why am I having this problem now with Firefox of all things?

The other thing I have notice, IE is blocking a <script type="text/
javascript" src="../../js/update.js"></scriptthat is calling the
current date view as well another telling when the page was updated.
Any reason why IE would block this script as a popup when it is not a
popup in the first place as I want it to be shown like it is on
Firefox?

The test page can be view at davidfisher.biz/oakville.html

I write strict xhtml.
Thanks

Mar 16 '07 #1
7 2459
drum118 wrote:
Trying to make some CSS buttons, but they fall apart in Firefox and
IE.
But how do they look in the *important* browsers? :-)
>
The test page can be view at davidfisher.biz/oakville.html
I had trouble with your URL, and not just because it wasn't a URL.
I edited your string into my browser's address bar, but it seems that
that page is not on the server.

I then went to http://www.davidfisher.biz/, which was a big mistake,
because it's filled with 16 images, each around 2MB. (Hint: make true
thumbnails for a page like this.) I couldn't find a link to anything
"Oakville"-looking on the index page, nor did I see any CSS buttons. In
fact, I didn't find any CSS at all.

Sorry I can't help you.

--
John
Mar 16 '07 #2
John Hosking schrieb:
drum118 wrote:
>The test page can be view at davidfisher.biz/oakville.html

I had trouble with your URL, and not just because it wasn't a URL.
It _is_ a URL, a relative one. But what is the base to resolve it?
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Mar 16 '07 #3
On Mar 16, 4:36 am, Johannes Koch <k...@w3development.dewrote:
John Hosking schrieb:
drum118 wrote:
The test page can be view at davidfisher.biz/oakville.html
I had trouble with your URL, and not just because it wasn't a URL.

It _is_ a URL, a relative one. But what is the base to resolve it?
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Try the link now.

Mar 16 '07 #4
drum118 wrote:
>
Try the link now.
Link? What link was that, exactly?

Ah, just being rude, no problem, I'll supply it for you and others:
http://davidfisher.biz/oakville.html.

Having arrived at an actual page with buttons, I note the following:

The buttons fail to exhibit the size-doubling problem you claimed in
your OP. I do notice when comparing IE6 to FF1.0.7 that the buttons in
IE are "squarer", because the texts are wrapped. But the font size looks
the same to me. FF is certainly not twice the size, even on hover. Tried
with JavaScript on and off.

Your code does not validate. Until that happens, all bets are off.

Among the errors are duplicate uses of id="mybutton". I don't see why
this would affect text size in the buttons, though.

Your embedded CSS doesn't validate, but I don't expect the errors to
have anything to do with the problems you mentioned.

All 3 of your external CSS files are missing. Are they the ones causing
the doubling problem you're seeing? If so, we'd need them too. ;-)

You've got a bunch of unused (hence irrelevant) styles in your CSS and
code in your XHTML. Since this is obviously a simplified test case, why
not simplify it completely?

If you don't like the widths of the lower button set, why not set widths
on them? Like input {text-align: center; width:8em;} or something?
Beware: I am thinking that there is some problem with setting widths on
<inputelements (not from my own experience, but because of things I
think I've seen in NGs like this one). Try googling, and/or making tests
of just applying width styles to <input>s. That being said, it worked on
my FF.

The buttontext and buttonover styles' text colors are both different
from the default. So the top buttons' texts go from black (or something)
when your page loads to yellow while I hover to white when I move away.

And lastly, this is a completely unrelated item, but maybe it'll help
you (sometime). It's just about markup. Try starting your page's code with

<body>
<div style="text-align:center;">
<h1 style="position:absolute; top:5px; width:99%; font-size:3.3em;
font-weight:bold; color:silver;">Oakville Transit</h1>
<h1 style="position:absolute; top:0px; width:99%; font-size:3.3em;
font-weight:bold;">Oakville Transit</h1>
</div>

<p style="text-align: center; margin-top:11em;">

An <h1makes more sense than some DIV, and empty paragraphs for spacing
are nasty. You're using CSS already; so *use* it! :-) (Of course, all
these in-line styles could be embedded or external instead, and your
markup would be cleaner. But I guess you're still fiddling with test
pages. Yes?)

Summary of main points: Simplify (weed out) XHTML and CSS (and JS),
validate both, and try again.

HTH
--
John
Mar 17 '07 #5
On Mar 16, 9:48 pm, John Hosking <J...@DELETE.Hosking.name.INVALID>
wrote:
drum118 wrote:
Try the link now.

Link? What link was that, exactly?

Ah, just being rude, no problem, I'll supply it for you and others:http://davidfisher.biz/oakville.html.

Having arrived at an actual page with buttons, I note the following:

The buttons fail to exhibit the size-doubling problem you claimed in
your OP. I do notice when comparing IE6 to FF1.0.7 that the buttons in
IE are "squarer", because the texts are wrapped. But the font size looks
the same to me. FF is certainly not twice the size, even on hover. Tried
with JavaScript on and off.

Your code does not validate. Until that happens, all bets are off.

Among the errors are duplicate uses of id="mybutton". I don't see why
this would affect text size in the buttons, though.

Your embedded CSS doesn't validate, but I don't expect the errors to
have anything to do with the problems you mentioned.

All 3 of your external CSS files are missing. Are they the ones causing
the doubling problem you're seeing? If so, we'd need them too. ;-)

You've got a bunch of unused (hence irrelevant) styles in your CSS and
code in your XHTML. Since this is obviously a simplified test case, why
not simplify it completely?

If you don't like the widths of the lower button set, why not set widths
on them? Like input {text-align: center; width:8em;} or something?
Beware: I am thinking that there is some problem with setting widths on
<inputelements (not from my own experience, but because of things I
think I've seen in NGs like this one). Try googling, and/or making tests
of just applying width styles to <input>s. That being said, it worked on
my FF.

The buttontext and buttonover styles' text colors are both different
from the default. So the top buttons' texts go from black (or something)
when your page loads to yellow while I hover to white when I move away.

And lastly, this is a completely unrelated item, but maybe it'll help
you (sometime). It's just about markup. Try starting your page's code with

<body>
<div style="text-align:center;">
<h1 style="position:absolute; top:5px; width:99%; font-size:3.3em;
font-weight:bold; color:silver;">Oakville Transit</h1>
<h1 style="position:absolute; top:0px; width:99%; font-size:3.3em;
font-weight:bold;">Oakville Transit</h1>
</div>

<p style="text-align: center; margin-top:11em;">

An <h1makes more sense than some DIV, and empty paragraphs for spacing
are nasty. You're using CSS already; so *use* it! :-) (Of course, all
these in-line styles could be embedded or external instead, and your
markup would be cleaner. But I guess you're still fiddling with test
pages. Yes?)

Summary of main points: Simplify (weed out) XHTML and CSS (and JS),
validate both, and try again.

HTH
--
John
Thanks for the feed back.

The codes for the buttons are out of a book.

I have removed all the CSS not related to the buttons as well the 3
links.

I forgot to add the code for the 2nd style button and is on the page
now.

The width is set for the 2nd button as requested, but does not work in
FF.

The first button in IE should be like FF.

One button is right in each browsers, but not the other and that is
the problem as they should be the same.

There is no JS code for the buttons.

Mar 17 '07 #6
drum118 wrote:
On Mar 16, 9:48 pm, John Hosking <J...@DELETE.Hosking.name.INVALID>
wrote:
>>http://davidfisher.biz/oakville.html.

The buttons fail to exhibit the size-doubling problem you claimed in
your OP.
Still no doubling for me.
>>Your code does not validate. Until that happens, all bets are off.
You apparently didn't read this the first time.
Visit http://validator.w3.org/
>>Since this is obviously a simplified test case, why
not simplify it completely?
>>
Summary of main points: Simplify (weed out) XHTML and CSS (and JS),
validate both, and try again.
>
Thanks for the feed back.
You're welcome.
>
I forgot to add the code for the 2nd style button and is on the page
now.
That'll have an effect... ;-)
The width is set for the 2nd button as requested, but does not work in
FF.
Ah, well, .Button is not the same as .button. The case in your CSS has
to match the case in your XHTML.
>
The first button in IE should be like FF.
Although they are two different browsers (and you are feeding them
invalid XHTML)? I do not know why IE breaks the text while FF does not.
>
One button is right in each browsers, but not the other and that is
the problem as they should be the same.

There is no JS code for the buttons.
Then get it out of the sample page you're providing and "testing" with.

--
John
Mar 17 '07 #7
drum118 wrote:
>>
http://davidfisher.biz/oakville.html.

There is no JS code for the buttons.
You are mistaken.

<span ID="mybutton"
onMouseOver="this.className='buttonover';"
onMouseOut="this.className='buttontext';">

Mouse events are only done through JavaScript. When JS is disabled,
nothing happens. Use :hover instead.

--
Berg
Mar 17 '07 #8

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

Similar topics

1
by: java | last post by:
Is there a way to repaint an AWT Button while it is not pressed. I am trying to implement a custom behaviour for a Button. I implement a mouse listener and I want to repaint the button when I click...
6
by: Dennis Allen | last post by:
Hi. On one particular web page I want to offer the user a print button. Question. How do I create one? Something compatible with most browsers would be nice. Appreciate any advice...Dennis
3
by: RickDee | last post by:
Pls help. What I am trying to do is to change the text of the MessageBox. For example, when we use : MessageBox.Show("Pass or Fail ?", "Dialog Title", MessageBoxButtons.YesNo); Then we will...
3
by: Jeff | last post by:
I need to intercept the Click event of a asp:Button on the client side so that i can disable it after they've clicked it... HOW can i do this?? I was thinking of making the button an HTML button...
8
by: Lee | last post by:
Hi,I'm trying to have a button that fires a click event only once. What is the best way to do so that after the first button click, any the following clicks will be ignored.
26
by: Jeremy | last post by:
Hi, say we have the code below on a button: <input type="button" class="btn" value="Continue" onclick="if (myform.p_name.value=='') alert('You must enter a name for the folder'); else {...
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
12
blyxx86
by: blyxx86 | last post by:
Alright, I understand how to make a query/report/etc display a text value based on what number the other column has in it.. (IIF(,"Pass","Fail") But.. this can be a hamper on any query and I am...
6
by: Marc | last post by:
Hi, I am using the below code which simply allows a single button control to be dragged and dropped anywhere around a form. My problem is that want to move about 100 buttons on the form. Is...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.