-2

如何在底部 div 中进行最正确的划分,如给定代码所示,例如一个小方框,右侧的方框中仅使用 html div 标签?还告诉我如何调整它的大小。

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <title>Vendors</title>

    <link rel="stylesheet" type="text/css" href="sheet.css" />
    <script src="jquery-1.10.1.min.js"></script>
    <script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").hide();
  });
});
</script>
</head>

<body>
    <div align="top" style="width:940;height:400;border:solid;border-width:4;">
        <center><p>My top  five Vendors</p></center>
        <button>Click me</button>

</div>



<div class="bottom" align="bottom" style="height:350;width:940;border:solid">



    <div align="left" style="height:350;width:470;border:solid">
        <div align="bottom" style="height:175;width:467;border:solid">

        </div>

</div>

</body>

</html>
4

2 回答 2

0

在修复你的 HTML 和 CSS 之后,你可能应该尝试这样定位:

<style>
div#bottomRight{
position:absolute;
bottom:0;
right: 0: //or whatever value fits your needs
width: 200px; //or whatever value fits your needs
height: 50px; //or whatever value fits your needs
}
</style>
于 2013-06-13T12:33:50.397 回答
0

您需要将“px”添加到您的宽度和高度值。在此处查看演示http://jsfiddle.net/msbodetti/dy5us/

<body>
    <div align="top" style="width:940px;height:400px;border:solid;border-width:4px;">
        <center><p>My top  five Vendors</p></center>
        <button>Click me</button>

</div>



<div class="bottom" align="bottom" style="height:350px;width:940px;border:solid">



    <div align="left" style="height:350px;width:470px;border:solid">
        <div align="bottom" style="height:175px;width:467px;background:red;">

        </div>

</div>

</body>
于 2013-06-13T12:39:12.727 回答