Hi,


Can you help me please, I am just a beginner in making website..my problem is when i use the ctrl+mouse scroll just like when you zoom-in or zoom-out your webpage, my webpage will be destroyed the background of my website will go to left side if i will zoom-in or zoom-out...here is the code

.samplebody{
	  background:url('images/port1.jpg');
	  background-size:1024px;
	  background-repeat:no-repeat;
	} 

 .samplediv{
           border:2px ridge;
	   border-radius:15px;
	   width:auto;
	   height:auto;	      	
   }

please help me.Thank you in advance and I'm hoping for your positive response.

Delete this row:

background-size:1024px;

Delete this row:

background-size:1024px;

Thank you for the reply sir,,, I tried it to remved but my background picture turns back to it's original size...could not occupy the whole background of my page....please help me sir thank you in advance and I'm hoping for your positive response.

You cannot control background size with CSS. Apparently, your problem kinda looks like position problem.

.samplebody{
	  background:url('images/port1.jpg');
	  background-size:1024px;
	  background-repeat:no-repeat;
          background-position: top center; /* Adjust the position yourself */
	}

Hope this help.

You cannot control background size with CSS. Apparently, your problem kinda looks like position problem.

.samplebody{
	  background:url('images/port1.jpg');
	  background-size:1024px;
	  background-repeat:no-repeat;
          background-position: top center; /* Adjust the position yourself */
	}

Hope this help.

Hello sir, Thank you for the reply...Okay i will try this sir and i will write again if i have doubt.more power to you always...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.