& lt; html>
& lt; head>
& lt; title> The navigation bar to practice & lt;/title>
& lt; Style type="text/CSS" & gt;
. * {
margin:0;
padding:0;
}
The nav {
list-style:none;
Background - color: PowderBlue;
width:1000px;
margin:50px auto;
}
The nav li {
float:left;
Width: 25%;
}
The nav li a {
display:block;
width:100%;
margin:0 auto;
Padding: 0 px;
text-align:center;
text-decoration:none;
}
A: hover {
Background - color: Coral;
}
Clearfix: after {
content:"";
display:block;
clear:both;
}
& lt;/style>
& lt;/head>
& lt; body>
& lt; Ul & gt;
& lt; li> & lt; A href=https://bbs.csdn.net/topics/#> home page
& lt; li> & lt; A href=https://bbs.csdn.net/topics/#> we
& lt; li> & lt; A href=https://bbs.csdn.net/topics/#> refresh
& lt; li> & lt; A href=https://bbs.csdn.net/topics/#> contact
& lt;/ul>
& lt;/body>
& lt; html>
CodePudding user response:
If it is not in order to solve the problem left over from old projects, recommend direct learn flex or gird layout
CodePudding user response: