Modifier la couleur du texte dans un script
midnightweb
-
eric -
eric -
Bonjour,
Je souhaite utiliser un script dans une page web mais je voudrais changer la couleur du texte.
Je suis tout à fait débutante en la matière. Où dois-je modifier le code suivante pour que le texte s'affiche en couleur #ec7523 ?
Merci
Voici le code
<html>
<head>
<title>animation</title>
<link href="../../../../../../EasyPHP 3.0/www/activetech/system/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center" id="bienvenue">
</div>
<script>
<!--
i=0;
taille=0;
hauteur = (navigator.appName != "Microsoft Internet Explorer")? window.innerHeight : document.body.offsetHeight;
marge = hauteur/3;
document.getElementsByTagName('div')[0].style.marginTop = marge;
textanim = new Array("Texte d'accroche<br/> a definir");
function animation() {
document.getElementsByTagName('div')[0].style.fontSize = ""+taille+"px";
document.getElementById('bienvenue').innerHTML = textanim[i];
if (taille < 50) {
taille++;
}
else {
i++;
taille=0;
}
if (i < textanim.length) {
setTimeout('animation()',20)
}
}
setTimeout('animation()',20);
//-->
</script>
</body>
</html>
Merci d'avance
Je souhaite utiliser un script dans une page web mais je voudrais changer la couleur du texte.
Je suis tout à fait débutante en la matière. Où dois-je modifier le code suivante pour que le texte s'affiche en couleur #ec7523 ?
Merci
Voici le code
<html>
<head>
<title>animation</title>
<link href="../../../../../../EasyPHP 3.0/www/activetech/system/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center" id="bienvenue">
</div>
<script>
<!--
i=0;
taille=0;
hauteur = (navigator.appName != "Microsoft Internet Explorer")? window.innerHeight : document.body.offsetHeight;
marge = hauteur/3;
document.getElementsByTagName('div')[0].style.marginTop = marge;
textanim = new Array("Texte d'accroche<br/> a definir");
function animation() {
document.getElementsByTagName('div')[0].style.fontSize = ""+taille+"px";
document.getElementById('bienvenue').innerHTML = textanim[i];
if (taille < 50) {
taille++;
}
else {
i++;
taille=0;
}
if (i < textanim.length) {
setTimeout('animation()',20)
}
}
setTimeout('animation()',20);
//-->
</script>
</body>
</html>
Merci d'avance
Configuration: Windows Vista Firefox 3.0.8
3 réponses
-
si cette balise existe en css
essaie d'integrer dans ton html
<font color="#FFFFFF">ton texte</color>
je viens de tester ca marche-
Pas faux :-)
Entre temps j'ai trouvé ce que je cherchais, c'est à dire intégrer la couleur dans le script :
voilà le nouveau code :
<script>
i=0;
taille=0;
hauteur = (navigator.appName != "Microsoft Internet Explorer")? window.innerHeight : document.body.offsetHeight;
marge = hauteur/3;
document.getElementsByTagName('div')[0].style.marginTop = marge;
textanim = new Array("Texte d'accroche<br/> a definir");
function animation() {
document.getElementsByTagName('div')[0].style.fontSize = ""+taille+"px";
document.getElementsByTagName('div')[0].style.color = "#ec7523";
document.getElementsByTagName('div')[0].style.fontFamily = "arial";
document.getElementById('bienvenue').innerHTML = textanim[i];
if (taille < 50) {
taille++;
}
else {
i++;
taille=0;
}
if (i < textanim.length) {
setTimeout('animation()',20)
}
}
setTimeout('animation()',20);
//</script>
Merci -
CupidonAlien Bonsoir,
Je vois que tu connais les scripts. Je bataille avec celui ci je voudrais savoir comment faire pour changer la couleur du titre "Remplir la fiche de terrain" les sous menu j'y suis arrivé mais impossible pour le menu. Il reste en noir
<script type="text/javascript">
<!--
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
//-->
</script><style type="text/css" media="screen">
<!--
body {
margin: 0;
padding: 0;
font: 80% verdana, arial, sans-serif;
}
dl, dt, dd, ul, li {
margin: 0;
padding: 0;
list-style-type: none;
}
#menu {
width: 15em;
}
#menu dt {
cursor: pointer;
margin: 2px 0;;
height: 20px;
line-height: 20px;
text-align: center;
font-weight: bold;
border: 1px solid gray;
background: #d5def6 ;
}
#menu dd {
border: 1px solid gray;
}
#menu li {
text-align: center;
background: #fff;
}
#menu li a, #menu dt a {
color: #000;
text-decoration: none;
display: block;
border: 0 none;
height: 100%;
}
#menu li a:hover, #menu dt a:hover {
background: #eee;
}
--></style><!-- FIN DU CSS -->
<div id="menu">
<dl>
<dt onmouseover="javascript:montre('smenu1');">Remplir la fiche de terrain </dt>
<dd id="smenu1">
<ul>
<li><a href="https://www.observatoiremigrateurs.com/?Inscription">S'inscrire</a></li>
<li><a href="https://www.observatoiremigrateurs.com/">Saisir la fiche</a></li>
</ul>
</dd>
</dl>
</div>
Si tu peux m'aider je t'en remercie
Bonne soirée
Eric -
-
-
-
dans ton css
rajoute dans le body
font-color: #ec7523;
voila la ca marchera normalement -
de rien^^
chu la pour rendre service^^