Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a button stay on the screen

Status
Not open for further replies.

purpleski

IS-IT--Management
Aug 14, 2002
112
FR
I think I posted the following to the wrong forum so my apologies.

I have the following which works perfectly for my image:

.clBar{
position:absolute;
width:10;
height:10;
background-color:#310031;
layer-background-color:#310031;
background-image: url "../images/headings/purpleskitop.jpg");
background-attachment: fixed;
background-position: top left;
background-repeat: no-repeat;
z-index: 0;
}

Can the image have a link attached to it?

Another question is there a way of doing the same thing with a button constructed from CSS? ie so it does not move. An example is on the same page now at
Thanks for your help.

Regards.
 
Hi!

You can have a link with an image like that:

Code:
<a href=&quot;home.htm&quot;><img src=&quot;button1.jpg&quot; width=&quot;160&quot; height=&quot;34&quot; border=&quot;0&quot; alt=&quot;HOME&quot;></a>

Cheers

frag

patrick.metz@epost.de
 
How do you insert it with in the CSS as the image only appears in the CSS.

The code you gave

<a href=&quot;home.htm&quot;><img src=&quot;button1.jpg&quot; width=&quot;160&quot; height=&quot;34&quot; border=&quot;0&quot; alt=&quot;HOME&quot;></a>

Is for a button apearing on the page, which of course I know how to do!

I need to apply a link to the button referenced in the CSS below purpleskitop.jpg&quot;

.clBar{
position:absolute;
width:10;
height:10;
background-color:#310031;
layer-background-color:#310031;
background-image: url &quot;../images/headings/purpleskitop.jpg&quot;);
background-attachment: fixed;
background-position: top left;
background-repeat: no-repeat;
z-index: 0;
}

is this possible?

regards


 
background-image: url &quot;../images/headings/purpleskitop.jpg&quot;);
 
What I need is this. The image in this case &quot;../images/headings/purpleskitop.jpg&quot; appears on the page exactly where I need it and is visible using the CSS code.

.clBar{
position:absolute;
width:10;
height:10;
background-color:#310031;
layer-background-color:#310031;
background-image: url &quot;../images/headings/purpleskitop.jpg&quot;);
background-attachment: fixed;
background-position: top left;
background-repeat: no-repeat;
z-index: 0;
}

I would then like the visitor to be able to click on the image and go the home page of the web for example.

Any ideas?

Regards


 
The original idea of CSS, I think, is for display properties only. If you want to show an image, you have to put it directly using <IMG> tag (which most of us know), or place it within another object such as body, frame, input button, table as well as it's cells, etc.

I usually do an old trick: create an object, then set the image up as it's background.
For example:
Code:
<Style>
.clBar{
position:absolute; 
width:10; 
height:10; 
background-color:#310031; 
layer-background-color:#310031; 
background-image: url(../images/headings/purpleskitop.jpg);
background-attachment: fixed;
background-position: top left;
background-repeat: no-repeat;
z-index: 0;
}
</style>

<table><tr><a href=&quot;[URL unfurl="true"]http://test.com&quot;><td[/URL] class=&quot;clBar&quot;></td></a></tr></table>
Or, you can do it using the help of javascript. Throw your problem in the javascript forum. There are tons of experts there.. uh.. count me out.

Cheers,
mansii
 
Mansii

Thanks for that. I will give it try

Regards

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top