وسط چین کردن یک عکس یا باکس در css

Danial Sabagh

New Member
سلام به همهٔ دوستان
من می‌خوام یه عکس یا یه باکس رو وسط چین کنم با CSS، به طوری که در هر اندازه از مانیتور وسط چین باشه،


همچنین ۲ تا عکس دارم که می‌خوام هردو وسط چین باشن و 30px از هم فاصله داشته باشن، کسی‌ می‌تونه کد CSS رو بنویسه؟
 

pouya saadeghi

Active Member
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">

.father{text-align:center; width:260px; margin:0 auto;
 background:#999999; height:99px;}
.child_one,.child_two{ width:100px; margin:15px; float:left;}
.child_one{background:#99CC33;}
.child_two{background:#6699FF;}
</style>
</head>

<body>

<div class="father">

<div class="child_one">
<img src="http://forum.majidonline.com/images/icons/iconss/web/CSS.png"></div>


<div class="child_two">
<img src="http://forum.majidonline.com/images/icons/iconss/web/CSS.png"></div>

</div>

</body>
</html>
 

جدیدترین ارسال ها

بالا