Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-09-2011, 08:24 AM   PM User | #1
shayol
New to the CF scene

 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
shayol is an unknown quantity at this point
[Help] Css

Hello, i'm new on codig with html/css and i need a little help.

I want to know how can i do this image, It's a white/grey image check:



This is the site where i saw it: www.cloudflare.com if you click on menu the image will appear.

Thanks if someone will help me,

Cheers
shayol is offline   Reply With Quote
Old 09-09-2011, 09:03 AM   PM User | #2
LearningCoder
Regular Coder

 
LearningCoder's Avatar
 
Join Date: Jan 2011
Location: The Pleiades
Posts: 849
Thanks: 67
Thanked 28 Times in 28 Posts
LearningCoder is an unknown quantity at this point
I'd go over to http://www.dynamicdrive.com , if you have a little look around there, you will find something very similar to this.

Regards,

LC.
LearningCoder is offline   Reply With Quote
Old 09-09-2011, 09:19 AM   PM User | #3
vikram1vicky
Regular Coder

 
Join Date: Jul 2011
Location: India
Posts: 496
Thanks: 3
Thanked 57 Times in 56 Posts
vikram1vicky is an unknown quantity at this point
You can add background-image property on hover state of navigation, following is sample

Code:
#navi ul li a:hover {
background:url(images/bg_img.png) center no-repeat;
}
vikram1vicky is offline   Reply With Quote
Old 09-09-2011, 10:17 AM   PM User | #4
shayol
New to the CF scene

 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
shayol is an unknown quantity at this point
Quote:
Originally Posted by vikram1vicky View Post
You can add background-image property on hover state of navigation, following is sample

Code:
#navi ul li a:hover {
background:url(images/bg_img.png) center no-repeat;
}
Yes thanks, but the problem is that this is a fixed image no? I think that the image must change in base at the number of the chars of the menu. "Help" "Registration" etc...
shayol is offline   Reply With Quote
Old 09-09-2011, 12:04 PM   PM User | #5
vikram1vicky
Regular Coder

 
Join Date: Jul 2011
Location: India
Posts: 496
Thanks: 3
Thanked 57 Times in 56 Posts
vikram1vicky is an unknown quantity at this point
use only 1 in which lengthiest text can fit
vikram1vicky is offline   Reply With Quote
Old 09-09-2011, 03:09 PM   PM User | #6
LearningCoder
Regular Coder

 
LearningCoder's Avatar
 
Join Date: Jan 2011
Location: The Pleiades
Posts: 849
Thanks: 67
Thanked 28 Times in 28 Posts
LearningCoder is an unknown quantity at this point
I saw a very similar example over on DynamicDrive the only difference was that rather than the 'border' changing on click, it changed on hover. If you take the time to look for the effect all you would need to do is change the code slightly for your needs.

Regards,

LC.
LearningCoder is offline   Reply With Quote
Old 09-09-2011, 09:45 PM   PM User | #7
mathew edison
New Coder

 
Join Date: Nov 2007
Posts: 38
Thanks: 5
Thanked 0 Times in 0 Posts
mathew edison is an unknown quantity at this point
http://www.alistapart.com/articles/slidingdoors/

This will also apply to your menu.
mathew edison is offline   Reply With Quote
Old 09-09-2011, 10:13 PM   PM User | #8
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
I like using sprite images for image-based menu changes.

You load one image and to use as a background image for all menu items, but it is a grid-oriented composite of each individual image you would have otherwise needed. Then you just use different background-position settings for each item and then on :hover you change the background-position again to show the "hovered" state of that same single image file.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:48 AM.


Advertisement
Log in to turn off these ads.