Skip to content

Instantly share code, notes, and snippets.

@obromios
Last active May 7, 2016 11:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obromios/9378675 to your computer and use it in GitHub Desktop.
Save obromios/9378675 to your computer and use it in GitHub Desktop.
Making a cross within a circle for a close icon using css
<!DOCTYPE html>
<html>
<head>
<style>
div#hideable{
background-color: lightgreen;
overflow: auto;
}
div.close{
float: right;
overflow: auto;
width: 20px;
height: 20px;
border-radius: 50%;
border-width: medium;
border-color: black;
border-style: solid;
}
div.close:hover{
cursor: pointer;
}
span.close_cross{
position: relative;
top: -3px;
left: 3px;
color: black;
font-size: 26px;
}
}
</style>
</head>
<body>
<div id="hideable"><p>This is some text to be hidden.</p><div class="close"><span class="close_cross">&times;</span></div></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment