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

Docker implements container port binding local port

Today, I encountered a small problem that after s...

Understanding MySQL precompilation in one article

1. Benefits of precompilation We have all used th...

Detailed explanation of zabbix executing scripts or instructions on remote hosts

Scenario Requirements 1. We can use the script fu...

How to configure Http, Https, WS, and WSS in Nginx

Written in front In today's Internet field, N...

Linux uses suid vim.basic file to achieve privilege escalation

Reproduce on Kali First set suid permissions for ...

How to display texture at the position of swipe in CocosCreator

Table of contents 1. Project requirements 2. Docu...

Building the User Experience

<br />Maybe you've just come into a comp...

Why the disk space is not released after deleting data in MySQL

Table of contents Problem Description Solution Pr...

3 methods to restore table structure from frm file in mysql [recommended]

When mysql is running normally, it is not difficu...

JS removeAttribute() method to delete an attribute of an element

In JavaScript, use the removeAttribute() method o...

Implementation of 2D and 3D transformation in CSS3

CSS3 implements 2D plane transformation and visua...

How to build your own Angular component library with DevUI

Table of contents Preface Creating a component li...

CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions

1. Introduction This article does not have screen...

About the configuration problem of MyBatis connecting to MySql8.0 version

When learning mybatis, I encountered an error, th...