Skip to content Skip to sidebar Skip to footer

Adding A Caption To A Div That Already Contains Content

I have a small slider within a 200px by 200px div. However what I would really love is to have a 100px by 20px caption box in the top right hand corner with a colored background an

Solution 1:

Try this:

Add to CSS

.slider2 { position: relative; }

.caption-box {
  position: absolute;
  right: 0;
  height: 20px;
  width:100px;
  background-color: red; // change to suit
  color: #fff; // change to suit
}

Your HTML changed:

<divclass="caption-box">Caption</div><!-- added this --><divclass="slider2"><imgsrc="client9.jpg"height="200"width="200" /><imgsrc="client10.jpg"height="200"width="200" /><imgsrc="client11.jpg"height="200"width="200" /><imgsrc="client2.jpg"height="200"width="200" /></div>

Post a Comment for "Adding A Caption To A Div That Already Contains Content"