LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-28-2006, 03:31 PM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Blog Entries: 7

Rep: Reputation: 32
HTML-Can I set the Background as a Link ?


Ok Guys..
Ive got this premade template..where the background of the header is set in the css file as in

header {
background url : (the image path)

}

now i want to make that image clickable i.e. assgin an link to it...Is it doable ?


Thx for suggestions
 
Old 07-28-2006, 03:47 PM   #2
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
A background image cannot take a click. You could use the JavaScript "onclick" attribute for whatever has the background-image style set, though. (No guarantees as to whether it will actually work or not, but it's the only thing you can do.)
 
Old 07-28-2006, 04:24 PM   #3
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Surely if you've got an image for a header you aren't going to have anything in front of it, so why not make the image a part of the header HTML rather than technically some style attribute, and then you could make it clickable like usual?
 
Old 07-28-2006, 05:20 PM   #4
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
Proud...I was actually trying not to mess with the html code... for no particular reason..but I checked google and found that the best way was just to remove the background image and use a typical IMG tag ..as you suggested...
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluxbox can't set background! humbletech99 Linux - Software 8 06-03-2006 06:58 PM
change the background for X windows and set to fill whole screen and set screen saver eatranman Linux - Newbie 2 05-10-2006 08:41 PM
custom HTML background for KDE using Nvu digitalhead Linux - Software 1 03-07-2005 07:59 PM
Icewm doesn't set background rickenbacherus Linux - Software 1 06-21-2004 04:11 PM
How to set different background in workspaces landranger Linux - General 5 05-15-2003 12:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration