本文介绍了浮动属性不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些问题试图编写CSS,使一个框浮动到我的页面的右边。
I'm having some issues trying to write CSS to make a box float to the right of my page.
我有一个div名为#right-box- uploadphoto是本页上的灰色框
I have a div called #right-box-uploadphoto that is the grey box on this page http://s361608839.websitehome.co.uk/salesboard/After_Login.html
CSS是这样的:
#right-box-uploadphoto{
width: 240px;
height: 240px;
background: #e6e6e6;
border: 1px solid #d7d7d7;
margin-left: 15px;
float: right;
}
不知何故被按下。它需要与#page-box2对齐。
It's somehow being pushed down. It needs to line up with #page-box2.
这不对吗?
>
推荐答案
您将div放置在您的网页上。尝试将div添加到您的主框架,如:
You placed the div incorrectly on your page. Try adding your div to your mainFrame like:
<div id="mainFrame">
<h2>Set up your Salesboard</h2>
<p>There's only a few steps to go!</p>
<div class="line"></div>
<div id="page-box2">
<div id="step-box-select"><span class="icon-step">1</span> Set Up Your Profile</div>
<div id="step-box-unselect"><span class="icon-step">2</span> Set Up Your Team</div>
<div id="step-box-unselect"><span class="icon-step">3</span> Add Team Member</div>
<br><br>
<form action="" method="get">
</form>
<a href="#" class="upgradebutton">Upgrade</a></div>
<div id="right-box-uploadphoto"></div>
</div>
这篇关于浮动属性不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!