472,965 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

another attempt at HTML/CSS buttons

Here is another attempt at making some HTML/CSS (e.g. not image) buttons.
Because I've managed to avoid the things that tend to be problems, it has
mostly worked. I also went back to doing tables in HTML just for IE. So
I'd like to know if this works in IE.

It would be nice if I could get the letters to move up further so they are
positioned where the top edge of the letters is lined up with the top edge
of the numbers.

Be sure to click on the buttons.

http://phil.ipal.org/usenet/ciwas/20...e-buttons.html

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
May 10 '06 #1
6 1406
ph**************@ipal.net wrote:
Here is another attempt at making some HTML/CSS (e.g. not image) buttons.
Because I've managed to avoid the things that tend to be problems, it has
mostly worked. I also went back to doing tables in HTML just for IE. So
I'd like to know if this works in IE.
No, of course not. IE only applies :hover to the <a> element.
IE ignores "border-spacing" so a "cellspacing" is required on the table.
It would be nice if I could get the letters to move up further so they are
positioned where the top edge of the letters is lined up with the top edge
of the numbers.

CSS:
..button_back,
..button_front,
..button_label { width: 4em; }
..button_label {
height: 100%;
background-color: #777799;
color: #f7f7f7;
text-align: right;
white-space: nowrap;
}
..button_label span { font-size: 200%; }
..button_label sup { font-size: 80%; vertical-align: 100%; }

HTML: (Delete the <font> tags)
<div class="button_label"><sup>ABC</sup> <span>2</span></div>

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
May 10 '06 #2
On Wed, 10 May 2006 12:17:28 -0700 Jim Moe <jm***************@sohnen-moe.com> wrote:

| ph**************@ipal.net wrote:
|> Here is another attempt at making some HTML/CSS (e.g. not image) buttons.
|> Because I've managed to avoid the things that tend to be problems, it has
|> mostly worked. I also went back to doing tables in HTML just for IE. So
|> I'd like to know if this works in IE.
|>
| No, of course not. IE only applies :hover to the <a> element.
| IE ignores "border-spacing" so a "cellspacing" is required on the table.

So basically I really have to decide between going with web standards, or
making things work reasonably well on what is still the most common browser.
At least I can use more CSS since the basics of CSS work. But I still have
to use a lot of HTML that I should otherwise not need to use.
|> It would be nice if I could get the letters to move up further so they are
|> positioned where the top edge of the letters is lined up with the top edge
|> of the numbers.
|>
| CSS:
| .button_back,
| .button_front,
| .button_label { width: 4em; }
| .button_label {
| height: 100%;
| background-color: #777799;
| color: #f7f7f7;
| text-align: right;
| white-space: nowrap;
| }
| .button_label span { font-size: 200%; }
| .button_label sup { font-size: 80%; vertical-align: 100%; }
|
| HTML: (Delete the <font> tags)
| <div class="button_label"><sup>ABC</sup> <span>2</span></div>

The letters went higher than the numbers. Some other combination (floats)
ended up with the same thing. The top of the box for each letter is now at
the top of the container box. But since there is more space above the
numbers because they are larger, they end up being lower.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
May 11 '06 #3
ph**************@ipal.net wrote:
|> I also went back to doing tables in HTML just for IE. So
|> I'd like to know if this works in IE.
|>
| No, of course not. IE only applies :hover to the <a> element.
| IE ignores "border-spacing" so a "cellspacing" is required on the table.

So basically I really have to decide between going with web standards, or
making things work reasonably well on what is still the most common browser.
At least I can use more CSS since the basics of CSS work. But I still have
to use a lot of HTML that I should otherwise not need to use.
Not so much, really. Stick mostly to CSS v1, you'll do okay. In 3 - 5
years, when IE6 becomes irrelevant, you can start using CSS2 extensively.
By then CSS3 will be a standard and we'll only have to wait another 7
years for MS to catch up.
|> It would be nice if I could get the letters to move up further so they are
|> positioned where the top edge of the letters is lined up with the top edge
|> of the numbers.
|> [Code deleted]
The letters went higher than the numbers. Some other combination (floats)
ended up with the same thing. The top of the box for each letter is now at
the top of the container box. But since there is more space above the
numbers because they are larger, they end up being lower.

I cannot tell if you tried the code I listed. What would floating
achieve for vertical position?
It depends on the font. With one font the letters were below the
numbers. Other fonts the letters were above. In one font where there are
lowercase numbers, the letters were both above and below.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
May 11 '06 #4
On Thu, 11 May 2006 00:44:15 -0700 Jim Moe <jm***************@sohnen-moe.com> wrote:
| ph**************@ipal.net wrote:
|> |> I also went back to doing tables in HTML just for IE. So
|> |> I'd like to know if this works in IE.
|> |>
|> | No, of course not. IE only applies :hover to the <a> element.
|> | IE ignores "border-spacing" so a "cellspacing" is required on the table.
|>
|> So basically I really have to decide between going with web standards, or
|> making things work reasonably well on what is still the most common browser.
|> At least I can use more CSS since the basics of CSS work. But I still have
|> to use a lot of HTML that I should otherwise not need to use.
|>
| Not so much, really. Stick mostly to CSS v1, you'll do okay. In 3 - 5
| years, when IE6 becomes irrelevant, you can start using CSS2 extensively.
| By then CSS3 will be a standard and we'll only have to wait another 7
| years for MS to catch up.
|>
|> |> It would be nice if I could get the letters to move up further so they are
|> |> positioned where the top edge of the letters is lined up with the top edge
|> |> of the numbers.
|> |>
| [Code deleted]
|>
|> The letters went higher than the numbers. Some other combination (floats)
|> ended up with the same thing. The top of the box for each letter is now at
|> the top of the container box. But since there is more space above the
|> numbers because they are larger, they end up being lower.
|>
| I cannot tell if you tried the code I listed. What would floating
| achieve for vertical position?

I tried float in my initial trials with that. I tried you code with the
CSS in effect for all and the HTML for one button and it had the same
effect.

| It depends on the font. With one font the letters were below the
| numbers. Other fonts the letters were above. In one font where there are
| lowercase numbers, the letters were both above and below.

The fonts could be an issue. There's a box around each glyph, offset from
the glyph itself, which is more tall than wide. I read about a way to make
all the baselines be aligned. Need something like that for the topline, as
well as in other cases a middle line.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
May 11 '06 #5
ph**************@ipal.net wrote:
On Wed, 10 May 2006 12:17:28 -0700 Jim Moe <jm***************@sohnen-moe.com> wrote:

| ph**************@ipal.net wrote:
|> Here is another attempt at making some HTML/CSS (e.g. not image) buttons.
|> Because I've managed to avoid the things that tend to be problems, it has
|> mostly worked. I also went back to doing tables in HTML just for IE. So
|> I'd like to know if this works in IE.
|>
| No, of course not. IE only applies :hover to the <a> element.
| IE ignores "border-spacing" so a "cellspacing" is required on the table.

So basically I really have to decide between going with web standards, or
making things work reasonably well on what is still the most common browser.


"cellspacing" is standards compliant for HTML 4.01 strict:
http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1
http://www.w3.org/TR/html4/struct/ta...ef-cellspacing

The :hover bit is another matter - and IE blows it pretty big there.
May 11 '06 #6
On Thu, 11 May 2006 10:04:22 -0700 Tony <to****@dslextreme.whatisthis.com> wrote:
| ph**************@ipal.net wrote:
|> On Wed, 10 May 2006 12:17:28 -0700 Jim Moe <jm***************@sohnen-moe.com> wrote:
|>
|> | ph**************@ipal.net wrote:
|> |> Here is another attempt at making some HTML/CSS (e.g. not image) buttons.
|> |> Because I've managed to avoid the things that tend to be problems, it has
|> |> mostly worked. I also went back to doing tables in HTML just for IE. So
|> |> I'd like to know if this works in IE.
|> |>
|> | No, of course not. IE only applies :hover to the <a> element.
|> | IE ignores "border-spacing" so a "cellspacing" is required on the table.
|>
|> So basically I really have to decide between going with web standards, or
|> making things work reasonably well on what is still the most common browser.
|
| "cellspacing" is standards compliant for HTML 4.01 strict:
| http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1
| http://www.w3.org/TR/html4/struct/ta...ef-cellspacing
|
| The :hover bit is another matter - and IE blows it pretty big there.

Supposedly :hover works with <A> elements. Maybe we can play with <A>
elements with classes that select for :hover and get the effect> I'm not
doing the playing because I don't have IE handy right now.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
May 12 '06 #7

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

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
9
by: Tom | last post by:
I have created the following code for a product select/payment form (don't know if there is a better way) and I have been trying to make the following changes (unsuccessfully so far): 1) ...
14
by: TrvlOrm | last post by:
OK. After much playing around, I managed to get my frame page this far.. see code below. BUT...there are still errors with it, and what I would like to have happened is this: 1) On the Left...
1
by: Julius Mong | last post by:
Dear all, I have the following: <html> <head> .... </head> <frameset ...> <frame .../> <frameset name="page" rows="60,*" ...> <frame src='top.html' .../>
1
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and...
7
by: Matt | last post by:
Hi all, Not very sure about this. I have one button (not a submit button) will "post" partial page(form) info to another url(the user will also redirect to this url :-). I dont' want to change...
7
by: Sky | last post by:
What I have currently: I have a user control called mod_container.aspx that is basically two divs -- the top a toolbar, that expands/collapse the second div which can contain other...
6
by: Leszek | last post by:
Hi. I wrote a script: function zmiana(ile){ while(document.getElementById('accomp').childNodes.length>1){ ostatni=document.getElementById('document.dane.accomp').lastChild;...
16
by: Phlip | last post by:
Javascripters: I have a page with an iframe inside. Let's say the iframe looks like this: <script src="/javascripts/prototype.js" type="text/javascript" /> .... <iframe id='grinder'...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.