Click to See Complete Forum and Search --> : Link rollover color


zerohdog
01-03-2003, 10:02 PM
I have one word that is a link where I set the style to text-decoration:none to avoid the underline on the link , but what I want to happen is to have only the background area behind the text change to a different color. For example the area behind the text to originally be only white, then change the background area ONLY ON THE TEXT to be #66666. Is this possible, if so, please help. I am using Dreamweaver MX if that matters. Any assistance would be appreciated.

Andrea

pyro
01-03-2003, 10:40 PM
If I understood you correctly, here is some code that will do what you want.

<html>
<head>
<style>
A.links:hover {
background-color: #666666;
text-decoration: none;
}
</style>
</head>
<body>
<a href="#" class="links">test link</a>
</body>
</html>

zerohdog
01-04-2003, 09:23 AM
Egads, thats it! It works, its amazing, I even did it first try! Okay, okay, I just wanted to thank you for posting the solution to my problem so quickly and so perfectly. Thanks again.

Andrea

zerohdog
01-04-2003, 09:25 AM
Forgot to ask, if I apply CSS to my text will this work also? And can you have one kid of CSS for your original text and another CSS text style for your rollover text?

If so, then I'd love to see some more sample text.

Andrea

pyro
01-04-2003, 09:39 AM
Certainly. Take a look at this code. Is this what you are looking for?

<html>
<head>
<style>
A.links:hover {
background-color: #666666;
text-decoration: none;
}
.text {
color:black;
background-color:lightblue;
}
</style>
</head>
<body>
<div class="text">Here is some text, and a <a href="#" class="links">test link</a></div>
</body>
</html>

If you don't want the lightblue background go all the way across the screen, you will have to set the width, something like this...

width:200px;
That will go in .text.

zerohdog
01-04-2003, 10:47 AM
worked wonderfully, will have to work on setting the pixel width though for the background color. Thanks again.

This is unrelated to the above but was wondering if you knew if there is a way to load a .txt file into a certain area in dreamweaver or some kind of handcoding that will load a .txt file into a certain table. Problem is I don't want to have to create a recordset or any type of testing server. Is it possible to just do this by some coding?

Thanks in advance...then I won't bug you anymore! At least not today. Ha.

pyro
01-04-2003, 11:06 AM
Originally posted by zerohdog
This is unrelated to the above but was wondering if you knew if there is a way to load a .txt file into a certain area in dreamweaver or some kind of handcoding that will load a .txt file into a certain table. Problem is I don't want to have to create a recordset or any type of testing server. Is it possible to just do this by some coding?
I'm not exactly sure what you mean. If you mean load a .txt file from your HDD into the page, I hesitate to say, because it is more of a hack than anything... What are you looking to do? If you just want content to show up on each page, you can use SSI or PHP (this does require a server, however.) Maybe you could explain what you need to do.

zerohdog
01-04-2003, 11:25 AM
I have this web page I'm working on and there is a table area that I want a text file (.txt) to load into that area when the web page loads. (instead of updating the actual web page, all I have to do is have someone update the .txt file. I am such a newbie at the database stuff that I just cant seem to get my Dreamweaver settings right to set up my recordset and my server info (I have to set it up to my online host server...ugh) so I was wondering if there was just some kind of code I could just tell the page to load a text file into a certain area of the web page. Its a site for my mother's photography and I want her to be able to update her text herself without having to do anything but a text file. I hope this clarifies it some. Thanks.

pyro
01-04-2003, 11:37 AM
Yes, that clarifies a lot. Ok, here is the easiest way to do that, if the server you are using supports PHP.

1. Rename all you pages to .php.

2. Insert these lines where you want the content to be
<?php
include ('test.txt');
?>

3. Edit .txt file to change content on your pages.

Hope that helps you. If you don't have PHP it can be done with SSI, as well

<!--#include file="test.txt"-->

with pages renamed to .shtml

zerohdog
01-04-2003, 11:47 AM
You are generous with your time and help. A real wealth of information! Thanks again, that is exactly what I wanted. I will try it out tonight! Thanks again.

pyro
01-04-2003, 11:54 AM
You bet. If there is anything else, I'd be glad to help.