Hello everyone and good evening,
大家好,晚上好,
The text inside the DIV is too close to the DIV border. How can I create space so the text is a little bit further from the border?
DIV内的文本太靠近DIV边界。如何创建空间以使文本离边界更远一点?
Thank you so much
非常感谢
Below you can find my css and you can also find an example on my website so you know what I am talking about. Thank you again.
下面你可以找到我的CSS,你也可以在我的网站上找到一个例子,这样你就知道我在说什么。再次感谢你。
.text {
background-color: #F1F1F1;
width: 600px;
margin: auto;
border: 1px solid #73AD21;
padding-top: -50px;
padding-right: -60px;
padding-bottom: -50px;
padding-left: -20px;
}
pre {
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
2 个解决方案
#1
2
Just give padding: 15px;
.
只需填充:15px;。
.text {
background-color: #F1F1F1;
width: 600px;
margin: auto;
border: 1px solid #73AD21;
padding: 15px;
}
You can increase the padding as you wish (i.e. padding: 20px
).
您可以根据需要增加填充(即填充:20px)。
#2
0
Add a little padding inside the div, that should do it for you.
在div中添加一个小填充,应该为你做。
.div {
padding: 10px;
}
#1
2
Just give padding: 15px;
.
只需填充:15px;。
.text {
background-color: #F1F1F1;
width: 600px;
margin: auto;
border: 1px solid #73AD21;
padding: 15px;
}
You can increase the padding as you wish (i.e. padding: 20px
).
您可以根据需要增加填充(即填充:20px)。
#2
0
Add a little padding inside the div, that should do it for you.
在div中添加一个小填充,应该为你做。
.div {
padding: 10px;
}