将样式添加到div

时间:2014-05-04 13:20:40

标签: html css

我有一个div,我用它来使用colorbox插件显示它。 它工作正常!

但是我想在我的HTML中显示这个div,但是具有相同的风格。 (我不想要窗户变成白色的彩盒效果。只是风格对灯箱的影响)

像这样的东西

enter image description here

我知道这是CSS的内容,但我不太确定如何应用它。

感谢您的帮助

<div id='inline_content' style='padding:10px; background:#fff;'>
    <p><strong>This content comes from a hidden element on this page.</strong></p>
    <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
    <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>

    <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p>
    <p>Updating Content Example:<br />
    <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>

2 个答案:

答案 0 :(得分:1)

需要样式编辑。尝试添加border-bottom:和字体/颜色调整。我相信这就是你想要的:

<div id='inline_content' style='
        padding:10px; 
        background:#fff; 
        border-style:solid; 
        width:620px;
'><p><strong>This content comes from a hidden element on this page.</strong></p>
    <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
    <p><a id="click" href="#" style='
        padding:5px; background:#ccc;
        color:#2E9AFE; font-family:"ARIAL";
        text-decoration:none; border-bottom-style:solid;
        border-width:1px; font-size:15px;
    '>Click me, it will be preserved!</a></p><p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p>
    <p>Updating Content Example:<br />
    <a class="ajax" href="../content/ajax.html" style='
        color:#2E9AFE;
        font-family:"ARIAL";
'>Click here to load new content</a></p>
</div>

答案 1 :(得分:0)

需要添加所需的宽度和边框大小,颜色和样式......类似&#34; border-style:2px#000000 solid;宽度:700像素;&#34;

<div id='inline_content' style='padding:10px; background:#fff; border-style:2px #000000 solid; width:700px;'>
    <p><strong>This content comes from a hidden element on this page.</strong></p>
    <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
    <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>

    <p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p>
    <p>Updating Content Example:<br />
    <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>