2014-09-22 53 views
0

当我改变屏幕大小时,我们的元素移动并且他们的位置改变了。现在我想知道这是什么原因?在这种情况下我该怎么办?当我改变屏幕大小时的位置移动


.header{ 
 
\t width:100%; 
 
\t height:100px; 
 
\t background-color:green; 
 
\t margin-bottom:50px; 
 
\t margin-top:-10px; 
 
} 
 
#title{ 
 
\t color:white; 
 
\t font-size:50px; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin:20px; 
 
\t padding-right:50px; 
 
\t display:inline; 
 
} 
 
.ms{ 
 
\t height:50px; 
 
\t width:15%px; 
 
\t margin:20px; 
 
\t display:inline; 
 
} 
 
#pms{ 
 
\t color:white; 
 
\t margin:10px; 
 
\t font-weight:bold; 
 
\t font-size:23px; 
 
\t margin-left:60px; 
 
\t padding-top:3px; 
 
} 
 
#p{ 
 
\t color:black; 
 
\t font-size:9px; 
 
\t margin-left:60px; 
 
\t margin-top:-7px; 
 
\t font-weight:bold; 
 
} 
 
.box1{ 
 
\t float:right; 
 
} 
 
.box2{ 
 
\t float:left; 
 
} 
 
.img1{ 
 
\t margin-right:40px; 
 
\t margin-bottom:30px; 
 
\t margin-top:30px; 
 
} 
 
.img2{ 
 
\t margin-left:40px; 
 
\t margin-bottom:30px; 
 
\t margin-top:30px; 
 
} 
 
#t1{ 
 
\t width:50%px; 
 
\t height:10px; 
 
\t background-color:99FF00; 
 
\t margin-right:30px; 
 
\t position:absolute; 
 
\t left:30px; 
 
\t top:50px; 
 
} 
 
#first{ 
 
\t font-weight:bold; 
 
\t font-size:40px; 
 
\t color:99FF00; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tf{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:30px; 
 
} 
 
.pf{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t2{ 
 
\t width:50%px; 
 
\t height:10px; 
 
\t background-color:990066; 
 
\t margin-left:30px; 
 
\t position:absolute; 
 
\t left:30px; 
 
\t top:50px; 
 
} 
 
#second{ 
 
\t font-weight:bold; 
 
\t font-size:40px; 
 
\t color:990066; 
 
\t margin-right:5px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.ts{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:5px; 
 
} 
 
.ps{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t3{ 
 
\t width:50%px; 
 
\t height:10px; 
 
\t background-color:003399; 
 
\t margin-right:30px; 
 
\t margin-top:30px; 
 
} 
 
#third{ 
 
\t font-weight:bold; 
 
\t font-size:40px; 
 
\t color:003399; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tt{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:30px; 
 
} 
 
.pt{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t4{ 
 
\t width:50%px; 
 
\t height:10px; 
 
\t background-color:CC0000; 
 
\t margin-left:30px; 
 
\t margin-top:30px; 
 
} 
 
#fourth{ 
 
\t font-weight:bold; 
 
\t font-size:40px; 
 
\t color:CC0000; 
 
\t margin-right:5px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tf1{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:5px; 
 
} 
 
.pf1{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t5{ 
 
\t width:50%px; 
 
\t height:10px; 
 
\t background-color:59955C; 
 
\t margin-right:30px; 
 
\t margin-top:30px; 
 
} 
 
#fifth{ 
 
\t font-weight:bold; 
 
\t font-size:40px; 
 
\t color:59955C; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tf2{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:30px; 
 
} 
 
.pf2{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t6{ 
 
\t width:50%px; 
 
\t height:10px; 
 
\t background-color:CCFF33; 
 
\t margin-left:30px; 
 
\t margin-top:30px; 
 
} 
 
#sixth{ 
 
\t font-weight:bold; 
 
\t font-size:40px; 
 
\t color:CCFF33; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.ts1{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:5px; 
 
} 
 
.ps1{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
.footer{ 
 
\t clear:both; 
 
\t width:100%px; 
 
\t height:100px; 
 
\t background-color:green; 
 
} 
 
#m{ 
 
\t float:right; 
 
\t margin-top:30px; 
 
\t color:white; 
 
\t margin-right:40px; 
 
} 
 
#m1{ 
 
\t font-size:20px; 
 
\t font-weight:bold; 
 
} 
 
#m2{ 
 
\t font-size:15px; 
 
\t font-weight:bold; 
 
} 
 
#s{ 
 
\t float:left; 
 
\t margin-top:30px; 
 
\t color:white; 
 
\t margin-left:40px; 
 
} 
 
#s1{ 
 
\t font-size:20px; 
 
\t font-weight:bold; 
 
} 
 
#s2{ 
 
\t font-size:29; 
 
\t font-weight:bold; 
 
}
<html> 
 
<head> 
 
<title>modire sabz</title> 
 
<meta charset="utf-8"> 
 
<link type="text/css" rel="stylesheet" href="modire sabz.css"> 
 
</head> 
 
<body> 
 
\t <div class="header"> 
 
\t \t <div id="title">فهرست بخشی از محصولات مدیر سبز</div> 
 
\t \t <div class="ms"> 
 
\t \t \t <p id="pms">مدیر سبز</p> 
 
\t \t \t <p id="p">مشاورین بازاریابی نوین</p> 
 
\t \t </div> 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t1"></div> 
 
\t \t <div id="first"> رشد کسب و کار (سطح اول) </div> 
 
\t \t <div class="img1"> 
 
\t \t \t <img src="1.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tf">:مخاطب</div> 
 
\t \t <div class="pf">کارآفرینان، مدیران و صاحبان فروشگاه</div> 
 
\t \t <div class="tf">:موضوع</div> 
 
\t \t <div class="pf">بازاریابی، تبلیغات، مدیریت و توسعه کار</div> 
 
\t \t <div class="tf">قیمت ویژه بسته: 49 هزار تومان</div> 
 
\t </div> 
 
\t <div class="box2"> 
 
\t \t <div id="t2"></div> 
 
\t \t <div id="second">رشد و کسب و کار (سطح دوم)</div> 
 
\t \t <div class="img2"> 
 
\t \t \t <img src="2.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="ts">:مخاطب</div> 
 
\t \t <div class="ps">کارآفرینان، مدیران و صاحبان فروشگاه</div> 
 
\t \t <div class="ts">:موضوع</div> 
 
\t \t <div class="ps">بازاریابی، تبلیغات، مدیریت و توسعه کار</div> 
 
\t \t <div class="ts">قیمت ویژه بسته: 59 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t3"></div> 
 
\t \t <div id="third">کسب و کار اینترنتی پیشرفته</div> 
 
\t \t <div class="img1"> 
 
\t \t \t <img src="3.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tt">:مخاطب</div> 
 
\t \t <div class="pt">صاحبان و مدیران وب سایت</div> 
 
\t \t <div class="tt">:موضوع</div> 
 
\t \t <div class="pt">بازاریابی با ایمیل سءو، بازاریابی اینترنتی</div> 
 
\t \t <div class="tt">قیمت ویژه بسته: 99 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box2"> 
 
\t \t <div id="t4"></div> 
 
\t \t <div id="fourth">فروشندگی حرفه ای</div> 
 
\t \t <div class="img2"> 
 
\t \t \t <img src="4.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tf1">:مخاطب</div> 
 
\t \t <div class="pf1">فروشندگان، مدیران فروش و بازاریابان</div> 
 
\t \t <div class="tf1">:موضوع</div> 
 
\t \t <div class="pf1">روش های فروش، مذاکره، زبان بدن و ...</div> 
 
\t \t <div class="tf1">قیمت ویژه بسته: 49 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t5"></div> 
 
\t \t <div id="fifth">چکیده 45 کتاب کسب و کار</div> 
 
\t \t <div class="img1"> 
 
\t \t \t <img src="5.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tf2">:مخاطب</div> 
 
\t \t <div class="pf2">صاحبان کسب و کار و کارمندان</div> 
 
\t \t <div class="tf2">:موضوع</div> 
 
\t \t <div class="pf2">تمامی حوزه های بهبود فردی و کسب و کار</div> 
 
\t \t <div class="tf2">قیمت ویژه بسته: 49 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box2"> 
 
\t \t <div id="t6"></div> 
 
\t \t <div id="sixth">کتابخانه موفقیت برایان تریسی</div> 
 
\t \t <div class="img2"> 
 
\t \t \t <img src="6.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="ts1">:مخاطب</div> 
 
\t \t <div class="ps1">مدیران و کارآفرینان</div> 
 
\t \t <div class="ts1">:موضوع</div> 
 
\t \t <div class="ps1">مدیریت، رهبری و بازاریابی</div> 
 
\t \t <div class="ts1">قیمت ویژه دوره 7 جلدی: 45 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="footer"> 
 
\t \t <div id="m"> 
 
\t \t \t <div id="m1">مشاورین بازاریابی مدیر سبز</div> 
 
\t \t \t <div id="m2">تلفن: 88308732 فکس: 89783127</div> 
 
\t \t </div> 
 
\t \t <div id="s"> 
 
\t \t \t <div id="s1">سایت آموزش تخصصی بازاریابی و مدیریت</div> 
 
\t \t \t <div id="s2">www.ModireSabz.com</div> 
 
\t \t </div> 
 
\t </div> 
 
</body> 
 
</html>

+0

您的CSS包含无效的样式规则“width:50%px;”纠正它们并尝试。也许这可能会导致问题。 – 2014-09-22 07:27:58

+0

我这样做,但不能工作 – arezoo 2014-09-22 07:42:50

+0

您应该将百分比中的所有宽度替换为像素,并希望能够解决您面临的问题。 – 2014-09-22 08:02:29

回答

0

你可以给一个定义的宽度到人体那么你就不必去通过所有代码和更改百分比。 See this fiddle

请注意,我是如何在身体上添加一个宽度的,以及0自动的边距,因此它在较大的屏幕上居中。我也给框定义的宽度,以便他们正确地浮动。

body { 
    margin: 0 auto; 
    width: 960px; 
} 

.box1{ 
    float:right; 
    width: 480px; 
} 
.box2{ 
    float:left; 
    width: 480px; 
} 
0

我看了一下你的工作,我的建议是将所有的div标签包含到一个容器中,而不是试图将每个标签放在一起。从我收集的内容来看,你希望在所有屏幕尺寸上保持相同的外观和感觉?

如果是这样,那么你可以开始一些标记像这样:

.header{ 
 
\t width:100%; 
 
\t height:100px; 
 
\t background-color:green; 
 
\t margin-bottom:50px; 
 
\t margin-top:-10px; 
 
} 
 
#title{ 
 
\t color:white; 
 
\t font-size:50px; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin:20px; 
 
\t padding-right:50px; 
 
\t display:inline; 
 
} 
 
#wrapper { 
 
    width: 100%; 
 
    
 
} 
 
#wrapperbody { 
 
\t width: 100%; 
 
\t margin-left:auto; 
 
\t margin-right:auto; 
 
} 
 
.ms{ 
 
\t height:50px; 
 
\t width:15%; 
 
\t margin:20px; 
 
\t display:inline; 
 
} 
 
#pms{ 
 
\t color:white; 
 
\t margin:10px; 
 
\t font-weight:bold; 
 
\t font-size:23px; 
 
\t margin-left:60px; 
 
\t padding-top:3px; 
 
} 
 
#p{ 
 
\t color:black; 
 
\t font-size:9px; 
 
\t margin-left:60px; 
 
\t margin-top:-7px; 
 
\t font-weight:bold; 
 
} 
 
.box1{ 
 
\t 
 
\t min-width: 30%; 
 
\t max-width: 30%; 
 
\t display:inline-block; 
 
\t 
 
} 
 
.box2{ 
 
\t 
 
} 
 
.img1{ 
 
\t text-align:right; 
 
\t margin-bottom:30px; 
 
\t margin-top:30px; 
 
} 
 
.img2{ 
 
\t text-align:right; 
 
\t margin-bottom:30px; 
 
\t margin-top:30px; 
 
} 
 
#t1{ 
 
\t width:100%; 
 
\t height:10px; 
 
\t background-color:99FF00; 
 
\t 
 
\t 
 
\t top:50px; 
 
} 
 
#first{ 
 
\t font-weight:bold; 
 
\t font-size:30px; 
 
\t color:99FF00; 
 
\t 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tf{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t 
 
} 
 
.pf{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t2{ 
 
\t width:100%; 
 
\t height:10px; 
 
\t background-color:990066; 
 
\t 
 
\t 
 
\t top:50px; 
 
} 
 
#second{ 
 
\t font-weight:bold; 
 
\t font-size: 30px; 
 
\t color:990066; 
 
\t 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.ts{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:5px; 
 
} 
 
.ps{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t3{ 
 
\t width:100%; 
 
\t height:10px; 
 
\t background-color:003399; 
 
\t 
 
\t 
 
} 
 
#third{ 
 
\t font-weight:bold; 
 
\t font-size:30px; 
 
\t color:003399; 
 
\t 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tt{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t 
 
} 
 
.pt{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t4{ 
 
\t width:100%; 
 
\t height:10px; 
 
\t background-color:CC0000; 
 
\t 
 
\t 
 
} 
 
#fourth{ 
 
\t font-weight:bold; 
 
\t font-size:30px; 
 
\t color:CC0000; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tf1{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:5px; 
 
} 
 
.pf1{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t5{ 
 
\t width:100%; 
 
\t height:10px; 
 
\t background-color:59955C; 
 
\t margin-top:30px; 
 
} 
 
#fifth{ 
 
\t font-weight:bold; 
 
\t font-size:30px; 
 
\t color:59955C; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.tf2{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t margin-right:30px; 
 
} 
 
.pf2{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
#t6{ 
 
\t width:100%; 
 
\t height:10px; 
 
\t background-color:CCFF33; 
 
\t 
 
\t margin-top:30px; 
 
} 
 
#sixth{ 
 
\t font-weight:bold; 
 
\t font-size:30px; 
 
\t color:CCFF33; 
 
\t margin-right:30px; 
 
\t text-align:right; 
 
\t margin-top:30px; 
 
} 
 
.ts1{ 
 
\t font-size:20px; 
 
\t color:black; 
 
\t font-weight:bold; 
 
\t float:right; 
 
\t 
 
} 
 
.ps1{ 
 
\t font-size:20px; 
 
\t color:gray; 
 
\t font-weight:bold; 
 
\t text-align:right; 
 
} 
 
.footer{ 
 
\t clear:both; 
 
\t width:100%; 
 
\t height:100px; 
 
\t background-color:green; 
 
} 
 
#m{ 
 
\t float:right; 
 
\t margin-top:30px; 
 
\t color:white; 
 
\t margin-right:40px; 
 
} 
 
#m1{ 
 
\t font-size:20px; 
 
\t font-weight:bold; 
 
} 
 
#m2{ 
 
\t font-size:15px; 
 
\t font-weight:bold; 
 
} 
 
#s{ 
 
\t 
 
\t margin-top:30px; 
 
\t color:white; 
 
\t margin-left:40px; 
 
} 
 
#s1{ 
 
\t font-size:20px; 
 
\t font-weight:bold; 
 
} 
 
#s2{ 
 
\t font-size:29; 
 
\t font-weight:bold; 
 
}
<body> 
 
\t <div class="header"> 
 
\t \t <div id="title">فهرست بخشی از محصولات مدیر سبز</div> 
 
\t \t <div class="ms"> 
 
\t \t \t <p id="pms">مدیر سبز</p> 
 
\t \t \t <p id="p">مشاورین بازاریابی نوین</p> 
 
\t \t </div> 
 
\t </div> 
 
<div id="wrapper"> 
 
\t <div id="wrapperbody"> 
 
\t <div class="box1"> 
 
\t \t <div id="t1"></div> 
 
\t \t <div id="first"> رشد کسب و کار (سطح اول) </div> 
 
\t \t <div class="img1"> 
 
\t \t \t <img src="1.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tf">:مخاطب</div> 
 
\t \t <div class="pf">کارآفرینان، مدیران و صاحبان فروشگاه</div> 
 
\t \t <div class="tf">:موضوع</div> 
 
\t \t <div class="pf">بازاریابی، تبلیغات، مدیریت و توسعه کار</div> 
 
\t \t <div class="tf">قیمت ویژه بسته: 49 هزار تومان</div> 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t2"></div> 
 
\t \t <div id="second">رشد و کسب و کار (سطح دوم)</div> 
 
\t \t <div class="img2"> 
 
\t \t \t <img src="2.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="ts">:مخاطب</div> 
 
\t \t <div class="ps">کارآفرینان، مدیران و صاحبان فروشگاه</div> 
 
\t \t <div class="ts">:موضوع</div> 
 
\t \t <div class="ps">بازاریابی، تبلیغات، مدیریت و توسعه کار</div> 
 
\t \t <div class="ts">قیمت ویژه بسته: 59 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t3"></div> 
 
\t \t <div id="third">کسب و کار اینترنتی پیشرفته</div> 
 
\t \t <div class="img1"> 
 
\t \t \t <img src="3.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tt">:مخاطب</div> 
 
\t \t <div class="pt">صاحبان و مدیران وب سایت</div> 
 
\t \t <div class="tt">:موضوع</div> 
 
\t \t <div class="pt">بازاریابی با ایمیل سءو، بازاریابی اینترنتی</div> 
 
\t \t <div class="tt">قیمت ویژه بسته: 99 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t4"></div> 
 
\t \t <div id="fourth">فروشندگی حرفه ای</div> 
 
\t \t <div class="img2"> 
 
\t \t \t <img src="4.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tf1">:مخاطب</div> 
 
\t \t <div class="pf1">فروشندگان، مدیران فروش و بازاریابان</div> 
 
\t \t <div class="tf1">:موضوع</div> 
 
\t \t <div class="pf1">روش های فروش، مذاکره، زبان بدن و ...</div> 
 
\t \t <div class="tf1">قیمت ویژه بسته: 49 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t5"></div> 
 
\t \t <div id="fifth">چکیده 45 کتاب کسب و کار</div> 
 
\t \t <div class="img1"> 
 
\t \t \t <img src="5.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="tf2">:مخاطب</div> 
 
\t \t <div class="pf2">صاحبان کسب و کار و کارمندان</div> 
 
\t \t <div class="tf2">:موضوع</div> 
 
\t \t <div class="pf2">تمامی حوزه های بهبود فردی و کسب و کار</div> 
 
\t \t <div class="tf2">قیمت ویژه بسته: 49 هزار تومان</div> \t \t 
 
\t </div> 
 
\t <div class="box1"> 
 
\t \t <div id="t6"></div> 
 
\t \t <div id="sixth">کتابخانه موفقیت برایان تریسی</div> 
 
\t \t <div class="img2"> 
 
\t \t \t <img src="6.jpg" height="150" width="450" /> 
 
\t \t </div> 
 
\t \t <div class="ts1">:مخاطب</div> 
 
\t \t <div class="ps1">مدیران و کارآفرینان</div> 
 
\t \t <div class="ts1">:موضوع</div> 
 
\t \t <div class="ps1">مدیریت، رهبری و بازاریابی</div> 
 
\t \t <div class="ts1">قیمت ویژه دوره 7 جلدی: 45 هزار تومان</div> \t \t 
 
\t </div> 
 
    </div> 
 
    </div> 
 
\t <div class="footer"> 
 
\t \t <div id="m"> 
 
\t \t \t <div id="m1">مشاورین بازاریابی مدیر سبز</div> 
 
\t \t \t <div id="m2">تلفن: 88308732 فکس: 89783127</div> 
 
\t \t </div> 
 
\t \t <div id="s"> 
 
\t \t \t <div id="s1">سایت آموزش تخصصی بازاریابی و مدیریت</div> 
 
\t \t \t <div id="s2">www.ModireSabz.com</div> 
 
\t \t </div> 
 
\t </div> 
 
</body>
我的日子不好过,因为这不是在英语写,但我大部分管理。
你分开的原因是你有一些div浮动右边,有些浮动左边,最重要的是你没有包含它们。另外我修复了你的%和px错误。你不能同时渲染%和px,即(宽度:100%px;)。

希望这有助于你至少在正确的轨道:)

+0

我怎么能联系他们,为什么?我不知道那个:( – arezoo 2014-09-22 11:17:44

+0

不用担心它的简单给我第二个给你看一些代码:) – 2014-09-22 15:03:05

+0

代码现在发布:) – 2014-09-22 16:29:04

0

复制下面的代码开始,并把它作为一个工具,通过改变CSS部分得到你想要的结果。如果你仍然觉得你有更多的问题,我会很乐意帮助:)

/* YOUR CSS */ 
 

 
/* This will contain all of your content */ 
 

 
#wrapper { 
 
\t width: 100%; 
 
\t margin: 0; 
 
\t padding: 0; 
 
\t background-color: #fff; 
 
} 
 
/** This will keep everything contain inside 
 
    of this div tag <div id="body"></div> 
 
    at whatever width you choose and keep all of your 
 
    content center of the screen **/ 
 
#body { 
 
\t width: 990px; 
 
\t margin-left: auto; 
 
\t margin-right: auto; 
 
} 
 

 
/* LEFT SIDE CSS STARTS HERE */ 
 

 
/*Left Side Container */ 
 
#left_side { 
 
\t float: left; 
 
\t margin-top: 30px; 
 
\t width: 495px; 
 
} 
 

 
/* This changes the h1 tag */ 
 
#left_side h1 { 
 
\t color: #90C; 
 
\t padding-top: 10px; 
 
\t padding-left: 10px; 
 
\t text-align: left; 
 
} 
 

 
/* This changes any p tag */ 
 
#left_side p { 
 
\t color: #777; 
 
\t padding-left: 10px; 
 
\t text-align: left; 
 
} 
 

 
/* This changes the image tag */ 
 
#left_side img { 
 
\t width: 400px; 
 
\t padding-left: 10px; 
 
} 
 

 
/* RIGHT SIDE CSS STARTS HERE */ 
 
#right_side { 
 
\t float: left; 
 
\t margin-top: 30px; 
 
\t width: 495px; 
 
} 
 

 
/* This changes the h1 tag */ 
 
#right_side h1 { 
 
\t color: #06C; 
 
\t padding-top: 10px; 
 
\t padding-left: 10px; 
 
\t text-align: left; 
 
} 
 

 
/* This changes any p tag */ 
 
#right_side p { 
 
\t color: #777; 
 
\t padding-left: 10px; 
 
\t text-align: left; 
 
} 
 

 
/* This changes the image tag */ 
 
#right_side img { 
 
\t width: 400px; 
 
\t padding-left: 10px; 
 
}
<!-- YOUR HTML MARK UP--> 
 

 
<html> 
 
<body> 
 
<div id="wrapper"><!--This div tag will wrap all your content. Think of it as a big box--> 
 
    
 
    <div id="body"><!--This div will be my body and where I want to show my content--> 
 
    
 
    <!--LEFT CONTAINER STARTS HERE--> 
 
    <div id="left_side"> 
 
     <h1>Left Side</h1> 
 
     <p>The content I want to show on the left goes inside the div id="left_side" </p> 
 
     <img src="http://sectorvi.com/stackoverflow/test_image_a.jpg"> 
 
    </div><!-- div id="left_side" ENDS HERE--> 
 
    
 
    
 
    <!--RIGHT CONTAINER STARTS HERE--> 
 
    <div id="right_side"> 
 
     <h1>Right Side Side</h1> 
 
     <p>The content I want to show on the right goes inside the div id="right_side" </p> 
 
     <img src="http://sectorvi.com/stackoverflow/test_image_b.jpg"> 
 
    </div><!-- div id="right_side" ENDS HERE--> 
 
    
 
    
 
    </div><!--div id="body" ENDS HERE--> 
 
</div><!--div id="wrapper" ENDS HERE--> 
 

 
</body> 
 
</html>

如果你想知道如何让他们在我使用保证金左屏幕的中心设置:自动和利润率右:在我的CSS部分自动告诉页面将一切中心放在我身体div的左侧和右侧。

另请注意,我在左侧和右侧div都使用了float:left。这使div的堆栈彼此相邻。

+0

查看完整信息,请点击这里http://sectorvi.com/stackoverflow-arezoo.html – 2014-09-22 16:24:30

相关问题