-2

我想要我的博主的文本框,我可以在其中发布 Html - CSS 代码,用户可以复制它们。示例 =图片链接

我想使用的图像=图像

如果代码很小,我想要那个。它应该自动变成这样= Image

如果代码很长,它应该自动像这样= Image

当我尝试制作它并将代码粘贴到其中时,它变得很糟糕,你可以看到=看起来很糟糕

我的 CSS 代码:

#tbox1 {
    background:url(http://1.bp.blogspot.com/-i3AX6FFu9N8/UnYbGgMgYhI/AAAAAAAAA2k/SFv0kK7x6YI/s1600/Coding+Place+For+Blogger.png) no-repeat;
    width:500px;
    height:380px;
    margin:10px;
    padding:20px 40px;
    overflow:auto;
    word-wrap:nowrap;
    /*font styles*/
    font-family:'Open Sans', sans-serif;
    font-size:16px;
    /*1em*/
    color:#000000;
    line-height:20px;
}

代码

<div id="tbox1">Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code Testing The Code v</div>

你可以在 JsFiddle 上看到发生在我身上的事情 http://jsfiddle.net/e5nHr/

4

2 回答 2

0

如果您想拥有灵活的高度,您必须从背景中的图像中删除边框并将其插入到 css 代码中。

border: 4px solid #000;
border-radius: 1em;

那就是:http: //jsfiddle.net/fUaXL/

于 2013-11-03T20:20:37.400 回答
0

使用此代码:[http://jsfiddle.net/e5nHr/8/]

另一个问题是您使用了错误的图像,您应该只使用图像的橙色部分并使用 css 代码做边缘

于 2013-11-03T20:21:36.137 回答