返回前端学习-浮动......登陆

前端学习-浮动实例(将列表做成并列的小球)

Hydrocarbon2019-01-19 15:44:00269

<!DOCTYPE html>

<html lang="en">


<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>CSS基础-利用浮动完成并列小球</title>

<style>

/* 标签选择器 */

ul {

border: 1px dashed lightsalmon;

margin-top: 0px;

margin-bottom: 0px;

padding-left: 0px;

overflow: hidden;

padding: 10px;

}


/* 层级选择器 */

ul li {

list-style-type: none;

width: 40px;

height: 40px;

background-color: brown;

float: left;

border-radius: 50%;

/*可以把块状变成圆球*/

text-align: center;

line-height: 40px;

margin-left: 5px;

box-shadow: 2px 2px 1px black;


}

</style>

<!-- <link rel="stylesheet" href="staic/css/style01.css"> -->

</head>


<body>

<ul>

<li class="Kris">1</li>

<li id="bg-green">2</li>

<li>3</li>

<li>4</li>

<li>5</li>

<li>6</li>

<li>7</li>

<li>8</li>

<li>9</li>

</ul>



</body>


</html>

<!DOCTYPE html>

<html lang="en">


<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>CSS基础-利用浮动完成并列小球</title>

<style>

/* 标签选择器 */

ul {

border: 1px dashed lightsalmon;

margin-top: 0px;

margin-bottom: 0px;

padding-left: 0px;

overflow: hidden;

padding: 10px;

}


/* 层级选择器 */

ul li {

list-style-type: none;

width: 40px;

height: 40px;

background-color: brown;

float: left;

border-radius: 50%;

/*可以把块状变成圆球*/

text-align: center;

line-height: 40px;

margin-left: 5px;

box-shadow: 2px 2px 1px black;


}

</style>

<!-- <link rel="stylesheet" href="staic/css/style01.css"> -->

</head>


<body>

<ul>

<li class="Kris">1</li>

<li id="bg-green">2</li>

<li>3</li>

<li>4</li>

<li>5</li>

<li>6</li>

<li>7</li>

<li>8</li>

<li>9</li>

</ul>



</body>


</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送