简体   繁体   中英

HTML/CSS Font size

i have a problem

i'm trying to edit a website it has a scroller (behavior is like a inverted waterfall) the website shows events (data) already recorded in the database...

i want to change the font size of the scroller, i tried to change all the labels there and nothing.

this is the CSS block

<style type="text/css">

body {
font-family: "Engravers MT", "Engravers MT",sans-serif;
line-height: 1em;
color: #f0edd9;
font-weight:bold;
font-size: 40px;
background-color:#8A0829;
}
pscroller1{
width: 500px;  
height: 560px; 
font-family: "old republic", "old republic";
font-size:50px;
border: 1px solid black;
padding: 5px;
background: red;
}
</style>

this is the scroller, i didn't do that, it was made by someone else.

<script type="text/javascript">
var pausecontent=new Array() 
</script>


<script type="text/javascript">
function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and              pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div

document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative;        overflow: hidden"><div class="innerDiv" style="position: absolute;  width: 100%"   id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute;     width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after     0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

here is how it set the message in the scroller

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

this is the body:

<body>
<!--<div align="center">
<img src="picture1.fw.png" align="absmiddle"/>
</div>
!-->
<div align="LEFT" style="width:1000px "> 
<div style="height:570px; width:50%; float:right; background-color:#8A0829">

<?php
require_once('functions.php'); 
$phparray=events();
for($i=0; $i <count($phparray); $i++ )
        {
     echo '<script language="JavaScript"> pausecontent['.$i.'] = "'.$phparray[$i].'";</script>';    
        } 
?>

<script type="text/javascript" >
document.writeln("EVENTS")
new pausescroller(pausecontent, "pscroller1", "", 5000)
document.write("<br />")
function refresh(time) {setTimeout("location.reload(true);",time);}
refresh(43200000);   </script>

</div>
</div>
<div align="right"> EVENTS</div>
<div align="center" style="height:570px; width:300px; float:LEFT; background-    color:#8A0829">

<embed src="video.vob" autostart="true" loop ="true" width="500" height="570" > 

</div>
</div>
<div align="center">
<img src="background.jpg" align="absmiddle"/>
</div>
</body>

like you can see in the new pausescroller(pausecontent, "pscroller1", "", 5000) document.write("
")

the pscroller1 should change the font color and size of the pausecontent but it does only change the style of the font of the data, although the return data of document.write (UNDEFINED) is working fine, it's size, style and color can be changed

pscroller1 is not an html entity. You cannot style it like that.

You can add an ID or a class to the 'pscroller' and style that

a{ <- html entity

.someClass{ <- styling a class

#someID{ <- styling an ID

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM