W3C home > Mailing lists > Public > www-style@w3.org > December 2010

Re: Two CSS challenges

From: Gérard Talbot <www-style@gtalbot.org>
Date: Sun, 26 Dec 2010 13:57:43 -0800
Message-ID: <0259598b2f464a8fc21fc87b9d9fc9f5.squirrel@cp3.shieldhost.com>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: "www-style mailing list" <www-style@w3.org>

Le Sam 25 décembre 2010 12:31, Andrew Fedoniouk a écrit :
> Here are two challenges that have no solutions in modern CSS.
>
> 1. Consider this simple markup:
>
> <p> Something <span>Like a Button</span></p>
>
> I would like to define the span above to behave (visually) as a button -
> on
> span:active I would like to shift/offset its text from its normal position
> by 1px.

Offset toward the right only? Offset toward the bottom too?

It's not perfectly clear here how the offset should be/go..

Here is its style:
>
> span {
>    display:inline-block;
>    border:1px solid;
>    padding:3px;
>    vertical-align:baseline;
> }
> span:active { ???? }
>
> Straightforward solution of using something like padding:4px 2px 2px 4px;
> will not work here because of vertical-align:baseline ...
>

"
<length>
    Raise (positive value) or lower (negative value) the box by this
distance.
"
http://www.w3.org/TR/CSS21/visudet.html#line-height

A button-like span shift/offset its text by 1px when :activated, version 3:

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/button-like-span-activated-moves-left-v3.html

works for me in Konqueror 4.5.4, Chrome 8.0.552.224, Opera 11.0 and
Firefox 3.6.12 and meets your requirements.

season's greetings, Gérard
-- 
CSS 2.1 Test suite RC4 (December 10th 2010)
http://test.csswg.org/suites/css2.1/20101210/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html
Received on Sunday, 26 December 2010 21:58:21 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:35 GMT