Reputation: 1415
I have the below screen where there is a space at the top of the vc-e-att-26 text. I tried all possible ways I could think of including negative margin. But it still doesn't work.
Mt html file is :
And my scss file is :
I need the vcs-e-att-26 txt to be in the same line as the bullet. Can anyone please help me with this.
Upvotes: 0
Views: 776
Reputation: 4178
There are some small mistakes:
Just a suggestion, Use flex instead of floats,
I have given the basic idea to you below use it,
ul {
list-style: none;
margin-right: 20px;
}
body {background-color: #ccc;}
li span{
color:black;
}
h4 {
margin:20px;
}
* {
padding: 0;margin: 0; box-sizing: border-box;
}
hr {
width:100%;
margin-right: 57%;
}
.uptime-container{
background-color: white;
margin: 20px;
padding: 20px;
max-width: 80%;
}
.uptime-container ul li span {position: relative; padding-left: 20px;}
.red-circle >span:after {
content: "";
width: 10px;
height: 10px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
background: red;
margin-bottom: -5px;
display: block;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.green-circle >span:after {
display: block;
content: "";
width: 10px;
height: 10px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
background: green;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.uptime-container ul li {
display: flex;
justify-content: space-between;
margin-bottom: 25px;
border-bottom: 1px solid #ddd;
padding-bottom: 10px;
}
.uptime-container ul li:last-child {
margin-bottom: 0px;
}
<div class="uptime-container">
<h4>Uptime</h4>
<ul *ngFor="let data of chartData">
<li class="red-circle">
<span>VCS-e-at-26</span>
<p class="right-text">Down since lasrt 2 hours</p>
</li>
<li class="green-circle">
<span>VCS-e-at-26</span>
<p class="right-text">10 minutes</p>
</li>
<li class="red-circle">
<span>VCS-e-at-26</span>
<p class="right-text">Down since lasrt 2 hours</p>
</li>
<li class="green-circle">
<span>VCS-e-at-26</span>
<p class="right-text">10 minutes</p>
</li>
</ul>
</div>
Upvotes: 1
Reputation: 1550
There is a mistake in your HTML and CSS
code, check the right code and solution here
body{
margin:0;
}
ul {
list-style: none;
}
span.right-text {
float: right;
}
h4 {
margin:20px;
}
hr {
width:100%;
margin-right: 57%;
}
ul li.my-class::before {
background: red;
content: "";
width: 10px;
height: 10px;
position: absolute;
left: 0;
top: 4px;
border-radius: 50%;
}
ul li.my-class.green-circle::before{
background: green;
}
li.my-class {
position: relative;
padding-left: 20px;
}
.uptime-container{
background-color: white;
width: 40%;
margin-left: 20px;
margin-top: 20px;
}
<div class="uptime-container">
<h4>Uptime</h4>
<ul *ngFor="let data of chartData">
<li class="my-class red-circle">adadsadsad <span class="right-text">34324324234}</span></li>
<hr>
<li class="my-class green-circle">adadsadsad <span class="right-text">34324324234}</span></li>
<hr>
<li class="my-class green-circle">adadsadsad <span class="right-text">34324324234}</span></li>
<hr>
<li class="my-class green-circle">adadsadsad <span class="right-text">34324324234}</span></li>
<hr>
</ul>
</div>
Upvotes: 1