61,115
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="test.css">
</head>
<body>
<div id="parent" style="display:inline">
<div id="child1" style="display:inline">1111111111111111111111111111111111111111111111111</div>
<div id="child2" style="display:inline">2222222222222222222222222222222222222222222222222222222222222222222222222</div>
</div>
</body>
</html>
@charset: "utf-8";
#child1{
background: blue;
}
#child2{
background:red;
}
<!DOCTYPE html>
<html>
<head>
<style>
#parent{
display: block; /* div 默认 block 级别, inline 会使 尺寸类属性失效 */
min-width:2000px;
}
#parent>div{
display:inline;
}
#child1{
background: blue;
}
#child2{
background: red;
}
</style>
</head>
<body>
<div id="parent">
<div id="child1">1111111111111111111111111111111111111111111111111</div>
<div id="child2">2222222222222222222222222222222222222222222222222222222222222222222222222</div>
</div>
</body>
</html>