我正在研究CSS布局,但我不明白为什么导航栏的背景颜色不会显示,除非我添加overflow: hidden到CSS.有人可以向我解释发生了什么事吗?谢谢 :)
我的CSS文件:
@import "reset.css"; /* Meyer's CSS reset */
body { background-color: #f3f3f3; font: 15px sans-serif; }
#wrapper {
width: 1000px;
margin: 0 auto;
}
#navigation {
width: inherit;
margin-top: 20px;
background-color: #ccc;
overflow: hidden;
}
#navigation li {
float: left;
}
#navigation li a {
display: block;
padding: 10px 10px;
text-decoration: none;
color: #000;
}
#navigation li a:hover {
background-color: #aaa;
}
Run Code Online (Sandbox Code Playgroud)
我的HTML文件:
<!DOCTYPE html>
<html>
<head>
<title>Layout</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" …Run Code Online (Sandbox Code Playgroud) 我正在学习C而且我不理解下面代码的行为:
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <stdio.h>
int main() {
int buffer;
read(0, &buffer, sizeof(int));
printf("%d", buffer);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输入:
1
Run Code Online (Sandbox Code Playgroud)
输出:
2609
Run Code Online (Sandbox Code Playgroud)
这里发生了什么?输出不应该是1吗?