2017-10-05 17 views
-2

メインテキスト(hello)は左側に、バックグラウンドテキスト(読み込み)は右側に、メインテキストは垂直にします。複数の段落タグを同じ行に配置する

<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <meta charset="utf-8"> 
 
    <link rel="stylesheet" href="load.css"> 
 
    <title>Hello</title> 
 
</head> 
 

 
<body> 
 
    <div class="textContainer"> 
 
    <p class="hello">Hello</p> 
 
    <div class="backgroundInfo"> 
 
     <div class="spinner"></div> 
 
     <p class="notifText">Loading</p> 
 
    </div> 
 
    <div class="loader"></div> 
 
    </div> 
 
</body> 
 

 
</html>

(スピナーとローダがCSSアニメーションです)

答えて

0

これを試してみてください。

.hello { 
 
    float: left; 
 
} 
 

 
.notifText{ 
 
    float: right; 
 
} 
 

 
.loader { 
 
    clear: both; 
 
}
<div class="textContainer"> 
 
    <p class="hello">Hello</p> 
 
    <div class="backgroundInfo"> 
 
     <div class="spinner"></div> 
 
     <p class="notifText">Loading</p> 
 
    </div> 
 
    <div class="loader"></div> 
 
</div>

+0

helloのフォントサイズは200pxです。notifTextをそれよりも小さくしたいと思っています。どのように整列させることができるのでしょうか.hello? – Michael

0

は、両方の段落が同じに表示させるにはラインだけを使用します。

p{ 
    float: left; 
} 

次のステップは、要素とcointainer両方のCSS幅になります。

関連する問題