编辑:背景只是一个图像&我放置图像的部分就是我给出的图像。
我的网页目前看起来像这样,我已经指出了我想要的按钮,但我是非常新的编码在一般情况下,不知道如何实现这一点。
网页图片:

这是我的html代码,非常简单,只需添加按钮即可。
<section class="slide kenBurns">
<div class="content">
<div class="container">
<div><p class="ae-2">
</p></div>
<div class="wrap">
<div class="fix-7-12">
<!-- <h1 class="ae-1">Messes Make Memories</h1> -->
</div>
</div>
</div>
</div>
<img
src="assets/img/background/flood2.png"
width="1450"
height="850"
></img>
</section>发布于 2020-08-23 18:54:30
好吧,试试这个代码
<!DOCTYPE html>
<html>
<head>
<style>
.img {
width:100%;
height: auto;
top:0;
left:0;
position: relative;
z-index: 1;
}
.anybutton {
top:11%;
left:55%;
width:100px;
height:40px;
position: absolute;
z-index: 2;
background: orange;
}
</style>
</head>
<body style="text-align:center; margin: 0px;">
<div class="mycenter" id="">
<img src="assets/img/background/flood2.png" class="img" id="img" />
<input type="button" class="anybutton" id="myab" value="Right Here" />
</div>
</body>
</html>
发布于 2020-08-22 22:37:14
有两种类型的按钮在那里,真正的按钮。它用于为JavaScript触发事件。它可以像下面的例子一样工作,也可以按照下面的样式来工作。你可以随心所欲地插入。
button {
background-color: blue;
width: 200px;
font-size: 20px;
padding: 10px;
border-radius: 5px;
border: 3px solid yellow;
color: white;
cursor: pointer;
}<button id="ID">I'm a Button</button>
然后是假按钮。这不是真正的按钮。它只是一个div框,可以将链接样式设置为按钮:
.button {
background-color: blue;
width: 200px;
font-size: 20px;
padding: 10px;
border-radius: 5px;
border: 3px solid yellow;
color: white;
text-align: center;
}<a href=""><div class="button">I'm a Button</div></a>
发布于 2020-08-22 22:37:52
<button>标记,该父div具有此特定部分的代码。

将父元素的css属性设置为position: relative。
position: absolute
<button>的css属性设置为最后,使用
top : 40px;
right : 100px;用于按钮标记的css属性。
注释:根据方便程度更改top和right属性的值。
https://stackoverflow.com/questions/63541670
复制相似问题