簡體   English   中英

HTML / CSS字體大小

[英]HTML/CSS Font size

我有個問題

我正在嘗試編輯一個具有滾動條的網站(行為就像倒瀑布一樣),該網站顯示數據庫中已記錄的事件(數據)...

我想更改滾動條的字體大小,我嘗試更改所有標簽,沒有任何更改。

這是CSS塊

<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>

這是滾動條,我沒有這樣做,它是由其他人制作的。

<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)
}

這是它如何在滾動條中設置消息

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
}

這是身體:

<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>

就像您在新的pausescroller(pausecontent,“ pscroller1”,“”,5000)中看到的一樣document.write(“
“)

pscroller1應該更改pausecontent的字體顏色和大小,但是它只會更改數據字體的樣式,盡管document.write(UNDEFINED)的返回數據工作正常,但是可以更改其大小,樣式和顏色

pscroller1不是HTML實體。 您無法像這樣設置樣式。

您可以向“ pscroller”添加ID或類,並設置其樣式

a{ -html實體

.someClass{ <-設計類的樣式

#someID{ <-設置ID的樣式

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM