How to float 2 image hyperlinks on same line

This is a discussion on "How to float 2 image hyperlinks on same line" within the Web Page Design section. This forum, and the thread "How to float 2 image hyperlinks on same line are both part of the Design Your Website category.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 1st, 2007, 18:01
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
How to float 2 image hyperlinks on same line

I have an image that i have created for a next button and a previos button.

I would like them on the same line but opposite ends of the div but all i have got it to do is move to opposite sides but not on the same line.

What am I doing wrong?

CSS

Code: Select all
 
#page .left {
   float: left;
}
#page .right {
   float: right;
}
HTML

Code: Select all
 
<div id="page">
    <a href="helmet.htm"><img class="prev" src="../images/prev1.png" alt="Previous" /></a>
    <span  class="right"><a href="lorica.htm"><img src="../images/next1.png" alt="Next" /></a></span>
 </div>
Reply With Quote

  #2 (permalink)  
Old Apr 1st, 2007, 18:03
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: How to float 2 image hyperlinks on same line

All fixed now.....duh!!
Reply With Quote
  #3 (permalink)  
Old Apr 2nd, 2007, 13:19
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to float 2 image hyperlinks on same line

And how did you fix it?
Reply With Quote
  #4 (permalink)  
Old Apr 2nd, 2007, 14:10
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: How to float 2 image hyperlinks on same line

Like this

Code: Select all
 
<div id="page">
    <a href="jars.htm"><img class="left" src="../images/prev1.png" alt="Previous" /></a>
    <span class="right"><a href="coffin.htm"><img src="../images/next1.png" alt="Next" /></a></span>
 </div>
Code: Select all
 
.left {
   float: left;
}
.right {
   float: right;
}
Reply With Quote
  #5 (permalink)  
Old Apr 2nd, 2007, 14:13
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: How to float 2 image hyperlinks on same line

BTW is there a way you can use 2 images (1 for rollover) without using Javascript?

I have 2 of the same image but don't know how to have it so it displays the other image on hover
Reply With Quote
  #6 (permalink)  
Old Apr 2nd, 2007, 14:20
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to float 2 image hyperlinks on same line

Of course! Pure CSS rollovers without Javascript
Reply With Quote
  #7 (permalink)  
Old Apr 2nd, 2007, 14:30
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to float 2 image hyperlinks on same line

CSS pseudo-classes such as hover, visited, and active give you javascript-type control. All you can do is change the css, but since you just want a to change appearance . . . '

The most efficient way to do it is to make a button in CSS and then change the border, color, etc. on hover. You can do a good 3D rollover with this.

If you want an image, just set the background to the image with repeat-no, then change the image with pseudo-classes.

You can do both javascript and css on the same button, say for example if you want a popup window if the browser has js, and a link to the window url if he doesn't. The js "this.class" will take precedence over the pseudo-class.

Last edited by masonbarge; Apr 2nd, 2007 at 14:35.
Reply With Quote
Reply

Tags
float, hyperlinks, images

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
Image float misbehaving in IE vs FF andym01480 Web Page Design 2 Feb 19th, 2008 21:37
On-line image stock library Brian A Starting Out 20 Apr 9th, 2007 19:21
Image hyperlinks AdRock Web Page Design 5 Mar 29th, 2007 01:46
Problems with float:left float:right nvidiajoe Web Page Design 8 Nov 17th, 2006 20:24
Image float problem timmytots Web Page Design 6 Jul 8th, 2006 13:40


All times are GMT. The time now is 21:20.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs 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 43