What other tags can be used within the li tag? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:09:59
Original
2049 people have browsed it

	<ul>		<li class="msgcont" id="msgcont<?php echo $rows["Id"] ?>">                    <b>IP:</b><?php echo $rows["lastip"] ?>                    <b>位置:</b><?php echo $rows["address"] ?>		</li>	</ul>
Copy after login

Because the contents of $rows["lastip"] are different, the displayed lengths are different, which looks messy. Is there any way to limit the length of $rows["lastip"] displayed?


Reply to discussion (solution)

IP :

For standard browsers:

   <style type="text/css" >ul li span { display:inline-block; width: 140px;}    </style> <ul><li> <b>IP:</b><span>1.1.1.1</span><b>位置:</b></li><li> <b>IP:</b><span>255.255.255.255</span><b>位置:</b></li> </ul>
Copy after login

What a pity Older versions of this browser are not compatible with inline-block.

The workaround can be as follows

    <style type="text/css" >ul li span {  float:left; width:200px;}    </style>        <ul><li><span> <b>IP:</b>1.1.1.1</span><b>位置:</b>ss</li> <li> <span><b>IP:</b>255.255.255.255</span><b>位置:</b>ss</li> </ul>
Copy after login

Use span tag, its width attribute can limit the length

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template