css background img .. not so straight froward it seems?

This is a discussion on "css background img .. not so straight froward it seems?" within the Web Page Design section. This forum, and the thread "css background img .. not so straight froward it seems? are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 2nd, 2008, 20:50
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
css background img .. not so easy it seems?

I know how to add images/background images, but in this situation the hover efect has thrown me!..having problems.

If you take a look at this page you will find the css included, I will create separate doc once the page is done.

http://www.capoeiracanal.co.uk/index-home.php

The code bellow shows 2 ways in which an image has been added, for both methods I can's see how can I repeat it for a different img?

line 85-91

HTML: Select all
#hoverpage ul#outer li div em {display:block; width:190px; height:300px; float:left; background:transparent url(img/current5.gif) no-repeat; margin-right:10px;}

#hoverpage ul#outer li.p1 div em {background-position: 21px 25px;}
#hoverpage ul#outer li.p2 div em {background-position: 21px 50px;}
#hoverpage ul#outer li.p3 div em {background-position: 21px 75px;}
#hoverpage ul#outer li.p4 div em {background-position: 21px 100px;}
#hoverpage ul#outer li.p5 div em {background-position: 21px 125px;}


HTML: Select all
 #hoverpage ul#outer li div img {border:1px solid #888; float:left; margin: 0px 0px 0px -225px;}
then applying this to the html page.

HTML: Select all
<img src="img/Map2.jpg" alt="Map of Capoeira Canal's studio locations"/>
(I have just edited this post in the hope that I have made myself question clearer)

Thanks

Last edited by Oak; Mar 4th, 2008 at 19:42.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 3rd, 2008, 09:49
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: css background img .. not so straight froward it seems?

Quote:
This is how it has been done for one image, how can I repeat it for a different img?
I mean how do I apply another image with different styles?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 4th, 2008, 10:50
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: css background img .. not so straight froward it seems?

Can someone please give some feed back?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 4th, 2008, 11:37
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Re: css background img .. not so straight froward it seems?

I think no one has replied because they dont totally understand your question.

Please explain more clearly what you are trying to achieve Oak, because it confused me and most likely others.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 4th, 2008, 12:19
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: css background img .. not so straight froward it seems?

An image has been added using the the code bellow. I want to add an additional image but can not work out how.

I am thinking I need to change (em) and then repeat everything else?

HTML: Select all
 line 85-91

#hoverpage ul#outer li div em {display:block; width:190px; height:300px; float:left; background:transparent url(img/current5.gif) no-repeat; margin-right:10px;}

#hoverpage ul#outer li.p1 div em {background-position: 21px 25px;}
#hoverpage ul#outer li.p2 div em {background-position: 21px 50px;}
#hoverpage ul#outer li.p3 div em {background-position: 21px 75px;}
#hoverpage ul#outer li.p4 div em {background-position: 21px 100px;}
#hoverpage ul#outer li.p5 div em {background-position: 21px 125px;}
http://www.capoeiracanal.co.uk/index-home.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Mar 4th, 2008, 12:36
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Re: css background img .. not so straight froward it seems?

ok, it looks like you've gone down the one image for many nav items route.

This is avery good method to ensure flicker free navigation.

You wil need to edit your image current5.gif

Add on the additional new image portion.

Then
Code: Select all
#hoverpage ul#outer li.p6 div em {background-position: 21px 150px;}
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Mar 4th, 2008, 13:35
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: css background img .. not so straight froward it seems?

Unless I am misstaken this will only show the img on li.p6 (page 6) of the hover nav.

HTML: Select all
ul#outer li.p6
I can also add an image using this code bellow, but I still can not work out to
do it for more than one image on the same page.

#hoverpage ul#outer li div img {border:1px solid #888; float:left; margin: 0px 0px 0px -225px;}

Then placing the code bellow in the body:

HTML: Select all
<img src="img/map.jpg" alt="Map of Capoeira Canal's studio locations"/>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Mar 4th, 2008, 14:00
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Re: css background img .. not so straight froward it seems?

sorry, i misunderstood your code.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page looks straight in IE, FireFox makes everything look crooked. Simple Fix? BlackReef Web Page Design 5 Dec 20th, 2007 02:14
Using css to print straight to screen? nate2099 Starting Out 9 Apr 8th, 2007 08:14
Background or img? rubyfruit Web Page Design 7 Nov 9th, 2006 06:22
Background and Resolution compatibility, My background gets cut off Funion Web Page Design 1 Dec 4th, 2005 04:42
error message cant get straight monkboy12345 PHP Forum 1 Apr 15th, 2005 21:34


All times are GMT. The time now is 17:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42