Created
April 15, 2024 10:40
-
-
Save ravisiyer/cd865c67067275b3d12d76bb071f2dd4 to your computer and use it in GitHub Desktop.
CSS: Putting H2 on left and link on right of same line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>H2 and link same line</title> | |
<style> | |
div { | |
background: #dbdbdb; | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
} | |
</style> | |
</head> | |
<body> | |
<div> | |
<h2>H2</h2> | |
<a href="#">Some link</a> | |
</div> | |
<p> | |
H2 inline left-aligned with right-aligned and vertically centered link | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment