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 07-12-2011, 02:37 PM   PM User | #1
Ludatha
Regular Coder

 
Ludatha's Avatar
 
Join Date: Jan 2008
Posts: 250
Thanks: 51
Thanked 5 Times in 5 Posts
Ludatha is an unknown quantity at this point
Background positioning driving me crazy!

Hey
I am struggling to get the background position to obey me, using top, bottom, left etc works, but when I start using px it doesn't do a thing.

I'm trying to combine all the images in my site.

Here is the development:
http://84.12.13.44/design/

http://84.12.13.44/design/images/lef...ation_text.png


http://84.12.13.44/design/images/link_images.png


Anybody help me solve this?
Ludatha is offline   Reply With Quote
Old 07-12-2011, 02:46 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Check http://jigsaw.w3.org/css-validator/v...44%2Fdesign%2F
Try it like
Code:
a.nav_genyx {width:62px; background-position:0 0}
a.nav_genyx:hover {background-position:0 100%}

a.nav_computers {width:101px; background-position:-62px 0}
a.nav_computers:hover {background-position:-62px 100%}
PS: Hope, you'll add some text inside the anchors for the search engines.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 07-12-2011 at 02:52 PM..
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
Ludatha (07-12-2011)
Old 07-12-2011, 02:50 PM   PM User | #3
Ludatha
Regular Coder

 
Ludatha's Avatar
 
Join Date: Jan 2008
Posts: 250
Thanks: 51
Thanked 5 Times in 5 Posts
Ludatha is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Does that mean I cannot use px in positioning and I'm forced to use percentages?
Ludatha is offline   Reply With Quote
Old 07-12-2011, 02:54 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by Ludatha View Post
Does that mean I cannot use px in positioning and I'm forced to use percentages?
Check the additions in my above post.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 07-12-2011, 03:05 PM   PM User | #5
Ludatha
Regular Coder

 
Ludatha's Avatar
 
Join Date: Jan 2008
Posts: 250
Thanks: 51
Thanked 5 Times in 5 Posts
Ludatha is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Check the additions in my above post.
Thanks for the help, but I can't seem to get the left navigation working, its vertical as opposed to horizontal:

Code:
.genyx_left_link {height:14px; background-position:0 0;}
.genyx_left_link:hover {height:16px; background-position:0 -85px;}
The only thing that happens is that the height increases by 2px.
Ludatha is offline   Reply With Quote
Old 07-12-2011, 03:11 PM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Change them to
Code:
a.genyx_left_link {height:14px; background-position:0 0;}
a.genyx_left_link:hover {height:16px; background-position:0 -85px;}
to override the specificity of .left_col_links a
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
Ludatha (07-12-2011)
Old 07-13-2011, 02:38 PM   PM User | #7
Ludatha
Regular Coder

 
Ludatha's Avatar
 
Join Date: Jan 2008
Posts: 250
Thanks: 51
Thanked 5 Times in 5 Posts
Ludatha is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
PS: Hope, you'll add some text inside the anchors for the search engines.
Just one last thing, how do I add text but make it invisible, I know about display:none, but that hides the image as well.
Ludatha is offline   Reply With Quote
Old 07-13-2011, 03:18 PM   PM User | #8
reyna12
New Coder

 
Join Date: Jan 2006
Posts: 88
Thanks: 4
Thanked 1 Time in 1 Post
reyna12 is an unknown quantity at this point
Quote:
Originally Posted by Ludatha View Post
Just one last thing, how do I add text but make it invisible, I know about display:none, but that hides the image as well.
Code:
text-indent: -99999px;
reyna12 is offline   Reply With Quote
Users who have thanked reyna12 for this post:
Ludatha (07-13-2011)
Old 07-13-2011, 03:53 PM   PM User | #9
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
You may set a large negative text-indent to the anchors to hide the text from normal users.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 07-13-2011, 04:11 PM   PM User | #10
Ludatha
Regular Coder

 
Ludatha's Avatar
 
Join Date: Jan 2008
Posts: 250
Thanks: 51
Thanked 5 Times in 5 Posts
Ludatha is an unknown quantity at this point
CSS is such a flawed language...
Thanks guys.
Ludatha 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:13 AM.


Advertisement
Log in to turn off these ads.