Re: Two CSS challenges

Le 25/12/10 21: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.

You want vertical-align-offset.

> 2. Consider another markup:
> <div> text 1 <p>text 2</p> </div>
> By definition [1] "text 1" is wrapped into so called anonymous box -
> block element of appropriate type. If I want to draw 1px solid red;
> border around that box how would I do so?

::text is clearly not enough here and it will disappoint a lot of

    text 1<br/>
    text 2
    <p>text 2</p>

Even with ::text, you can't style "text 2".


Received on Sunday, 26 December 2010 00:24:07 UTC