Jump to content

Make text bigger on :hover without shifting nearby elements


Rob in hood

Recommended Posts

I haven't tried or researched it, but of the top of my head, try adding padding or border to your regular link and none to the one with the bigger font - you'll just have to play with how may pixel until things quit jumping.

 

Seems like it should work.....

Link to comment
Share on other sites

Inline elements like li don't have a width, so people often convert them to block;

 

but then they will follow the rules for a block element so you may have other adjustments to make, like using float: left; instead of display: inline.

 

li { display: block; float: left; width: ??px; }

Edited by Wickham
Link to comment
Share on other sites

Note that Eric didn't include display: block; that's because when you style float: left it automatically converts the element to block; but of course you need to delete the display: inline or there will be a conflict (which he did).

 

I usually include display: block where I've deliberately changed an inline element, even though float does it for me, just so that I have a reminder there that I changed it.

Link to comment
Share on other sites

Note that Eric didn't include display: block; that's because when you style float: left it automatically converts the element to block; but of course you need to delete the display: inline or there will be a conflict (which he did).

 

I usually include display: block where I've deliberately changed an inline element, even though float does it for me, just so that I have a reminder there that I changed it.

 

Ah, good to know! I'm slowly learning those little intracacies like that :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...