X close button only using css

0 votes
How can I make a cross (X) that can be used as a close button using only CSS3?

I've been looking for a long time and haven't been able to figure out how.... When I look at source code on a website that uses it, I usually find something strange that renders the code I'm looking at worthless.
Jun 9 in CSS by Edureka
• 12,390 points
559 views

1 answer to this question.

0 votes

You can use the ISO code with the content property as a pure CSS solution for the closing or 'times' symbol. This is frequently used for:after or:before pseudo selectors.

The content code is \00d7.

Example

div:after{
  display: inline-block;
  content: "\00d7"; /* This will render the 'X' */
}

The pseudo selector can then be styled and positioned as desired.

answered Jun 21 by Edureka
• 10,880 points

Related Questions In CSS

0 votes
0 answers

How to make a back-to-top button using CSS and HTML only?

I want to scroll down and up ...READ MORE

Jun 30 in CSS by Edureka
• 12,390 points
61 views
0 votes
1 answer

Is there any way to colorize a white PNG image with CSS only?

Filters can be used with -webkit-filter and ...READ MORE

answered May 27 in CSS by Edureka
• 10,880 points
448 views
0 votes
1 answer

How do I give text or an image a transparent background using CSS?

Use either a semi-transparent PNG or SVG ...READ MORE

answered May 27 in CSS by Edureka
• 10,880 points
78 views
0 votes
1 answer

How to set Bullet colors in UL/LI html lists via CSS without using any images or span tags

I use jQuery for this: jQuery('li').wrapInner('<span class="li_content" />'); & ...READ MORE

answered May 27 in CSS by Edureka
• 10,880 points
250 views
0 votes
0 answers

Embed image in a <button> element

I'm attempting to use an HTML element ...READ MORE

Jul 21 in HTML by Ashwini
• 2,760 points
39 views
0 votes
1 answer

trying to align html button at the center of the my page

For example: HTML <div> <button>Submit</button> </div> CSS button { margin:auto; ...READ MORE

answered Aug 4 in HTML by Deepak
• 940 points
70 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
5,494 views
0 votes
1 answer

How to hide image broken Icon using only CSS/HTML?

Because CSS/HTML has no means of knowing ...READ MORE

answered May 31 in CSS by Edureka
• 10,880 points
329 views
0 votes
1 answer

Multi-Colored text using only CSS

Put your text inside a span> tag ...READ MORE

answered Jun 28 in CSS by Edureka
• 10,880 points
86 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP