According to the CSS Flexible Box Layout Module, you can declare the a
element as a flex container (see figure) and use align-items
to vertically align text along the cross axis (which is perpendicular to the main axis).
All you need to do is:
display: flex;
align-items: center;
See this fiddle.
Related Contents:
- How to style a checkbox using CSS
- How to position text over an image with CSS
- css ‘pointer-events’ property alternative for IE
- Why are flex items not wrapping?
- Font Awesome 5 on pseudo elements shows square instead of icon
- What is the effect of encoding an image in base64?
- Make grid container fill columns not rows
- How to replicate background-attachment fixed on iOS [duplicate]
- Are class names in CSS selectors case sensitive?
- How to customize ?
- CSS Progress Circle
- Remove white space above and below large text in an inline-block element
- Why can’t be flex containers?
- Properly sizing and aligning the flex item(s) on the last row
- Make Iframe to fit 100% of container’s remaining height
- Best way to include CSS? Why use @import?
- How do I set a background-color for the width of text, not the width of the entire element, using CSS?
- Ordered list (HTML) lower-alpha with right parentheses?
- Bootstrap 3 collapsed menu doesn’t close on click
- Is there a way to remove a div but keep its elements?
- Position: sticky buttons not working in IE 11
- CSS Float: Floating an image to the left of the text
- How to display vertical text in table headers with auto height / without text overflow?
- HTML5 input type range show range value
- Is it possible to style a mouseover on an image map using CSS?
- How to center an iframe horizontally?
- Difference between position:sticky and position:fixed?
- Add target=”_blank” in CSS
- How to resize an image to fit in the browser window?
- using text-align center in colgroup
- How to vertically center a inside a div? [duplicate]
- How to show multiline text in a table cell
- Prevent “overscrolling” of web page
- HTML/CSS: Make a div “invisible” to clicks?
- CSS select elements with partial id
- floating elements behavior
- Auto Resize Image in CSS FlexBox Layout and keeping Aspect Ratio?
- Div width 100% minus fixed amount of pixels
- HTML list-style-type dash
- Making an svg image object clickable with onclick, avoiding absolute positioning
- Fit website background image to screen size
- How do I make an input element occupy all remaining horizontal space?
- Is there a css selector for selecting an element futherup in the html?
- How do I remove the default link color of the html hyperlink ‘a’ tag?
- How to calculate required hue-rotate to generate specific colour?
- CSS padding is not working as expected in Outlook
- Tooltip with HTML content without JavaScript
- HTML Div border not showing
- Simulation of a placeholder
- Progress Bar with HTML and CSS