Search
 
SCRIPT & CODE EXAMPLE
 

CSS

bold on hover but not add padding or distance

li {
    display: inline-block;
    font-size: 0;
}

li a {
    display:inline-block;
    text-align:center;
    font: normal 16px Arial;
    text-transform: uppercase;
}

a:hover {
    font-weight:bold;
}

/* SOLUTION */
/* The pseudo element has the same content and hover style, so it pre-sets the width of the element and visibility: hidden hides the pseudo element from actual view. */
a::before {
    display: block;
    content: attr(title);
    font-weight: bold;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}
Comment

PREVIOUS NEXT
Code Example
Css :: remove bullet list css 
Css :: CSS hide first li separator on each line - responsive horizontal css menu 
Css :: react stateful 
Css :: css not hover div right hide 
Css :: slect all li that not have ul 
Css :: how to make textbox shorter in html 
Css :: poretty print css 
Css :: wordpress localhost css not working 
Css :: slide up animation css 
Css :: css multyple transition peoperty same class 
Css :: elemento SPAN 
Css :: customHook-axios 
Css :: Basic sintax media Query 
Css :: css fr meaning 
Css :: css fade div 
Css :: css animation delay does not work 
Css :: centralize div css 
Css :: how to add background shadow css 
Typescript :: ul dots remove 
Typescript :: Require statement not part of import statement.eslint@typescript-eslint/no-var-requires 
Typescript :: increase size of mat dialog 
Typescript :: convert string to uppercase typescript 
Typescript :: list open ports firewalld 
Typescript :: typescript function example react type declaration inline 
Typescript :: string to date in typescript 
Typescript :: react onclick typescript type 
Typescript :: formGroup dependency for module.ts 
Typescript :: typescript constructor assignment shorthand 
Typescript :: xaraktirismos tou tsiganou kai tou xose buendia sto keimeno 100 xronia monaksias, oi nees efeureseis 
Typescript :: global d ts 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =