【问题标题】:CSS absolute positioning image works text box wont workCSS绝对定位图像工作文本框不起作用
【发布时间】:2014-08-30 22:54:32
【问题描述】:

我希望你能给我答案,我认为这是一个愚蠢的错误,但我就是找不到! 所以我希望你能快速浏览一下,并希望你能帮助我。 我对此有点陌生,并且已经从其他人的问题中学到了很多东西。

这是我的代码:

</head>

<style type="text/css"> 

.imgA1 { position:absolute; position: absolute;
margin-left: auto;
margin-right: auto;
top: 30;
left: 0;
right: 0; z-index: -2; } 

.imgB1 {  

position:absolute; position: absolute;
margin-left: auto;
margin-right: auto;
top: 0;
left: 0;
right: 0; z-index: 2; } 

</style>

<style>

div.ex { position:absolute; position: absolute;
margin-left: auto;
margin-right: auto;
top: 30;
left: 0;
bottom:0;
right: 0; z-index: 1;

width: 800px;
padding: 0px;
border: 0px solid gray;
margin: 0px;
text-align: justify;
}
</style>

<img class=imgA1 src="images/middenstuk.png"/>

imgA1 居中,但我的文本框不会:

<div class="ex">Hallo
<a href="Hoeveel.html">>NEXT</a></div>

非常感谢任何形式的帮助!

【问题讨论】:

    标签: image text positioning absolute box


    【解决方案1】:

    用于对齐文本的 Css 属性。

    文本对齐:居中;

    通过使用相同的技术,您也可以在不使用绝对值的情况下居中图像。在 div 中放置一个 img 标签,并在 div 中设置其 text-align:center;并且其中的所有元素都将居中。

    我可能对居中的嵌套有点偏离,但试试看吧。你会得到它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-29
      • 1970-01-01
      • 1970-01-01
      • 2014-09-03
      • 2015-09-29
      • 2023-04-05
      相关资源
      最近更新 更多