Home  >  Article  >  Web Front-end  >  What other tags can be used within the li tag? _html/css_WEB-ITnose

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

WBOY
WBOYOriginal
2016-06-24 12:09:592049browse

	<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>

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)

0fdcc53ee06457e7271b8f1a1b0293aca4b561c25d9afb9ac8dc4d70affff419IP :0d36329ec37a2cc24d42c7229b69747a95abdbbdb8c336a8f3a3dc3e1afdc3bc54bdf357c58b8a65c66d7c19c8e4d114

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>

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>

Use span tag, its width attribute can limit the length

Statement:
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