0

我的代码可以在 W3school 的 Tryit 编辑器上运行,但不能在浏览器上运行。

这是我的html:

<div align="center">
    <div class id="welcome">
        <iframe src="http://www.cartoonnetwork.com/games/adventuretime/righteousquest/game.swf" width="600" height="400" frameborder="0" marginheight="0" scrolling="no"></iframe><br/><br/>
        <h1>Adventure Time:Righteous Quest</h1>
    </div>
</div>  

这是我的CSS:

.welcome{    
    border:1px solid white;
    margin:0px;
    color:#000000;
    background:#ffffff;     
}

另外,我在没有 div align 的情况下尝试过它,它产生了相同的结果。

提前致谢!

4

2 回答 2

3

replace

 <div class id="welcome">

With

 <div class="welcome">

because you used class .welcome in css. if you want to use id , you need to define your css as #welcome.

于 2013-03-24T04:50:42.797 回答
0

The problem is in your html. You need to change:

<div class id="welcome">

to

<div class="welcome">

See Fiddle: http://jsfiddle.net/lflores/qWMHS/

于 2013-03-24T04:54:20.907 回答