Re: width and height

Then this is the problem. But then why margin and padding works, with
those you can achieve what you would do with height&width for a:hover,
maybe it won't look nice, but with padding under a:hover you can do
same thing instead of using height or width.
Then why not placing "proper" rule to have actual width and height under :hover.

Padding sample works fine here:
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
#css a:hover {
       color:#E44D26;
       background-color:blue;
       height:100px;
       width:400px;
       padding:100px;
}
</style>
</head>

<body>
<div id="css"><a href="#">test</a></div>
</body>
</html>


Bruno

2011/1/25 Tab Atkins Jr. <jackalmage@gmail.com>:
> On Tue, Jan 25, 2011 at 9:52 AM, Bruno <bruno5544@gmail.com> wrote:
>> Here you go:
>>
>> #css a:hover {
>>        color:red;
>>        background-color:blue;
>>        height:100px;
>>        width:400px;
>> }
>>
>> Don't know how it works for you when I tested it on all major browsers
>> and doesn't work on any.
>
> Could you post the *whole* testcase?  HTML and the rest of the CSS?
>
> You do realize that, by default, <a> is an inline element, and 'width'
> and 'height' don't work on inline elements?
>
> ~TJ
>

Received on Tuesday, 25 January 2011 18:15:14 UTC