Ensign Posted April 17, 2010 Share Posted April 17, 2010 I need to have an image for the index page, and another image for the rest of the site. How can I do it? Thank you for the help. Link to comment Share on other sites More sharing options...
razaro Posted April 17, 2010 Share Posted April 17, 2010 There are maybe better ways but this works.In global.css add two classes .bg1 {background:url("../img/bg1.jpg") repeat scroll 0 0 #FFF;} .bg2 {background:url("../img/bg2.jpg") repeat scroll 0 0 #CCC;} Obviously you need two background images bg1.jpg and bg2.jpg in img folder ,in your theme folder.And also check that body doesn't have background property.Looks something like this body { font-size: 11px; font-family: Verdana, Arial, Helvetica, Sans-Serif; color: #000; text-align:center; } Then edit header.tpl and replace body tag code with this <body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} {if $page_name == 'index'} class="bg1"{else}class="bg2"{/if}> Link to comment Share on other sites More sharing options...
Ensign Posted April 17, 2010 Author Share Posted April 17, 2010 In global.css add two classes .bg1 {background:url("../img/bg1.jpg") repeat scroll 0 0 #FFF;} .bg2 {background:url("../img/bg2.jpg") repeat scroll 0 0 #CCC;} Obviously you need two background images bg1.jpg and bg2.jpg in img folder ,in your theme folder.And also check that body doesn't have background property.Looks something like this body { font-size: 11px; font-family: Verdana, Arial, Helvetica, Sans-Serif; color: #000; text-align:center; } Then edit header.tpl and replace body tag code with this <body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} {if $page_name == 'index'} class="bg1"{else}class="bg2"{/if}> It works. Thank you very very much. Link to comment Share on other sites More sharing options...
rocky Posted April 17, 2010 Share Posted April 17, 2010 I suggest using the following: body#index { background: url('../img/bg-home.jpg') } body { background: url('../img/bg.jpg') } If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
Ensign Posted April 17, 2010 Author Share Posted April 17, 2010 I suggest using the following: body#index { background: url('../img/bg-home.jpg') } body { background: url('../img/bg.jpg') } If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Sorry, where do I put the body#index { background: url('../img/bg-home.jpg') } body { background: url('../img/bg.jpg') } Can I use this code for index page and the CMS page, and the rest use the default bg.jpg?And how do I edit the first post? Thank you for the help. Link to comment Share on other sites More sharing options...
razaro Posted April 17, 2010 Share Posted April 17, 2010 Thanks rocky for right solution. body#index { background: url('../img/bg-home.jpg') } You need to paste this line in global.css in your theme folder/css , at beginning.Similar for cms.So it look like similar to this * { padding:0; margin:0; } body#index { background: url('../img/bg-home.jpg') } body#cms{ background: url('../img/bg-cms.jpg') } body { background:url("../img/bg.jpg") ; font-size: 11px; font-family: Verdana, Arial, Helvetica, Sans-Serif; color: #000; text-align:center; } And to Edit button is under your post Link to comment Share on other sites More sharing options...
Ensign Posted April 17, 2010 Author Share Posted April 17, 2010 razaro and Rocky,It works. I just need to clear the cache and it works. Thank you for the great help. Link to comment Share on other sites More sharing options...
Raggy786 Posted July 7, 2010 Share Posted July 7, 2010 I suggest using the following: body#index { background: url('../img/bg-home.jpg') } body { background: url('../img/bg.jpg') } If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. how do i stop the background image to scroll? Link to comment Share on other sites More sharing options...
rocky Posted July 7, 2010 Share Posted July 7, 2010 In that case, use the following code: body#index { background: url('../img/bg-home.jpg') fixed } body { background: url('../img/bg.jpg') fixed } Link to comment Share on other sites More sharing options...
Raggy786 Posted July 7, 2010 Share Posted July 7, 2010 thats it it worked. Many thanks Link to comment Share on other sites More sharing options...
SonnyBoyII Posted June 23, 2011 Share Posted June 23, 2011 Hi,How can I have different backgrounds depending on category name or ids? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now