subramani
subramani

Reputation: 1069

DIV with background image

We have applied the backgroud image(round corner image from web site) for DIV control. and then dynamically added more statement in DIV control.

How we will increase the height and width for the image?

Please give us some suggestions.

Upvotes: 0

Views: 70

Answers (2)

Ravi Jain
Ravi Jain

Reputation: 1482

Using javascript you can change the background-size.
Note - It's a CSS3 feature.

Within style tag

.div_class_name
 {
 background:url(img_flwr.gif);
 background-size:80px 60px;
 background-repeat:no-repeat;
 }

when content changes in div you can use the following syntax to change the size

document.getElementById("eleId").style.backgroundSize="60px 80px" ;

Upvotes: 0

Tallboy
Tallboy

Reputation: 13467

Try using css3

.div {
background: #eee;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

Or you will need to do all kinds of messy stuff like resizing the background image, or splitting them off into 'corners' and all that... a huge headache

Upvotes: 1

Related Questions