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
4d0613b82ced85e3cec048189fc2fb87
d48660b2f629eb95868c5b8eafe82107
25edfb22a4f469ecb59f1190150159c6e0c39a8829db30f70ee8085e6c2fc90f美国bed06894275b65c1ab86501b08a632eb
25edfb22a4f469ecb59f1190150159c690f7c8f5e34ac9e86933bd5289cbf22e中国bed06894275b65c1ab86501b08a632eb
25edfb22a4f469ecb59f1190150159c6667aaad591c0eeec724c1b1141a0ada4日本bed06894275b65c1ab86501b08a632eb
25edfb22a4f469ecb59f1190150159c6c28698b058e67c8989be49d925882db0德国bed06894275b65c1ab86501b08a632eb
25edfb22a4f469ecb59f1190150159c66ea7b79f77f66df0b164682550e57f13法国bed06894275b65c1ab86501b08a632eb
929d1f5ca49e04fdcb27f9465b944689
7e68deb9b9839ceca71270cf88363c6b
16b28748ea4df4d9c2150843fecfba68
是否这样?
<!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!