473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Applying CSS Styles to Javascript Rollovers

Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.

I can NOT get the underline to show using this technique:

<A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="this.style.color='#000000' TEXT-DECORATION: none;"
href="#">Search</A>

This isn't the way I normally work - I use CSS styles applied to <a>
tags. I won't bother taking the time to explain why!

Any suggestions? Can various CSS styles (backgrounds, colors, borders,
etc) be applied to text using Javascript rollovers?

Thanks!

Jan 19 '07 #1
5 1849
Dinsdale wrote on 19 jan 2007 in comp.lang.javascript:
Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.

I can NOT get the underline to show using this technique:

<A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="this.style.color='#000000' TEXT-DECORATION: none;"
href="#">Search</A>

This isn't the way I normally work - I use CSS styles applied to <a>
tags. I won't bother taking the time to explain why!
So why should we bother at all?
Any suggestions? Can various CSS styles (backgrounds, colors, borders,
etc) be applied to text using Javascript rollovers?
Yes.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 19 '07 #2
I'm working within a web-based tool that creates e-learning web sites.
I can only edit snippets of code at a time, not the whole page.

I don't have access to the HEAD section of the page, to declare <style
type="text/css" media="screen">, nor do I have the ability to link to
external style sheets.

I only know a little Javascript, so adding formatting like this is
difficult. I've experimented with a variety of code, but can't get the
effect I to work.


Evertjan. wrote:
Dinsdale wrote on 19 jan 2007 in comp.lang.javascript:
Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.

I can NOT get the underline to show using this technique:

<A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="this.style.color='#000000' TEXT-DECORATION: none;"
href="#">Search</A>

This isn't the way I normally work - I use CSS styles applied to <a>
tags. I won't bother taking the time to explain why!

So why should we bother at all?
Any suggestions? Can various CSS styles (backgrounds, colors, borders,
etc) be applied to text using Javascript rollovers?

Yes.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 19 '07 #3
ASM
Dinsdale a écrit :
Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.

I can NOT get the underline to show using this technique:
perhaps without forgetting the ';' missing ?
and using correct JS term for your styles

<A style="COLOR: #000000; FONT-FAMILY: Arial, Helvetica;
FONT-SIZE: 12pt; TEXT-DECORATION: underline;"
onmouseover="this.style.color='#000000';
this.style.textDecoration = 'none';"
onmouseout=" this.style.color= '#000000';
this.style.textDecoration = 'underline';"
href="#">Search</A>
and better again :
<a style="text-decoration: underline; font-family: Arial, Helvetica;
font-size: 12pt; color: #000000;"
onmouseover="this.style.color = '#000000';
this.style.textDecoration = 'none';"
onmouseout=" this.style.color= '#000000';
this.style.textDecoration = 'underline';"
href="#">Search</a>

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 19 '07 #4
Dinsdale wrote on 19 jan 2007 in comp.lang.javascript:
Evertjan. wrote:
>Dinsdale wrote on 19 jan 2007 in comp.lang.javascript:
Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.

I can NOT get the underline to show using this technique:

<A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="this.style.color='#000000' TEXT-DECORATION: none;"
href="#">Search</A>

This isn't the way I normally work - I use CSS styles applied to
<atags. I won't bother taking the time to explain why!

So why should we bother at all?
Any suggestions? Can various CSS styles (backgrounds, colors,
borders, etc) be applied to text using Javascript rollovers?

Yes.
[Please do not toppost on usenet]
I'm working within a web-based tool that creates e-learning web sites.
I can only edit snippets of code at a time, not the whole page.

I don't have access to the HEAD section of the page, to declare <style
type="text/css" media="screen">, nor do I have the ability to link to
external style sheets.
<stylecan be set in the <body>, most browser types do not seem to
complain. It is not elegant, but with the constraints you accepted, ...

However you can always set inline CSS:

<span style='color:red;'>Your text bit</span>

You better start learning about CSS, and do Javascript later.
I only know a little Javascript, so adding formatting like this is
difficult. I've experimented with a variety of code, but can't get the
effect I to work.
??

Setting the style of an html element is quite possible,
but first you would have to know CSS rather well.

Try:

<http://w3schools.com/css/default.asp>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 19 '07 #5

Evertjan. wrote:
Dinsdale wrote on 19 jan 2007 in comp.lang.javascript:
Evertjan. wrote:
Dinsdale wrote on 19 jan 2007 in comp.lang.javascript:

Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.

I can NOT get the underline to show using this technique:

<A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="this.style.color='#000000' TEXT-DECORATION: none;"
href="#">Search</A>

This isn't the way I normally work - I use CSS styles applied to
<atags. I won't bother taking the time to explain why!

So why should we bother at all?

Any suggestions? Can various CSS styles (backgrounds, colors,
borders, etc) be applied to text using Javascript rollovers?

Yes.

[Please do not toppost on usenet]
I'm working within a web-based tool that creates e-learning web sites.
I can only edit snippets of code at a time, not the whole page.

I don't have access to the HEAD section of the page, to declare <style
type="text/css" media="screen">, nor do I have the ability to link to
external style sheets.

<stylecan be set in the <body>, most browser types do not seem to
complain. It is not elegant, but with the constraints you accepted, ...

However you can always set inline CSS:

<span style='color:red;'>Your text bit</span>

You better start learning about CSS, and do Javascript later.
I only know a little Javascript, so adding formatting like this is
difficult. I've experimented with a variety of code, but can't get the
effect I to work.

??

Setting the style of an html element is quite possible,
but first you would have to know CSS rather well.

Try:

<http://w3schools.com/css/default.asp>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Thanks, Everyone.

Jan 19 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme...
2
by: viveklinux | last post by:
Hi, Have a FAQ page , where have many sets of questions and answers. The questions need to be a different colour / style and the answers different. Was wondering is there a easy way to do this...
3
by: daitasri | last post by:
Hi I am creating a textbox dynamically on click of a button. I want to apply some styles to that textbox using a CSS file. How can i do that using javascript in a HTML page? The following is the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.