Examples of using the Li tag in HTML

Examples of using the Li tag in HTML

I hope to align the title on the left and the date on the right. When I directly add float:right to the span of the date, IE8 and FF are OK, but IE6/7 will wrap. Here is a simple and effective solution.

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >     
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >     
  3. < head >   
  4.     < meta   http-equiv = "Content-Type"   content = "text/html; charset=utf-8"   />   
  5.     < title > </ title >   
  6. < style >   
  7. <!--
  8.   
  9. #mylist { width:400px; list-style-type:none; margin:0; padding:0; }
  10. #mylist li span {
  11. float:right;
  12. }
  13. -- >     
  14. </ style >     
  15. </ head >     
  16. < body >     
  17. < ul   id = "mylist" >   
  18.   
  19.          < li > < span > 2011-12-2 </ span > Web Developer Network (Admin10000.com) </ li >   
  20.          < li > < span > 2011-12-2 </ span > Web Developer Network (Admin10000.com) </ li >   
  21.          < li > < span > 2011-12-2 </ span > Web Developer Network (Admin10000.com) </ li >             
  22. </ ul >   
  23.   
  24. </ body >     
  25. </ html >     

Note: The span should be written at the very beginning of the Li tag, so that the date in the span can be right-aligned in versions prior to IE6/IE7/FF3.5.

<<:  Some suggestions for HTML beginners and novices, experts can ignore them

>>:  MySQL time types and modes details

Recommend

WEB Chinese Font Application Guide

Using fonts on the Web is both a fundamental skill...

MySQL variable principles and application examples

In the MySQL documentation, MySQL variables can b...

Vue two same-level components to achieve value transfer

Vue components are connected, so it is inevitable...

Nginx reverse proxy forwards port 80 requests to 8080

Let's first understand a wave of concepts, wh...

mysql trigger creation and usage examples

Table of contents What is a trigger Create a trig...

mysql replace part of the field content and mysql replace function replace()

[mysql] replace usage (replace part of the conten...

How to use Linux locate command

01. Command Overview The locate command is actual...

Detailed explanation of crontab scheduled execution command under Linux

In LINUX, periodic tasks are usually handled by t...

JavaScript simulation calculator

This article shares the specific code of JavaScri...

Implementation of local migration of docker images

I've been learning Docker recently, and I oft...