ขอคำแนะนำเรื่อง css นิดหนึ่งครับ

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ขอคำแนะนำเรื่อง css นิดหนึ่งครับ

ขอคำแนะนำเรื่อง css นิดหนึ่งครับ

 พี่นิกครับ พอดีผมลองเขียน css ดูแล้วมันแสดงผลได้ตามที่ต้องการแล้วครับ

แต่ว่า ผมอยากเพิ่มอีกบรรทัด เป็นคำอธิบายใต้ภาพอ่ะครับ

css ที่เขียนครับ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.image_box {
    position: relative;
    padding-top: 3px;
    padding-right: 0;
    padding-bottom: 15px;
    padding-left: 0px;
}
.image_box img {
    background-color: #2e2e2e;
    padding: 9px;
    display: block;
    float: left;
    margin-top: 0px;
    margin-right: 5px;
    margin-bottom: 0px;
    margin-left: 5px;
}

 

ตอนเรียกใช้

<div class="image_box">

<img src="../images/gallery/resize/1.jpg" alt="basketball" width="150" height="150" />

<img src="../images/gallery/resize/2.jpg" alt="basketball" width="150" height="150" />

<img src="../images/gallery/resize/3.jpg" alt="basketball" width="150" height="150" />

<img src="../images/gallery/resize/4.jpg" alt="basketball" width="150" height="150" />

</div>

อยากให้มีคำอธิบายใต้ภาพด้วยครับไม่รู้ว่าจะเพิ่มคำสั่ง css ตรงไหนดี

ขอบคุณครับพี่



Cpuhost 06-11-2010 09:03:36

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1

css ขึ้นอยู่กับเราจะปรับใช้ ต้องกำหนดให้ รูปกับคำบรรยาย อยู่ใน div ตัวกัน ลองเอาตัวอย่างนี้ไปปรับใช้ดู

 
 
 
 

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<style type="text/css">
.img_box{
    position:relative;
    display:block;
    padding:3px 3px;   
    background-color:#CF9;
    width:640px;
}
.img_item{
    position:relative;
    margin:0px 5px;
    float:left;
    display:block;
    width:150px;   
}
.img_item img{
    position:relative;
    background-color:#CCF;
    clear:both;
    float:left;
}
.img_description{
    position:relative;
    margin-top:5px;
    background-color:#FC6;
    clear:both;
    float:left;
    width:150px;
    height:20px;
}
</style>
 
 
 
<div class="img_box">
 
<div class="img_item">
<img src="https://www.ninenik.com/images/logo_01_Sat.gif" width="150" height="150" />
<div class="img_description"></div>
</div>
<div class="img_item">
<img src="https://www.ninenik.com/images/logo_01_Sat.gif" width="150" height="150" />
<div class="img_description"></div>
</div>
<div class="img_item">
<img src="https://www.ninenik.com/images/logo_01_Sat.gif" width="150" height="150" />
<div class="img_description"></div>
</div>
<div class="img_item">
<img src="https://www.ninenik.com/images/logo_01_Sat.gif" width="150" height="150" />
<div class="img_description"></div>
</div>
<br style="clear:both;" />
 
</div>

 



Ninenik 06-11-2010






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ