iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
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

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2004, 11:03 AM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default CSS Red Line Through?

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
Reply With Quote
  #2 (permalink)  
Old 02-23-2004, 12:04 PM
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: Western Australia
Posts: 1,336
matauri RepRank 0
Default

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!
Reply With Quote
  #3 (permalink)  
Old 02-23-2004, 04:30 PM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default Nope..sorry try again.

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
Reply With Quote
  #4 (permalink)  
Old 02-23-2004, 08:29 PM
WebProWorld 1,000+ Club
 
Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 1,527
mikmik RepRank 2mikmik RepRank 2
Default

... 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)
Reply With Quote
  #5 (permalink)  
Old 02-24-2004, 06:22 AM
ranjan's Avatar
WebProWorld Pro
 
Join Date: Sep 2003
Location: CA
Posts: 153
ranjan RepRank 0
Default

Quote:
a:hover { text-decoration: line-through #ff0000 ; color: #000000 ; }
This will never work!
__________________
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
Reply With Quote
  #6 (permalink)  
Old 02-24-2004, 10:17 AM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default Browsers

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
Reply With Quote
  #7 (permalink)  
Old 02-24-2004, 10:23 AM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default oh yeah..

Who can make it work in a a:hover?

Any takers?
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand
Reply With Quote
  #8 (permalink)  
Old 02-24-2004, 01:40 PM
ranjan's Avatar
WebProWorld Pro
 
Join Date: Sep 2003
Location: CA
Posts: 153
ranjan RepRank 0
Default

Quote:
Who can make it work in a a:hover?
Nobody can. Its because the a tag in question is a single HTML element. A single element cannot have two defined style colors at one time.

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
Reply With Quote
  #9 (permalink)  
Old 02-24-2004, 05:24 PM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default Thanks dude.

Yeah your right.. I'll have to eat it on this one. Thanks to all for the help.
__________________
"Design is so simple, that's why it is so complicated" - Paul Rand
Reply With Quote
  #10 (permalink)  
Old 02-24-2004, 10:14 PM
WebProWorld 1,000+ Club
 
Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 1,527
mikmik RepRank 2mikmik RepRank 2
Default

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?
Reply With Quote
  #11 (permalink)  
Old 02-25-2004, 02:24 AM
ranjan's Avatar
WebProWorld Pro
 
Join Date: Sep 2003
Location: CA
Posts: 153
ranjan RepRank 0
Default

Quote:
How about an empty absolutely positioned box over top that shows a line onMouseover and the text underneath shows a color change.
Yes When you mouse over the link, The positioned div appears on it. (A show div script.) As soon as the div appears, it will be over the link, so you mouse has actually moused out of the link and moused over the div (even if its pixel position hasn't changed). So now you have to have a function to change the style of the link to hover state when mouse is over the div.

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
Reply With Quote
  #12 (permalink)  
Old 02-26-2004, 06:05 AM
ranjan's Avatar
WebProWorld Pro
 
Join Date: Sep 2003
Location: CA
Posts: 153
ranjan RepRank 0
Default

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>
THE HTML
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
Reply With Quote
  #13 (permalink)  
Old 02-29-2004, 10:31 PM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default DUDE RANJAN ROCKS!!!...

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
Reply With Quote
  #14 (permalink)  
Old 03-01-2004, 06:04 AM
WebProWorld 1,000+ Club
 
Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 1,527
mikmik RepRank 2mikmik RepRank 2
Default

ctfitch wrote
Quote:
thanks for thinking. you proved yourself wrong.

Ranjan is the man!!!!!
I agree!!

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)
Reply With Quote
  #15 (permalink)  
Old 03-05-2004, 11:25 AM
WebProWorld Member
 
Join Date: Dec 2003
Location: ATL
Posts: 41
ctfitch RepRank 0
Default Ok..next step..

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
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

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



All times are GMT -4. The time now is 10:06 PM.



Search Engine Optimization by vBSEO 3.3.0