ورود

View Full Version : یک سوالدر مورد css



akbari1377
سه شنبه 11 تیر 1392, 10:05 صبح
سلام به دوستان .
یک سوال داشتم .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/main.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class="header">
<p>به وبسایت نظر سنجی شهرداری قم خوش آمدید </p>
</div>
<div class="content">
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>

</div>
<div class="footer">
</div>
</body>
</html>
این هم فایل main.css
.header {
font-family: Tahoma, Geneva, sans-serif;
font-size: 24px;
background-image: url(../images/header.gif);
background-repeat: repeat-x;
margin: auto;
height: 113px;
width: 900px;
border: thin solid #000;
direction: rtl;
text-align: center;
}


.content {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
background-color: #FF9;
width: 900px;
border: thin solid #000;
direction: rtl;
margin-top: 5px;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
.poll {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
height: 171px;
width: 98%;
border: thin dotted #000;
direction: rtl;
background-color: #FFC;
margin: 5px;
}



.footer {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
background-image: url(../images/footer.jpg);
height: 57px;
width: 900px;
border: thin solid #000;
background-repeat: repeat-x;
direction: rtl;
margin-top: 5px;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
در این کد ها اگر دقت کنید 6 مستطیل زیر هم می اید . حالا من می خواهم بدونم چه جوری باید در هر ردیف 2 مستطیل آورد یعنی مجموعا 3 سطر ؟

parsboy
سه شنبه 11 تیر 1392, 10:27 صبح
باسلام دوست عزیز کدها رو مرتب بزار تا دوستان متوجه شوند:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.header {
font-family: Tahoma, Geneva, sans-serif;
font-size: 24px;
background-image: url(../images/header.gif);
background-repeat: repeat-x;
margin: auto;
height: 113px;
width: 900px;
border: thin solid #000;
direction: rtl;
text-align: center;
}


.content {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
background-color: #FF9;
width: 900px;
border: thin solid #000;
direction: rtl;
margin-top: 5px;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
.poll {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
height: 171px;
width: 98%;
border: thin dotted #000;
direction: rtl;
background-color: #FFC;
margin: 5px;
}



.footer {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
background-image: url(../images/footer.jpg);
height: 57px;
width: 900px;
border: thin solid #000;
background-repeat: repeat-x;
direction: rtl;
margin-top: 5px;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div class="header">
<p>به وبسایت نظر سنجی شهرداری قم خوش آمدید </p>
</div>
<div class="content">
<div class="poll">
</div>
<div class="poll">
</div>
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>
<div class="poll">

</div>


</div>
<div class="footer">
</div>
</body>
</html>
موفق باشید.

mehbod.rayaneh
سه شنبه 11 تیر 1392, 13:08 عصر
سلام
اینجوری :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.header {
font-family: Tahoma, Geneva, sans-serif;
font-size: 24px;
background-image: url(../images/header.gif);
background-repeat: repeat-x;
margin: auto;
height: 113px;
width: 900px;
border: thin solid #000;
direction: rtl;
text-align: center;
}


.content {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
background-color: #FF9;
width: 900px;
border: thin solid #000;
direction: rtl;
margin-top: 5px;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
.poll {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
height: 171px;
width: 98%;
border: thin dotted #000;
direction: rtl;
background-color: #FFC;
margin: 5px;
}

.poll2 {
height: 171px;
width: 50%;
background-color: red;
float:right
}
.poll3 {
height: 171px;
width: 50%;
background-color: blue;
float:left
}

.footer {
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
background-image: url(../images/footer.jpg);
height: 57px;
width: 900px;
border: thin solid #000;
background-repeat: repeat-x;
direction: rtl;
margin-top: 5px;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div class="header">
<p>به وبسایت نظر سنجی شهرداری قم خوش آمدید </p>
</div>
<div class="content">
<div class="poll">
<div class="poll2">

</div>
<div class="poll3">

</div>
</div>
<div class="poll">
<div class="poll2">

</div>
<div class="poll3">

</div>
</div>
<div class="poll">
<div class="poll2">

</div>
<div class="poll3">

</div>
</div>
</div>
<div class="footer">
</div>
</body>
</html>

موفق باشید.

akbari1377
چهارشنبه 12 تیر 1392, 07:56 صبح
آقا دستت درد نکنه عالی بود !