admin管理员组文章数量:1122832
Css styles.css
body {
position: relative;
background-image: url('blue.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
}
.container {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 20px;
}
.nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.nav ul {
display: flex;
list-style: none;
padding: 0;
margin: 0;
}
.nav ul li {
margin-left: 20px;
}
.nav ul li a {
text-decoration: none;
color: black;
}
.text {
text-align: center;
}
.txt1, .txt2 {
margin: 10px 0;
}
.cpyrgt {
text-align: center;
margin-top: 20px;
}
.smicons {
display: flex;
justify-content: center;
margin-top: 20px;
}
.smicons a {
margin: 0 10px;
}
.button{
position: absolute;
top: 50%;
background-color: #0a0a23;
color: #fff;
border: none;
border-radius: 10px;
padding: 15px;
min-height: 30px;
min-width: 120px;
}
Html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edrin John's Enterprise</title>
<link rel="stylesheet" href="styles.css">
<script src=".js" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<div class="nav">
<h2 class="bname">Edrin John's Enterprise</h2>
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<div class="text">
<p class="txt1">Your One-Stop Solution to All Document Services.</p>
<p class="txt2">Explore our wide range of services designed to meet all your document needs.</p>
<button class="btn">Explore</button>
<p class="cpyrgt">© 2013, Edrin John's Enterprise. All Rights Reserved.</p>
</div>
</div>
<div class="smicons">
<a href="">
<i class="fa-brands fa-facebook fa-2xl"></i>
</a>
<a href="">
<i class="fa-brands fa-instagram fa-2xl"></i>
</a>
</div>
</body>
</html>
本文标签: htmlMy backround image in css is not showing
版权声明:本文标题:html - My backround image in css is not showing 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736305782a1932711.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论