两个盒子的边框都是1px, 如果加了浮动, 两个盒子相交的边框就会变成2px, 可以给一个margin负值, 让两个盒子重叠.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documenttitle>
<style>
ul li {
float: left;
list-style: none;
height: 200px;
width: 100px;
border: 1px solid pink;
margin-left: -1px;
}
style>
head>
<body>
<ul>
<li>li>
<li>li>
<li>li>
<li>li>
ul>
body>
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documenttitle>
<style>
ul li {
float: left;
list-style: none;
height: 200px;
width: 100px;
border: 1px solid pink;
margin-left: -1px;
}
ul li:hover {
position: relative;
border: 2px solid red;
}
style>
head>
<body>
<ul>
<li>li>
<li>li>
<li>li>
<li>li>
ul>
body>
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documenttitle>
<style>
.box {
height: 70px;
width: 300px;
margin: 0 auto;
}
.pic {
float: left;
width: 120px;
height: 60px;
}
.pic img {
width: 100%;
}
style>
head>
<body>
<div class="box">
<div class="pic">
<img src="images/img.png" alt="">
div>
<p>热身赛热身赛热身赛热身赛热身赛热身赛热身赛热身赛p>
div>
body>
html>
Unicode编码字体 :