我相信对于比我聪明得多的人来说,这可能很简单。我的问题是我想将圆圈放在页面中间,但仍保持每个圆圈的轻微重叠。我尝试的所有事情似乎都会分散圈子,而我却失去了重叠之处。我尝试过更改.ca菜单,但是我尝试执行的似乎无效。我为所有代码道歉,但不确定在不粘贴所有代码的情况下如何做。我想确保我拥有帮助查找问题/解决方案所需的一切。



body {
  background-color: #000;
  font-family: 'Baskerville', 'Palatino Linotype', 'Palatino', 'Century Schoolbook L', 'Times New Roman', 'serif'
}

.homepage {
  background-image: url(pagepics/big_oscar.png), url(pagepics/emmy.png);
  background-position: left, right;
  background-repeat: no-repeat;
  background-size: 220px, 220px;
  padding: 250px;
}

h2 {
  font-size: 30px;
  color: #4BFC03;
  text-align: center;
}

h3 {
  font-size: 27.5px;
  color: #d4af37;
}

#header1 {
  width: 1220px;
  margin: 0 auto;
  height: 125px;
  background-image: url(pagepics/oscars-banner3.jpg);
}

#header2 {
  width: 1100px;
  margin: 0 auto;
  height: 100px;
  background-image: url(pagepics/emmybanner.png);
}

.indent {
  text-indent: 50px;
}

.link1 {
  color: orangered;
  text-align: center;
}

#footer {
  background-color: #000;
  color: turquoise;
  text-align: center;
  height: 60px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

#footer1 {
  color: turquoise;
  text-align: center;
}

img.floatLeft {
  float: left;
  margin: 5px;
}

#centerText1 {
  text-align: center;
  color: red;
}

li h3 {
  margin: .1px 0;
}

article {
  position: relative;
  z-index: 1;
}

.article:before {
  content: " ";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: .3;
  z-index: -1;
  background: url(pagepics/emmy.png);
}

.ca-menu {
  padding: 0;
  margin: 50px auto;
  width: 140px;
  display: inline-block;
}

.ca-menu li {
  width: 150px;
  height: 150px;
  border: 10px solid orangered;
  overflow: hidden;
  position: relative;
  float: left;
  background: #005B8E;
  margin-right: 10px;
  box-shadow: 5px 5px 2px rgba(0, 0, 0, 0.2);
  border-radius: 125px;
  transition: all 400ms linear;
}

.ca-menu li a {
  text-align: left;
  display: block;
  width: 100%;
  height: 100%;
  color: #BEFC00;
  position: relative;
}

.ca-icon {
  font-size: 18px;
  text-shadow: 0px 0px 10px #101254;
  line-height: 135px;
  position: static;
  padding-left: 15px;
  width: 50px;
  left: 20px;
  text-align: center;
  transition: all 900ms linear;
}

.ca-content {
  position: absolute;
  left: 120px;
  width: 370px;
  height: 50px;
  top: 20px;
}

.ca-menu li:hover {
  background: #930016;
  border-color: #4BFC03;
  transform: rotate(360deg);
}

.ca-menu li:hover .ca-icon {
  color: #BEFC00;
  font-size: 18px;
}

.ca-menu li:hover .ca-main {
  display: none;
}

.ca-menu li:hover .ca-sub {
  opacity: 8.0;
}

<header>
  <div id="header1"></div>
</header>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Home Page</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Oscar Trivia</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Emmy Trivia</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Oscar Winners</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Emmy Winners</strong></span>
    </a>
  </li>
</ul>
<main>
  <p>
    <h2>Why Are the Academy Awards Statuettes Called "Oscars"?</h2>
    <article>
      <h3 class="indent">blah blah</h3>
      <h3 class="indent">blah blah</h3>
      <h3 class="indent">blah blah</h3>
      <h3 class="indent">blah blah</h3>
    </article>

</main>

<aside>
  <h2>Statistics</h2>
  <ul style="list-style-type:none">
    <li>
      <h3>blah blah</h3>
    </li>
  </ul>

</aside>

<footer>
  <h5 class id="footer1">&copy; BPA Productions 2018</h5>
</footer>

最佳答案

只需将它们包装在可以应用text-align:center的容器中:



body {
  background-color: #000;
  font-family: 'Baskerville', 'Palatino Linotype', 'Palatino', 'Century Schoolbook L', 'Times New Roman', 'serif'
}

.homepage {
  background-image: url(pagepics/big_oscar.png), url(pagepics/emmy.png);
  background-position: left, right;
  background-repeat: no-repeat;
  background-size: 220px, 220px;
  padding: 250px;
}

h2 {
  font-size: 30px;
  color: #4BFC03;
  text-align: center;
}

h3 {
  font-size: 27.5px;
  color: #d4af37;
}

#header1 {
  width: 1220px;
  margin: 0 auto;
  height: 125px;
  background-image: url(pagepics/oscars-banner3.jpg);
}

#header2 {
  width: 1100px;
  margin: 0 auto;
  height: 100px;
  background-image: url(pagepics/emmybanner.png);
}

.indent {
  text-indent: 50px;
}

.link1 {
  color: orangered;
  text-align: center;
}

#footer {
  background-color: #000;
  color: turquoise;
  text-align: center;
  height: 60px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

#footer1 {
  color: turquoise;
  text-align: center;
}

img.floatLeft {
  float: left;
  margin: 5px;
}

#centerText1 {
  text-align: center;
  color: red;
}

li h3 {
  margin: .1px 0;
}

article {
  position: relative;
  z-index: 1;
}

.article:before {
  content: " ";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: .3;
  z-index: -1;
  background: url(pagepics/emmy.png);
}
.menu-container {
  text-align:center;
}
.ca-menu {
  padding: 0;
  margin: 50px auto;
  display: inline-block;
  width:140px;
}

.ca-menu li {
  width: 150px;
  height: 150px;
  border: 10px solid orangered;
  overflow: hidden;
  position: relative;
  float: left;
  background: #005B8E;
  margin-right: 10px;
  box-shadow: 5px 5px 2px rgba(0, 0, 0, 0.2);
  border-radius: 125px;
  transition: all 400ms linear;
}

.ca-menu li a {
  text-align: left;
  display: block;
  width: 100%;
  height: 100%;
  color: #BEFC00;
  position: relative;
}

.ca-icon {
  font-size: 18px;
  text-shadow: 0px 0px 10px #101254;
  line-height: 135px;
  position: static;
  padding-left: 15px;
  width: 50px;
  left: 20px;
  text-align: center;
  transition: all 900ms linear;
}

.ca-content {
  position: absolute;
  left: 120px;
  width: 370px;
  height: 50px;
  top: 20px;
}

.ca-menu li:hover {
  background: #930016;
  border-color: #4BFC03;
  transform: rotate(360deg);
}

.ca-menu li:hover .ca-icon {
  color: #BEFC00;
  font-size: 18px;
}

.ca-menu li:hover .ca-main {
  display: none;
}

.ca-menu li:hover .ca-sub {
  opacity: 8.0;
}

<header>
  <div id="header1"></div>
</header>
<div class="menu-container">
<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Home Page</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Oscar Trivia</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Emmy Trivia</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Oscar Winners</strong></span>
    </a>
  </li>
</ul>

<ul class="ca-menu">
  <li>
    <a href="OscarTrivia.html" target="_blank">
      <span class="ca-icon"><strong>Emmy Winners</strong></span>
    </a>
  </li>
</ul>
</div>
<main>
  <p>
    <h2>Why Are the Academy Awards Statuettes Called "Oscars"?</h2>
    <article>
      <h3 class="indent">blah blah</h3>
      <h3 class="indent">blah blah</h3>
      <h3 class="indent">blah blah</h3>
      <h3 class="indent">blah blah</h3>
    </article>

</main>

<aside>
  <h2>Statistics</h2>
  <ul style="list-style-type:none">
    <li>
      <h3>blah blah</h3>
    </li>
  </ul>

</aside>

<footer>
  <h5 class id="footer1">&copy; BPA Productions 2018</h5>
</footer>

10-05 20:40
查看更多