|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Dig it. I'm working on a new site. I need the a:hover in the CSS to line through in red(with black text.) I have seen it done in Flash..thats easy. I need it to work in HTML/CSS.. Anyone have a nice clean coded solution? I have been experimenting with the following code to try and get it to work.
Basically using the inline command to try and define a certain values of the css style I'm working on. End result should be: black underlined text as the a:link. and the a:hover should be black text with a red line through. I've gotten pretty close tweaking the inline stye around. still no avail. Ex code: p { display: inline; } p.lthrough { text-decoration: line-through; color: #000; } p.lthrough span { color: #900; } ---- This looks to have more possibility? </p> <p class="lthrough"> <span> ?</span> </p> This is a test. </p> Any takers???..when im done if I can get it.. It will look slick and I will make the CSS publicly available for all to download.
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand |
|
|||
|
Is there any reason why you aren't putting it in your a:hover css tag? I havent tried it physically, but it would seem to me that it would be something like:
a:link { text-decoration: underline ; color: #000000 } a:hover { text-decoration: line-through #ff0000 ; color: #000000 ; } I could be wrong. Have never thought of trying it. Cindy
__________________
Web Development Community ::: Forum ::: Library It' time for Progressive Web & IT Development! |
|
|||
|
If it were that easy I would have been done already.
Your code is perfect.. ideally. but the black text with the red line through is the tricky part. Thanks for your help. I will keep you posted.
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand |
|
|||
|
... need ... more ... info ..*gasp*...please .. INFO, help me...
What browser are you viewing it in? What DTD, and Charset are you declaring (prob charset doesn't matter), and mainly, is your declaration LAST in your css, and maybe try adding " !important " to it. I am starting to see that this !important gets rid of some inheritance issues, and makes the bloody browser kmow who is boss! please update, I am very interested as to the outcome :O) |
|
||||
|
Quote:
__________________
ranjan | Macromedia Certified Dreamweaver MX Developer http://www.dreamlettes.net - a dreamweaver resource http://www.ranjan.ws - got blog? http://www.total-impact.com - a web design community |
|
|||
|
DIG THIS!:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <del><span>This works!</span></del> <style type="text/css"> del {text-decoration: line-through; color: #900; } del span {color: #000;} </style> </body> </html> Yeah!. This rocks. I knew it could be done. Anyone have any tips on changing the color fo the red. I tried to no avail.
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand |
|
||||
|
Quote:
One could make a javascript/dom based script to do it. But it would not be worth the weight the javascript would carry for the miniscule task. My suggestion would be to forget it. Think something else.
__________________
ranjan | Macromedia Certified Dreamweaver MX Developer http://www.dreamlettes.net - a dreamweaver resource http://www.ranjan.ws - got blog? http://www.total-impact.com - a web design community |
|
|||
|
How about an empty absolutely positioned box over top that shows a line onMouseover and the text underneath shows a color change.
I really need some sleep. Is that what you are trying to do, have a different colored 'line-through' from the text it is on? |
|
||||
|
Quote:
When you mouse out the div, you have to reset the link to its original state and hide the div itself. Too much scripting for a tiny little task. Like I said it can be done, but its not worth doing it.
__________________
ranjan | Macromedia Certified Dreamweaver MX Developer http://www.dreamlettes.net - a dreamweaver resource http://www.ranjan.ws - got blog? http://www.total-impact.com - a web design community |
|
||||
|
I did it! With Pure CSS!!
THE CSS Code:
<style type="text/css">
<!--
a:link {
color: #333333;
text-decoration: underline;
}
a:visited {
color: #333333;
text-decoration: underline;
}
a:hover {
color: #FF0000;
text-decoration: line-through;
}
a:active {
color: #333333;
text-decoration: underline;
}
.blktxt {
color: #333333;
}
-->
</style>
See it in action: http://ranjan.ws/scripts/csslinethrough.htm
__________________
ranjan | Macromedia Certified Dreamweaver MX Developer http://www.dreamlettes.net - a dreamweaver resource http://www.ranjan.ws - got blog? http://www.total-impact.com - a web design community |
|
|||
|
Dude that was awesome. Very nice!!! hadnt thought of that.. Very smooth "Mr. Negative" :)
quote: "My suggestion would be to forget it. Think something else." thanks for thinking. you proved yourself wrong. Ranjan is the man!!!!! I'll post the link for the porject when I'm done.. you guys will like it..super cool html/dhtml/css site. im mocking flash and doing a super slick html site that makes you think its Flash.. wicked.
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand |
|
|||
|
ctfitch wrote
Quote:
I admire those of us that check out our own assertions to see if we are right, and also those that will not quit until they know, and also admit it when they get a solution. We are all about learning, yes? Anyway, the old '<span> on hover' trick! How many times do I use it for tooltips on menus. haha. Good one, ranjan. :O) |
|
|||
|
Allright guys..Ranjan clearly proved that the red line through can be done.
Challenge #2.. Make the red line stick as the a:visited.. So essentially all the links would be scratched out in red after you've clicked them. Who's down?
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |