Petran
Petran

Reputation: 8047

Css auto height with font-size

I have a link and underneath a span element

<a href="#" style="display:inline-block;font-size:900%">12</a>
<span display="block">ACTIVE</span>

The problem is that if I don't give precise height to the 'a' element the height is not changing and they overlap. I want on my responsive rule to change only the size of the fonts is that possible ?

Upvotes: 1

Views: 2005

Answers (4)

Matt W
Matt W

Reputation: 4133

inline-block is an incorrect property on its own. It should be display:inline-block;

Have you tried adding a matching line-height: 100%; property?

Upvotes: 2

lakshya_arora
lakshya_arora

Reputation: 791

You can use a combination of percent and em in a and normal in span.

a {font-size:9em;}
span {font-size:normal;}

Upvotes: 0

user2029015
user2029015

Reputation: 330

Not getting your question completely. But I think you should try to use min-height or max-height instead of height.

Upvotes: 0

Mooseman
Mooseman

Reputation: 18891

a,span{height: npx} Just apply the height to both the a and the span in your CSS.

Upvotes: 0

Related Questions