This is probably pedantry, but so far no one has really given a solution "to create a close button using CSS only." only. Here you go:
#close:before {
content: "✖";
border: 1px solid gray;
background-color:#eee;
padding:0.5em;
cursor: pointer;
}