html - 如何在边框内添加文本?

标签 html css

我试图让我的文字在我作为图像添加的边框内。我将添加更多文本,并希望它在我编写时显示在我的边框中。任何帮助,将不胜感激。谢谢!

li {
  list-style-type: none;
  display: inline-block;
  font-size: 20px;
  letter-spacing: 4px;
  width: 150px;
}
.main-nav a {
  text-decoration: none;
}
.main-nav {
  border-bottom: 2px solid black;
  border-top: 2px solid black;
}
a:link {
  color: #008B00;
}
a:visited {
  color: #008B00;
}
p {
  font-size: 20px;
}
#main-border {
  text-align: center;
}
.searchbutton {
  font-size: 20px;
}
<div id="main-border">
  <p>Hi! My name is Marika and I am excited to join the school soon!</p>
  <img src="../desktop/background.gif" alt "border" height="500px" width="550px">
</div>

最佳答案

我无法理解你的问题,但我认为这就是你要找的:

<div id="main-border">      
  <p>Hi! My name is Marika and I am excited to join the school soon!</p>    
</div>

#main-border {
   text-align: center;
   background : url(../desktop/background.gif);
   background-size : 100% 100%;
   min-height : 500px;
   min-width : 500px;
}

关于html - 如何在边框内添加文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27822999/

相关文章:

PHP查询不包含在电子邮件中

javascript - 没有CSS的d3.js中的轴文本样式

javascript - 网站的 JS 菜单动画不起作用

html - 在 chrome 和 firefox 中,不同的表内按钮的样式表现不同。

javascript - 将非像素 css 值转换为 px

php - 半静态/动态页面

html - 基于百分比的 margin-top 和 height 不能一起工作

html - CSS 下拉菜单中的第三级需要更智能的垂直对齐

css - 在窗口调整大小时保持绝对定位和居中的 div 的边距

html - 如何在没有无效 CSS3 代码的情况下解决 Firefox 边框错误