gpt4 book ai didi

html - 在 CSS 中将一行框居中

转载 作者:行者123 更新时间:2023-11-28 16:08:28 26 4
gpt4 key购买 nike

<分区>

我正在 Chrome 中创建一个非常基本的登录页面,但我很难尝试让我的框(圆圈)相对于页面居中。我在其他一些线程中尝试了几个示例,但它似乎没有用。

@import url(http://fonts.googleapis.com/css?family=Merriweather);
@import url(https://fonts.googleapis.com/css?family=PT+Sans);

/* closest I could get to Myraid Pro*/

* {
box-sizing: border-box;
}

body {
font-family: PT Sans, 'Merriweather', serif;
padding-top: 200px;
text-align: center;
margin: auto;
background-image: url("#");
/* the above image is hidden for privacy*/
background-repeat: no-repeat;
background-position: top center;
background-attachment: relative;
}

aside {
font-size: 150%;
/* memic welcome header */
}

a {
/* link color for welcome header */
color: #00599C;
text-decoration: none;
}

.box {
padding: 2em;
border: 8px solid #ccc;
border-radius: 100%;
display: block;
position: relative;
width: 300px;
height: 300px;
float: left;
left: 5%;
margin: 5px;
/*-1px 0 0 -1px; (alternative)*/
color: black;
background: linear-gradient( white, white 50%, #00599C 50%, #00599C);
background-size: 100% 205%;
transition: all 0.2s ease;
animation: down-bump 0.4s ease;
}

.box h2 {
/* description of each reference */
font-weight: 400;
letter-spacing: -1.5px;
line-height: 1.2;
text-align: center;
}

.underwriting {
font-size: 150%;
}

.IT {
font-size: 150%;
}

.claims {
font-size: 150%;
}

.hr {
font-size: 150%;
}

.box h3 {
/*updated date */
font: 0.8em "Lucida Grande", serif;
text-align: center;
}

.box:hover {
background-position: 100% 100%;
animation: up-bump 0.4s ease;
}

.box:hover h2 {
color: #C8C8CA;
/* navy blue */
}

.box:hover h2 span {
color: white;
}

.box:hover h3 {
color: #ECECED;
/* gray */
}


/* fun little animation to provide that interactive feel */

@keyframes up-bump {
0% {
padding-top: 2em;
}
50% {
padding-top: 1.5em;
}
100% {
padding-top: 2em;
}
}

@keyframes down-bump {
0% {
padding-top: 2em;
}
50% {
padding-top: 2.5em;
}
100% {
padding-top: 2em;
}
}
<div>
<!-- this is an attempt to align the boxes center relative -->
<a href="#" class="box">
<h2><span class="underwriting">Underwriting</span> <p>References, Guidelines & Best Practices</p></h2>
<h3>Updated - 8/1/2016</h3>
</a>
<a href="#" class="box">
<h2><span class="IT">Information Technology</span> <p>How-to's & Troubleshooting</p></h2>
<h3>Updated - 7/24/2016</h3>
</a>
<a href="#" class="box">
<h2><span class="claims">Claims</span> <p>References, Guidelines & Best Practices</p></h2>
<h3>Updated - 7/28/2016</h3>
</a>
<a href="#" class="box">
<h2><span class="hr">Premium Audit & Billing </span> <p>References, Guidelines & Best Practices</p></h2>
<h3>Updated - 7/21/2016</h3>
</a>
</div>

任何帮助将不胜感激!谢谢!

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com