页面显示问题

时间:2012-12-27 20:34:48

标签: html firefox

div标签应该放在右侧,但这只放在Firefox的左侧。 我的页面在任何其他浏览器中都很好看,但在firefox中,页面看起来不同,我的代码是

<div style="width: 400px; height: 280px; float:left; margin-left: 15px;margin-top: 3px">

    <div class="slider-wrap">
        <div id="main-photo-slider" class="csw">
            <div class="panelContainer">

                <div class="panel" title="Panel 1">
                    <div class="wrapper">
                        <img src="image/forslider/slider1.jpg" alt="" style="border-style: solid; height: 266px; width: 392px;"/>
                    </div>
                </div>
                <div class="panel" title="Panel 2">
                    <div class="wrapper">
                        <img src="image/forslider/slider2.jpg" alt="" style="border-style: solid; height: 266px; width: 392px;"/>

                    </div>
                </div>      
                <div class="panel" title="Panel 3">
                    <div class="wrapper">
                        <img src="image/forslider/slider3.jpg" alt="" style="border-style: solid; height: 266px; width: 392px;"/>
                    </div>
                </div>
                <div class="panel" title="Panel 4">
                    <div class="wrapper">
                        <img src="image/forslider/slider4.jpg" alt="" style="border-style: solid; height: 266px; width: 392px;"/>

                    </div>
                </div>
                <div class="panel" title="Panel 5">
                    <div class="wrapper">
                        <img src="image/forslider/slider5.jpg" alt="" style="border-style: solid; height: 266px; width: 392px;"/>

                    </div>
                </div>
                <div class="panel" title="Panel 6">
                    <div class="wrapper">
                        <img src="image/forslider/slider6.jpg" alt="" style="border-style: solid; height: 266px; width: 392px;"/>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

div标签必须放在右侧。

2 个答案:

答案 0 :(得分:0)

尝试这样的事情:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>align</title>
<style type="text/css">
body {
    margin: 0px;
    padding: 0px;
}
#right {
    text-align: left;
    width: 200px;
    position:absolute;
    right:1%;
    background-color: blue;
}
</style>
</head>
<body>
    <div id="right">Some Text</div>    
</body>
</html>

答案 1 :(得分:0)

尝试在第一个div中将float:left;更改为float:right;