<!doctype html> <html> <head> <meta charset="u

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body style=" text-align:center; line-height:50px;">

<div style="width:100%; height:50px;">
<div style=" background:#0CF; width:100%; height:100%;">
<div style=" background:#0F0; width:50%; height:100%; border-right:solid #000 1px; float:left;">A</div>
<div style=" background:#F0F; height:100%; float:right;">B</div>
</div>
</div>
</body>
</html>
现在“B”还不能适应剩下的宽度。
最终目标使“B”在不同显示设备适应剩下的宽度。
(还请你 写 好 测 试 之后 满 足 要 求 再回答,回答时请附上 完 整 代 码,否则不追问不采纳。)

我被你写的代码看的莫名其妙
这是修改后的 <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body style=" text-align:center; line-height:50px;">

<div style="background:#0CF;width:100%; height:50px;">

<div style=" background:#0F0; width:50%; height:100%; border-right:solid #000 1px;float:left;">A</div>
<div style="background:#F0F;width:30%;height:100%;float:right;">B</div>

</div>
</body>
</html>

你写的代码样式乱套了,莫名其妙多出一些框架 明明只用三个div的结构 你写了四个追问

我故意写了4个,但你写的是不能解决我想要的结果。目前我只知道用table替换可以满足我的要求,因为table有自适应,但是我更想知道div怎么满足……

追答

不知道你要什么样的效果 不过我做布局 没有遇到你这样的问题

温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-12-26
先回答我问题吧追答

HTML5

定义注释
列如注释是HTML5
定义锚
列如www.w3school.con.cn表示连链接到www.w3school.con.cn
那么按照以上的例子写出这个标签

相似回答