Css automatically hides titles when they exceed the limit

Source: Internet
Author: User
Tip: you can modify some code before running

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Css achieves automatic title hiding (compatible with multiple browsers)</title><style type="text/css">* {Margin: 0; padding: 0; list-style: none; font-size: 12px;} body {padding: 20px ;}. test {width: 300px ;}. test ul {}. test ul li {clear: both; height: 22px; overflow: hidden; line-height: 22px ;}. test ul li a {float: left; margin-right: 60px; padding-right: 10px; color: #333; text-decoration: none ;}. test ul li a: hover {text-decoration: underline; color: # f60 ;}. test ul li span {overflow: hidden; display: inline; margin-left:-60px; width: 60px; height: 22px; font: 11px/22px "Times New Roman ", times, serif; color: # cdcdcd ;}</style></head><body><div class="test"> <ul> <li>Rehearsal of the tech troupe's beauty</li> <li>Acrobatics drills</li> <li>The beauty of the complex group of the beauty of the Group of the beauty of the sdsdsddsfdfsdffdfdf2009-05-12</li> <li>Rehearsal for women in the acrobatic troupe</li> <li>Rehearsal of the beauty troupe rehearsal of the beauty rehearsal 3333332009-05-12</li> <li>Rehearsal for women trained by a tech troupe</li> <li>Rehearsal of the tech troupe's beauty</li> <li>Acrobatics drills</li> <li>Rehearsal of the tech troupe's beauty</li> <li>Miscellaneous drills</li> </ul></div></body></html>
Tip: you can modify some code before running
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.