Click here to Skip to main content
15,944,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
My css file's code is:
HTML
.banner3{
	background:url(../images/bnr3.jpg) no-repeat 0px 0px;
	background-size:cover;
	min-height:585px;
}


and i want to change
HTML
"url(../images/bnr3.jpg)"
this links from asp.net dynamically.is it possible? and how can i do it?

What I have tried:

web searching and some bad try
Posted
Comments
Andy Lanng 2-Mar-16 4:02am    
I don't understand the issue. Why can't you change it? what do you want to change it to?
Member 10525430 2-Mar-16 4:04am    
"../images/bnr3.jpg"
i want to change the pictures from different one when the websites works.and the picture url is in the css files
F-ES Sitecore 2-Mar-16 7:04am    
You'll have to add an in-line style to the element, so if it's a div

<div class="banner3" style="background:url(properUrlHere)">

How you do that depends on your markup and if it's webforms or mvc.

1 solution

You can try this way

CSS
.banner3{
	background:url(../images/bnr3.jpg)!important;
	background-size:Inherit !important;
	min-height:0 !important;
}
 
Share this answer
 
Comments
Member 10525430 2-Mar-16 4:15am    
when i write !important i cant change the url.i want to change the url dynamicly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900