Home >Web Front-end >HTML Tutorial >How to use css to achieve left alignment of all li elements in div and center alignment of button elements? The code is as follows (if you find it difficult, you can modify the html code, but the li and button elements must be in the div)_html/css_WEB-ITnose

How to use css to achieve left alignment of all li elements in div and center alignment of button elements? The code is as follows (if you find it difficult, you can modify the html code, but the li and button elements must be in the div)_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 12:04:572385browse


    

        
  • 美国

  •     
  • 中国

  •     
  • 日本

  •     
  • 德国

  • 法国

  •     

      
    
   

 


回复讨论(解决方案)

是否这样?

<!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=utf-8" /><title>无标题文档</title><style>.box{ text-align:center; width:500px;background:#FCF;margin:100px auto;}.demailUl{width:130px;height:180px;list-style:none; text-align:left;margin:0;padding:0;}</style></head><body>	<div class="box">    	<ul class="demailUl" >    	 <li><input type="checkbox" class="checkbox" name="Group" id="radio1" value="美国" />美国</li>    	 <li><input type="checkbox" class="checkbox" name="Group" id="radio2" value="中国" />中国</li>    	 <li><input type="checkbox" class="checkbox" name="Group" id="radio3" value="日本" />日本</li>    	 <li><input type="checkbox" class="checkbox" name="Group" id="radio4" value="德国" />德国</li><li><input type="checkbox" class="checkbox" name="Group" id="radio5" value="法国" />法国</li>    	</ul>    	<input type="button" value="确定" id="btnConfirm" />     	   </div></body></html>

yes,very good,thanks!

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