Login | Register | FAQ
Anonymous

background image and colour

+ Post a reply

6 posts Page 1 of 1


background image and colour

by sandeepsrivastav » Mon Jul 02, 2012 4:45 pm

can we add background color and image simultaneously in a html document?
and can we customize the position of the background image in the document?
User avatar

sandeepsrivastav

  • Posts: 1
  • Joined: Mon Jul 02, 2012 4:41 pm

Re: background image and colour

by jessedotnet » Tue Jul 03, 2012 6:32 pm

yes, you can have a background image and colour. The color shows when the image is not available. I know of no way to position the background image but perhaps you could get creative: make the image the background of a big div which you position where you want. Then put all the content of your page in the div. Just a thought, I haven't actually tried it.
User avatar

jessedotnet

  • Posts: 20
  • Joined: Thu Jun 07, 2012 7:04 pm

Re: background image and colour

by XainPro » Wed Jul 04, 2012 7:06 am

Yes You can we add background color and image simultaneously in a html document.
like this
Code: Select all
body {background:#ffffff url('img_tree.png') no-repeat right top;}

and Yes You can customize the position of the background image in the document like this
Code: Select all
body
{
background-image:url('smiley.gif');
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}


you can use following position in place of center

left top
left center
left bottom
right top
right center
right bottom
center top
center center
center bottom
User avatar

XainPro

  • Posts: 3616
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: background image and colour

by worrall » Sat Aug 25, 2012 11:54 am

Yes you can add background image for that simply take an body element and write the following codes, you will find it simple after doing this kind of exercises.
background-image:url('abc.gif');
//this will be image url
background-color:#cccccc;
//#cccccc is colour code of the background.
User avatar

worrall

  • Posts: 10
  • Joined: Fri Aug 24, 2012 1:03 pm

Re: background image and colour

by XainPro » Sat Aug 25, 2012 7:03 pm

yes i do agree with worrall.
User avatar

XainPro

  • Posts: 3616
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: background image and colour

by XainPro » Mon Aug 27, 2012 5:08 am

Lolz @ cubesqure
its worrall's 1st post and he is trying to help although i have already answered in very detail above but we should encourage new comers to help each other !
-XainPro
User avatar

XainPro

  • Posts: 3616
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1

?>