473,549 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="th is.style.color= '#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="thi s.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 1869
Dinsdale wrote on 19 jan 2007 in comp.lang.javas cript:
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="th is.style.color= '#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="thi s.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.javas cript:
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="th is.style.color= '#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="thi s.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="th is.style.color= '#000000';
this.style.text Decoration = 'none';"
onmouseout=" this.style.colo r= '#000000';
this.style.text Decoration = 'underline';"
href="#">Search </A>
and better again :
<a style="text-decoration: underline; font-family: Arial, Helvetica;
font-size: 12pt; color: #000000;"
onmouseover="th is.style.color = '#000000';
this.style.text Decoration = 'none';"
onmouseout=" this.style.colo r= '#000000';
this.style.text Decoration = '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.javas cript:
Evertjan. wrote:
>Dinsdale wrote on 19 jan 2007 in comp.lang.javas cript:
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="th is.style.color= '#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="thi s.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:re d;'>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.javas cript:
Evertjan. wrote:
Dinsdale wrote on 19 jan 2007 in comp.lang.javas cript:

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="th is.style.color= '#000000'" style="FONT-SIZE: 12pt;
COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION:
underline;"
onmouseout="thi s.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:re d;'>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
3483
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 attribute. This works for the content pages, but it doesn't seem able to apply the styles to the top master page even though I did set the master head...
2
1640
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 as compared to enclosing each question and answer within divs ? Perhaps , through JavaScript. Thanks in advance ..
3
1863
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 code i am using . var cell2 = row.insertCell(1); var addRowTextNode2 = document.createElement('input'); addRowTextNode2.type = 'text'; ...
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7715
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.