Step by step teach you how to implement the bar chart of pure CSS

Source: Internet
Author: User

CSS is powerful in the Process of typographical editing. Below we will implement a bar chart together. First, build a specific framework. We use the unordered list as a whole, and we choose inline nonprime span, strong, and em to fill in the content.

<Ul class = "chart"> <li> <em> Call of Duty </em> <span>: </span> <strong> 35% </strong> </li> <em> machine war </em> <span>: </span> <strong> 40% </strong> </li> <em> CS </em> <span>: </span> <strong> 87% </strong> </li> <em> halo </em> <span>: </span> <strong> 45% </strong> </li> <em> half life </em> <span>: </span> <strong> 23% </strong> </li> </ul>

Tip: the code can be modified before running!

<Ul class = "chart">
<Li> <em> Call of Duty </em> <span>: </span> <strong> 35% </strong> </li>
<Li> <em> machine war </em> <span >:</span> <strong> 40% </strong> </li>
<Li> <em> CS </em> <span >:</span> <strong> 87% </strong> </li>
<Li> <em> halo </em> <span >:</span> <strong> 45% </strong> </li>
<Li> <em> half-lived </em> <span >:</span> <strong> 23% </strong> </li>
</Ul>

To explain, every li in ul represents the content to be counted. span is the column body, em is the name of the statistical item, and strong is the statistical value. We can add some background colors to distinguish them.

  • 7 pages in total:
  • Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.