Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS加载程序未与文本元素内联_Html_Css_Loading_Loader_Markup - Fatal编程技术网

Html CSS加载程序未与文本元素内联

Html CSS加载程序未与文本元素内联,html,css,loading,loader,markup,Html,Css,Loading,Loader,Markup,我试图在文本元素的右侧显示一个CSS加载器,但由于某些原因,它正在向上移动,并且与文本不完全在同一行的中心 HTML: 如何使加载器与文本在同一行上居中 <p class="loading"> LOADING </p> <div id="loader"> <div class="lds-ring"> <div></div> <div>

我试图在文本元素的右侧显示一个CSS加载器,但由于某些原因,它正在向上移动,并且与文本不完全在同一行的中心

HTML:

如何使加载器与文本在同一行上居中

<p class="loading"> LOADING </p>

<div id="loader">
  <div class="lds-ring">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>
.loading {
  margin-top: 7%; margin-bottom: 1%; margin-left: 2.5%;
  font-size: 60px; text-decoration: underline; font-family: "Playfair Display";
    
}

.lds-ring {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 64px;
  height: 64px;
  margin: 8px;
  border: 8px solid black;
  border-radius: 50%;
  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: black transparent transparent transparent;
}
.lds-ring div:nth-child(1) {
  animation-delay: -0.45s;
}
.lds-ring div:nth-child(2) {
  animation-delay: -0.3s;
}
.lds-ring div:nth-child(3) {
  animation-delay: -0.15s;
}
@keyframes lds-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}