I'm currently trying to create a special hover for a website.
Here is what I'm trying to do :
4 blocks, all responsive with a black bar with 70% of opacity with the main text.
Then when I hover a block, the black bar fill all the space at the bottom and reveals 2 or 4 buttons.
Maybe something like this :
<div class="image-block">
<div class="image1">
<span class="black-bar">SOME TEXT</span>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
<div class="image2">
<span class="black-bar">SOME TEXT</span>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
<div class="image3">
<span class="black-bar">SOME TEXT</span>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
<div class="image4">
<span class="black-bar">SOME TEXT</span>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
</div>
But for the CSS I really don't know how to do this. What is the simplest and best way to do this with something fully responsive ?
Thanks !
Here's a pure css option. If I missed something just let me know. I had to adjust your markup a little bit.
.image-block{
display: flex;
flex-direction: row;
}
.col{
display: flex;
flex-direction: column;
}
.image1, .image2, .image3, .image4{
background: url(http://lorempixel.com/output/nature-q-c-640-480-1.jpg) no-repeat center center;
background-size: cover;
width: 200px;
margin: 0 20px 20px 0;
position: relative;
overflow: hidden;
}
.image1, .image4{
height: 100px;
}
.image2, .image3{
height: 200px;
}
.black-bar{
background: rgba(0,0,0,0.4);
text-align: center;
color: #fff;
width: 100%;
top: 50%;
position: absolute;
margin-top: -18px;
padding: 10px 0;
font-family: Helvetica, Arial, sans-serif;
transition: all 0.5s ease;
bottom: calc(50% - 15px);
overflow: hidden;
}
.black-bar button{
margin: 10px;
display: none;
border: none;
background: #fff;
}
.black-bar p{
margin: 0;
font-weight: 200;
font-size: 12px;
}
.image1:hover .black-bar, .image2:hover .black-bar, .image3:hover .black-bar, .image4:hover .black-bar{
bottom: 0;
transition: all 0.5s ease;
}
.image1:hover .black-bar button, .image2:hover .black-bar button, .image3:hover .black-bar button, .image4:hover .black-bar button{
display: inline-block;
}
<div class="image-block">
<div class="col">
<div class="image1">
<div class="black-bar">
<p>SOME TEXT</p>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
</div>
<div class="image2">
<div class="black-bar">
<p>SOME TEXT</p>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
</div>
</div>
<div class="col">
<div class="image3">
<div class="black-bar">
<p>SOME TEXT</p>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
</div>
<div class="image4">
<div class="black-bar">
<p>SOME TEXT</p>
<button class="special-button">Button</button>
<button class="special-button">Button</button>
</div>
</div>
</div>
</div>
Edit:
Added an animation via tiny bit of calc magic.
bottom: calc(50% - 15px);
Check out the code below (I had to use jQuery) or this fiddle
$('.text').mouseenter(function () {
$('.hovering').animate({'height': '200px'}, 'slow');
});
$('.image').mouseleave(function () {
$('.hovering').animate({'height': '100px'}, 'slow');
});
.image {
position: relative;
background-image: url(http://www.w3schools.com/css/trolltunga.jpg);
height: 300px;
width: 600px;
}
.hovering {
display: block;
height: 100px;
width: 600px;
background-color: rgba(0,0,0,0.7);
overflow: hidden;
margin-top: 100px;
position: absolute;
}
button, .text {
display: block;
width: 130px; height: 40px;
margin: 0 auto;
}
.text {
color: white;
font-size: 40px;
text-align: center;
padding-top: 30px;
width: 200px;
margin-bottom: 30px;
display: block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="image">
<div class="hovering">
<span class="text">Text here</span>
<button>Button here</button>
</div>
</div>
The black box shrinks when mouse leaves the image
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
hello the subject I couldn't do about css is this, how can i draw this in the image?
what I want to do is to copy the image with html and css.
I tried with display flex and but I couldn't
.channel-left {
display: flex;
flex-wrap: wrap;
margin: 0;
padding: 0;
list-style: none;
}
.channel-description {
width: auto !important;
}
<div class="channel-left mb-5">
<div class="channel-description">
<div class="channel-img">
<img src="img.jpg" class="img-circle">
</div>
<div class="channel-title">
<p>title</p>
<p>blabla</p>
</div>
</div>
<div class="channel-subs">
<button type="button" class="btn btn-large btn-outline-danger rounded"><i class="fa fa-heart"></i> Like</button>
</div>
</div>
.container {
display: flex;
background: black;
color: white;
align-items: center;
padding: 10px;
}
.description {
flex: 1 1 auto;
display: flex;
align-items: center;
}
.title {
padding: 10px;
}
.img {
border-radius: 90%;
overflow: hidden;
width: 50px;
height: 50px;
}
.subs {
flex: 0 1 auto;
}
<div class="container">
<div class="description">
<div class="img">
<img src="https://placekitten.com/50/50" class="img-circle">
</div>
<div class="title">
<p>title</p>
<p>blabla</p>
</div>
</div>
<div class="subs">
<button type="button" class="btn btn-large btn-outline-danger rounded">Like</button>
</div>
just give the simple flex css to parent, put all three items in same div and then give margin-left auto to last item to move it to right,
Rest style your typography and colors.
* {margin: 0; padding: 0; box-sizing: border-box;}
.channel-description {
display: flex;
align-items: center;
padding: 10px;
margin: 20px;
border: 1px solid #ddd;
}
.channel-subs {margin-left: auto;}
.channel-title {margin-left: 10px;}
<div class="channel-left mb-5">
<div class="channel-left mb-5">
<div class="channel-description">
<div class="channel-img">
<img src="img.jpg" class="img-circle">
</div>
<div class="channel-title">
<p>title</p>
<p>blabla</p>
</div>
<div class="channel-subs">
<button type="button" class="btn btn-large btn-outline-danger rounded"><i class="fa fa-heart"></i> Like</button>
</div>
</div>
</div>
Something like this would work:
.channel-left {
background: #1f2227;
border-radius: 15px;
color: white;
max-width: 400px;
padding-left: 20px;
padding-right: 20px;
}
.channel-left,
.channel-description {
display: flex;
align-items: center;
justify-content: center;
}
.channel-img {
flex-basis: 80px;
}
.channel-title,
.channel-description{
flex-basis: 100%;
}
<div class="channel-left mb-5">
<div class="channel-description">
<div class="channel-img">
<img src="img.jpg" class="img-circle">
</div>
<div class="channel-title">
<p>title</p>
<p>blabla</p>
</div>
</div>
<div class="channel-subs">
<button type="button" class="btn btn-large btn-outline-danger rounded"><i class="fa fa-heart"></i> Like</button>
</div>
</div>
I know you've already accepted an answer, however I want to post my own:
* {
font-family: sans-serif;
}
.channel-left {
display: flex;
flex-wrap: wrap;
margin: 0;
padding: 0;
list-style: none;
background: #222222;
padding-left: 10px;
padding-top: 10px;
border-radius: 10px;
}
.channel-description {
width: auto !important;
display: inherit;
flex-basis: 70%;
}
.img-circle {
border-radius: 50px;
border: 2px solid gray;
width: 50px;
}
.channel-info {
padding-left: 5px;
}
.btn-outline-danger {
background: #555555;
border-radius: 50px;
border: 2px solid gray;
height: 30px;
width: 150px;
color: white;
cursor: pointer;
margin-top: 25px;
}
.channel-subs {
display: inline-block;
float: right;
}
p {
color: white;
}
.channel-title {
font-weight: bold;
}
<div class="channel-left mb-5">
<div class="channel-description">
<div class="channel-img">
<img src="https://www.chiquita.com/wp-content/uploads/2019/12/Chiquita_Banana_Class_Extra_Yellow.jpg" class="img-circle">
</div>
<div class="channel-info">
<p class="channel-title">Title</p>
<p class="channel-desc">blabla</p>
</div>
</div>
<div class="channel-subs">
<button type="button" class="btn btn-large btn-outline-danger rounded"><i class="fa fa-heart"></i> Like</button>
</div>
</div>
I want to place these 3 buttons in a circle under the timer. Please see images for reference. I'm trying to put these 3 buttons inside the circle but it always crashes my layout. I have attached my code and css- please check it
.circle {
margin: 0 auto;
width: 350px;
height: 350px;
line-height: 320px;
border-radius: 50%;
text-align: center;
border: 10px solid #666;
border-style: double;
}
.circleContent {
display: inline-block;
color: #fff;
font-size: 40px;
width: 60px;
}
.circleContent-span {
color: #fff;
font-size: 40px;
}
<body>
<div class="container mt-5">
<div>
<h1 class="title">Stop Watch</h1>
</div>
<div class="circle mt-5">
<div>
<h1 id="hour" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="min" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="sec" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="msec" class="circleContent">00</h1>
</div>
</div>
<div>
<button onclick="start()">Start</button>
<button onclick="stop()">Stop</button>
<button onclick="reset()">Reset</button>
</div>
</div>
</body>
.circle {
margin: 0 auto;
width: 350px;
height: 350px;
line-height: 320px;
border-radius: 50%;
text-align: center;
border: 10px solid #666;
border-style: double;
}
.circleContent {
display: inline-block;
color: #fff;
font-size: 40px;
width: 60px;
}
.circleContent-span {
color: #fff;
font-size: 40px;
}
Buttons
[![enter image description here][1]][1]
Circle
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/v5Qve.png
[2]: https://i.stack.imgur.com/VaIH2.png
Something like this will help
<div class="container mt-5 h-position-relative">
<div>
<h1 class="title">Stop Watch</h1>
</div>
<div class="circle mt-5">
<div>
<h1 id="hour" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="min" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="sec" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="msec" class="circleContent">00</h1>
</div>
</div>
<div class="h-position-absolute h-tl">
<button onclick="start()">Start</button>
<button onclick="stop()">Stop</button>
<button onclick="reset()">Reset</button>
</div>
</div>
CSS:
.h-position-relative{
position:relative;
}
.h-position-absolute{
position:absolute;
}
.h-tl{
top:smth;
left:smth;
}
If you want something like this
Than this will help:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: lightblue;
}
.circle {
margin: 0 auto;
width: 350px;
height: 350px;
line-height: 320px;
border-radius: 50%;
text-align: center;
border: 10px solid #666;
border-style: double;
}
.circleContent {
display: inline-block;
color: #fff;
font-size: 40px;
width: 60px;
}
.circleContent-span {
color: #fff;
font-size: 40px;
}
.h-position-relative{
position:relative;
}
.h-position-absolute{
position:absolute;
}
.h-tl{
top:350px;
left:250px;
}
</style>
</head>
<body>
<div class="container mt-5 h-position-relative">
<div>
<h1 class="title">Stop Watch</h1>
</div>
<div class="circle mt-5">
<div>
<h1 id="hour" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="min" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="sec" class="circleContent">00</h1><span class="circleContent-span">:</span>
<h1 id="msec" class="circleContent">00</h1>
</div>
</div>
<div class="h-position-absolute h-tl">
<button onclick="start()">Start</button>
<button onclick="stop()">Stop</button>
<button onclick="reset()">Reset</button>
</div>
</div>
</body>
</html>
How can the tabs be always positioned flush to the right hand side of the container, when rotated and have child text of an unknown width?
Without rotation right: 0; on the .tab would be fine but the rotation throws it off.
body {
margin: 0;
}
.container {
background-color: pink;
padding: 3rem;
position: relative;
}
.tab {
position: absolute;
right: 1rem;
transform: rotate(-90deg);
padding: 1rem;
background-color: green;
margin-right: -2.45rem;
top: 5rem;
}
<body>
<div class="container">
<h1>Button</h1>
<div class="tab">
<button class="tab-button" type="button">Button</button>
</div>
</div>
<hr>
<div class="container">
<h1>Longer button</h1>
<div class="tab">
<button class="tab-button" type="button">Longer Button</button>
</div>
</div>
</body>
Adjust the transform-origin and add some translation then you can use right:0.
body {
margin: 0;
}
.container {
background-color: pink;
padding: 3rem;
position: relative;
}
.tab {
position: absolute;
right: 0;
transform: rotate(-90deg) translateY(-100%);
transform-origin: top right;
padding: 1rem;
background-color: green;
top: 2rem;
}
<div class="container">
<h1>Button</h1>
<div class="tab">
<button class="tab-button" type="button">Button</button>
</div>
</div>
<hr>
<div class="container">
<h1>Longer button</h1>
<div class="tab">
<button class="tab-button" type="button">Longer Button</button>
</div>
</div>
body {
margin: 0;
}
.container {
background-color: pink;
padding: 3rem;
position: relative;
}
.tab {
position: absolute;
right: -39px;
transform: rotate(-90deg);
padding: 1rem;
background-color: green;
top: 5rem;
min-width: 100px;
}
<html>
<head>
<link rel="stylesheet" href="lib/style.css">
<script src="lib/script.js">
</script>
</head>
<body>
<div class="container">
<h1>Button</h1>
<div class="tab">
<button class="tab-button" style="width: 100%; white-space: nowrap" type="button">Button</button>
</div>
</div>
<hr>
<div class="container">
<h1>Longer button</h1>
<div class="tab">
<button class="tab-button" style="width: 100%; white-space: nowrap" type="button">Longer Button</button>
</div>
</div>
</body>
</html>
Trying to create a css menu:
<div style="" class="normal_height vc_row wpb_row vc_row-fluid shop_menu_row">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="vc_column-inner ">
<div class="wpb_wrapper">
<div class="shop_menu_container">
<div class="category">
<button class="dropdown">
Face Makeup
</button>
</div>
<div class="category">
<button class="dropdown">
Eye Makeup
</button>
<div class="category-content">
Cake Eyeliner
T-shirts
</div>
</div>
<div class="category">
<button class="dropdown">
Lip Makeup
</button>
<div class="category-content">
Luminized Lips
Lip Pencil
</div>
</div>
<div class="category">
<button class="dropdown">
Accessories
</button>
<div class="category-content">
Eye Lashes
Palletes
</div>
</div>
<div class="category">
<button class="dropdown">
Brushes
</button>
<div class="category-content">
Synthetic Vegan Brushes
</div>
</div>
<div class="category">
<button class="dropdown">
Dermalogica
</button>
<div class="category-content">
Age Smart
Clear Start
Daily Defense
Powerbright
Skin Health
System Medibac Clearing
Ultracalming
</div>
</div>
</div>
<div class="wpb_text_column wpb_content_element ">
<div class="wpb_wrapper"></div>
</div>
</div>
</div>
</div>
</div>
With this css:
.shop_menu_row {
z-index: 1000;
}
.shop_content_row {
position: relative;
}
.shop_menu_container {
overflow: hidden;
background-color: #ffffff;
font-family: Arial;
width: 80%;
max-width: 80%;
display: flex;
justify-content: center;
margin: auto;
}
.shop_menu_container a {
float: left;
font-size: 16px;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
text-transform: capitalize;
}
.category {
overflow: hidden;
/*margin: 0px auto;*/
margin: 0px 0px;
width: 12%;
display: inline-block;
text-align: center;
}
.category .dropdown {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
}
.shop_menu_container a:hover, .category:hover .dropdown {
background-color: red;
}
.category-content {
display: none;
position: relative;
background-color: #ffffff;
min-width: 160px;
z-index: 1;
text-align: center;
}
.category-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: center;
}
.category-content a:hover {
background-color: red;
opacity: 1;
}
.category:hover .category-content {
display: block;
}
On hover category, entire content under (next div row) shifts down and up according to hover:
<div style="" class="normal_height vc_row wpb_row vc_row-fluid shop_content_row">
<div class="wpb_column vc_column_container vc_col-sm-3">
<div class="vc_column-inner ">
<div class="wpb_wrapper"></div>
</div>
</div>
<div class="wpb_column vc_column_container vc_col-sm-9">
<div class="vc_column-inner ">
<div class="wpb_wrapper">
<div class="wpb_single_image wpb_content_element vc_align_center">
<figure class="wpb_wrapper vc_figure">
<div class="vc_single_image-wrapper vc_box_shadow_border vc_box_border_grey">
<img width="960" height="640" src="https://website.com/wp-content/uploads/2017/08/brush-791306_960_720.jpg" class="vc_single_image-img attachment-full" alt="" srcset="https://website.com/wp-content/uploads/2017/08/brush-791306_960_720.jpg 960w, https://website.com/wp-content/uploads/2017/08/brush-791306_960_720-300x200.jpg 300w, https://website.com/wp-content/uploads/2017/08/brush-791306_960_720-768x512.jpg 768w" sizes="(max-width: 960px) 100vw, 960px">
</div>
</figure>
</div>
</div>
</div>
</div>
</div>
Tried fixing this with z-index and position for both but can't seem to get it to work...
Any ideas?
Thank you
Sorry for the long code
the rows are constructed with visual-composer
Instead of using position: relative; you should use position:absolute.
This way the position of the open-menu will not interfere with the rest of your page:
.category-content {
...
position: absolute;
...
}
Note that you have other positions problems there what I didn't fix, you might have them fixed in your original code, probably some css is missing here.
.shop_menu_row {
z-index: 1000;
}
.shop_content_row {
position: relative;
}
.shop_menu_container {
overflow: hidden;
background-color: #ffffff;
font-family: Arial;
width: 80%;
max-width: 80%;
display: flex;
justify-content: center;
margin: auto;
}
.shop_menu_container a {
float: left;
font-size: 16px;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
text-transform: capitalize;
}
.category {
overflow: hidden;
/*margin: 0px auto;*/
margin: 0px 0px;
width: 12%;
display: inline-block;
text-align: center;
}
.category .dropdown {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
}
.shop_menu_container a:hover, .category:hover .dropdown {
background-color: red;
}
.category-content {
display: none;
position: absolute;
background-color: #ffffff;
min-width: 160px;
z-index: 1;
text-align: center;
}
.category-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: center;
}
.category-content a:hover {
background-color: red;
opacity: 1;
}
.category:hover .category-content {
display: block;
}
<div style="" class="normal_height vc_row wpb_row vc_row-fluid shop_menu_row">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="vc_column-inner ">
<div class="wpb_wrapper">
<div class="shop_menu_container">
<div class="category">
<button class="dropdown">
Face Makeup
</button>
</div>
<div class="category">
<button class="dropdown">
Eye Makeup
</button>
<div class="category-content">
Cake Eyeliner
T-shirts
</div>
</div>
<div class="category">
<button class="dropdown">
Lip Makeup
</button>
<div class="category-content">
Luminized Lips
Lip Pencil
</div>
</div>
<div class="category">
<button class="dropdown">
Accessories
</button>
<div class="category-content">
Eye Lashes
Palletes
</div>
</div>
<div class="category">
<button class="dropdown">
Brushes
</button>
<div class="category-content">
Synthetic Vegan Brushes
</div>
</div>
<div class="category">
<button class="dropdown">
Dermalogica
</button>
<div class="category-content">
Age Smart
Clear Start
Daily Defense
Powerbright
Skin Health
System Medibac Clearing
Ultracalming
</div>
</div>
</div>
<div class="wpb_text_column wpb_content_element ">
<div class="wpb_wrapper"></div>
</div>
</div>
</div>
</div>
</div>
<div>Content under menu</div>
I have this layout of my web page, here last div tag <div>{this.props.status}</div> is in left end. I want to set it in center between rock and scissors button.
Expected
<div className="AppTitle">
<b>Score: {this.props.score}</b>
<div>
<RoundedButton text="Rock" clickitem={this.clickitem} />
<RoundedButton text="Paper" clickitem={this.clickitem} />
<RoundedButton text="Scissors" clickitem={this.clickitem} />
</div>
<div>{this.props.status}</div>
</div>
App.css
.AppTitle {
margin: 50px;
}
.Button {
padding: 20px;
margin: 20px;
border: 1px solid blue;
border-radius: 10px;
}
What is the way to do it in HTML ?
Try this for css.
.AppTitle {
margin: 50px;
display:inline-block;
}
.button {
padding: 20px;
margin: 20px;
border: 1px solid blue;
border-radius: 10px;
}
.status{text-align:center;}
<div class="AppTitle">
<b>Score: -1</b>
<div>
<Button class="button">Rock</Button>
<Button class="button">Paper</Button>
<Button class="button">Scissors</Button>
</div>
<div class="status">Computer Won</div>
</div>
EDITED
Here added four button & background this one clear.
.AppTitle {
margin: 50px;
display:inline-block;
background:#b5b5b5;
}
.button {
padding: 20px;
margin: 20px;
border: 1px solid blue;
border-radius: 10px;
}
.status{text-align:center;background:#ccc;}
<div class="AppTitle">
<b>Score: -1</b>
<div>
<Button class="button">Rock</Button>
<Button class="button">Paper</Button>
<Button class="button">Scissors</Button>
<Button class="button">Rock</Button>
</div>
<div class="status">Computer Won</div>
UPDATED
Make parent div to center.
.wrapper{text-align:center;}
.AppTitle {
margin:50px;
display:inline-block;
background:#b5b5b5;
text-align:left;
}
.button {
padding: 20px;
margin: 20px;
border: 1px solid blue;
border-radius: 10px;
}
.status{text-align:center;background:#ccc;}
<div class="wrapper">
<div class="AppTitle">
<b>Score: -1</b>
<div>
<Button class="button">Rock</Button>
<Button class="button">Paper</Button>
<Button class="button">Scissors</Button>
</div>
<div class="status">Computer Won</div>
</div>
</div>
If you have a look at .status, you'll find that it is the same width as the previous <div>. To center the text, you'll need to give it the CSS:
.status {
text-align: center;
}
Also, <RoundedButton> is not a HTML tag. Use <button> instead.
.AppTitle {
margin: 50px;
display: inline-block;
}
.button {
padding: 20px;
margin: 20px;
border: 1px solid blue;
border-radius: 10px;
}
.status {
text-align: center;
}
<div class="AppTitle">
<b>Score: -1</b>
<div>
<button class="button">Rock</button>
<button class="button">Paper</button>
<button class="button">Scissors</button>
</div>
<div class="status">Computer Won</div>
</div>
This could also work #Williams
.mainContainer {
width: 500px;
height: 200px;
border: 2px solid black;
background-color: lightgray;
}
.top {
width: 100%;
height: 50px;
background-color: lightgray;
display: table-cell;
vertical-align: middle;
padding-left: 100%;
}
.outputContainer {
width: 100%;
background-color: lightgray;
height: 20px;
}
#score {
margin-top: 50px;
display: inline;
}
.third {
width: 30%;
height: 70px;
background-color: lightgray;
display: inline-block;
}
button {
padding: 20px;
border: 2px solid blue;
border-radius: 10px;
width: 100px;
}
<div class="mainContainer">
<div class="top">
<span id="score"><b> Score: </b></span>
</div>
<center>
<div class="third">
<button type="button"> Rock </button>
</div>
<div class="third">
<button type="button"> Paper </button>
</div>
<div class="third">
<button type="button"> Scissors </button>
</div>
<div class="outputContainer">
<h2> Computer won! </h2>
</div>
</center>
</div>
In order to keep them aligned in most cases and not just as a fix on a certain display, try putting them in one and using display: block, like so
<div className="AppTitle">
<b>Score: {this.props.score}</b>
<div>
<RoundedButton text="Rock" clickitem={this.clickitem} />
<div style="display:block">
<RoundedButton text="Paper" clickitem={this.clickitem} />
<span>{this.props.status}</span>
</div>
<RoundedButton text="Scissors" clickitem={this.clickitem} />
</div>