Issue
I'm using vue.js and I've tried out using float: left; but it won't work. I'm new to vue.js but it should work using normal css under the style right.
My code:
<template>
<div class = "bar">
<h1 class = "subtitle">Mean {{ field || 'No field yet' }}</h1>
<div class = "meandata">
<p>{{ mean.data }}</p>
</div>
</div>
</template>
<style>
.bar {
width: 400px;
height: 70px;
margin: 20px;
padding: 10px;
border: 5px;
font-size: 18px;
background: #FEFAE0 0% 0% no-repeat padding-box;
border-radius: 25px;
opacity: 1;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}
.subtitle{
font: normal normal normal 20px/20px Sitka Subheading;
letter-spacing: 0px;
color: #D4A373;
opacity: 1;
float: left;
margin-left: 20px;
margin-top: 35px;
margin-right: auto;
}
.meandata{
float: left;
text-align: right;
margin-left: auto;
margin-right: 20px;
font: normal normal normal 70px/50px Sylfaen;
letter-spacing: 0px;
color: #987554;
text-transform: uppercase;
opacity: 1;
}
</style>
Solution
Can this help you?
.bar {
/*Add*/
display:flex;
justify-content: start;
align-items: center;
/*End Add*/
width: 400px;
height: 70px;
margin: 20px;
padding: 10px;
border: 5px;
font-size: 18px;
background: #FEFAE0 0% 0% no-repeat padding-box;
border-radius: 25px;
opacity: 1;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}
.subtitle{
font: normal normal normal 20px/20px Sitka Subheading;
letter-spacing: 0px;
color: #D4A373;
opacity: 1;
float: left;
margin-left: 20px;
margin-top: 35px;
margin-right: auto;
}
.meandata{
float: left;
text-align: right;
margin-left: auto;
margin-right: 20px;
font: normal normal normal 70px/50px Sylfaen;
letter-spacing: 0px;
color: #987554;
text-transform: uppercase;
opacity: 1;
}
<div class = "bar">
<h1 class = "subtitle">Mean Humidity</h1>
<div class = "meandata">
<p>35%</p>
</div>
</div>
<div class = "bar">
<h1 class = "subtitle">Mean Temperature</h1>
<div class = "meandata">
<p>35*</p>
</div>
</div>
Answered By - durmex


0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.