473,779 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2474
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...@w3develop ment.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
<inputelement s (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;">O akville 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.Ho sking.name.INVA LID>
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
<inputelement s (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;">O akville 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.Ho sking.name.INVA LID>
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="th is.className='b uttonover';"
onMouseOut="thi s.className='bu ttontext';">

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
2306
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 the right mouse button. I have tried all methods sych as paint, repaint, update but they all seem to fail. The button is repainted only when I press it, (when I press the left mouse button). Thaks in advance Tilemachos
6
2907
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
26102
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 have the Yes and No button for user to press. Now how can I have the enum struct option where I can put MessageBoxButtons.PassFail which will display Pass and Fail buttons on the message box ? Is ther anyway to do
3
2524
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 and handling the __doPostback myself... BUT, my page does have some asp:Validator controls on it, so I don't know how to mimic the logic for calling the validation functions properly. Is there ANY way i can make the asp:Button call some of MY...
8
5445
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
21299
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 { this.disabled=true; submit();}"> Not all the validation can be performed client-side so the button may be pressed and then server validation is performed - this may result in a request to the user to hit the back button and correct some data entered.
23
14523
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 the visitors will retype it all so i'm asking: "how to preserve POST-data when clicking the back-button?" i've already tried to print post data as a value in a HTML tag but
12
18193
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 told should not be used unless absolutely necessary. I would like to set up a radio button to input a text value into a table instead of a number. Perhaps it can be done with VB.. I have no idea how to actually write the code, but I'm...
6
1639
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 there anyway to modify the code so that any buttons added on the form will be able to be dragged and dropped? Many Thanks!
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.