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>
Related
I have a cart menu that I'm filling with items, on web they show up as 4 columns of items, but on mobile they show up as 3 columns.
Also, when a column isn't full, I want the item/s to be left-aligned, but now they are being centered and look out of place.
How can I set it up like this without redirecting to a separate page for mobile?
Can I achieve it with percentages rather than absolute sizes or some other way?
index.html:
<link rel="stylesheet" href="styles2.css" />
<div class="imgbox">
<img class="center-stretch" src="images/banner.png">
</div>
<section class="container content-section border">
<div class="group-title">
Item Group 1
</div>
<div class="shop-items">
<div class="shop-item">
<img class="shop-item-image" src="images/item1.jpg">
<span class="shop-item-title">Item 1</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item2.jpg">
<span class="shop-item-title">Item 2</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item3.jpg">
<span class="shop-item-title">Item 3</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item4.jpg">
<span class="shop-item-title">Item 4</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item5.jpg">
<span class="shop-item-title">Item 5</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item6.jpg">
<span class="shop-item-title">Item 6</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item7.jpg">
<span class="shop-item-title">Item 7</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item8.jpg">
<span class="shop-item-title">Item 8</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
</section>
<footer class="main-footer">
<div class="container main-footer-container">
<img class="center-mini" src="images/banner.jpg">
</div>
</footer>
styles2.css:
#font-face {
font-family: "Courier New";
font-weight: normal;
font-style: normal;
}
* {
letter-spacing: 0.08em;
text-transform: uppercase;
font-weight: bold;
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Courier New", Courier, monospace;
color: white;
}
.imgbox {
display: grid;
height: 100%;
}
.center-stretch {
width: auto;
max-height: 100vh;
margin: auto;
}
.content-section {
margin: 1em;
}
.container {
width: auto;
max-width: 1200px;
margin: 0 auto;
padding: 0 1.5em;
}
.border {
border: 2px solid black;
}
.group-title {
margin-top: 10px;
font-weight: bold;
text-align: center;
color: black;
font-size: 2.5em;
}
.shop-items {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.shop-item {
margin: 10px;
}
.shop-item-image {
height: 250px;
}
.shop-item-title {
font-size: 1.1em;
display: block;
flex-grow: 1;
color: black;
text-align: center;
margin: 5px
}
.shop-item-price {
display: block;
width: 100%;
text-align: center;
font-weight: bold;
font-size: 1.5em;
color: black;
}
.shop-item-details {
display: flex;
align-items: center;
justify-content: center;
padding: 5px;
}
.btn {
text-align: center;
vertical-align: middle;
padding: .2em .2em;
cursor: pointer;
}
.btn-primary {
color: #52A3FF;
border: 2px solid #52A3FF;
background-color: white;
padding: 0.5em 1.2em;
border-radius: 0em;
}
.btn-primary:hover {
background-color: #52A3FF;
color: white;
}
.btn-addtocart {
}
.main-footer {
background-color: #52A3FF;
color: white;
padding: .25em 0;
}
.main-footer-container {
display: flex;
align-items: center;
}
.center-mini {
width: 40%;
max-height: 100vh;
margin: auto;
}
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>
I'm trying to code this design:
And this is the code I have:
.container-flex {
display: flex;
flex-flow: row;
height: 100px;
}
.left {
flex: 1;
background-color: #2C77A5;
padding-top: 2%;
border-top-left-radius: 6px;
height: 100px;
}
.main {
display: flex;
flex-direction: column;
}
.top {
background: #27698D;
border-bottom: 1px solid #2a2a2a;
border-top-right-radius: 6px;
width: 42px;
height: 50px;
padding-left: 14px;
padding-top: 14px;
}
.middle {
background: #27698D;
border-bottom-right-radius: 6px;
width: 42px;
height: 50px;
padding-left: 14px;
padding-top: 16px;
}
.row-celeste {
height: 22%;
background-color: #8CE8FC;
}
<div class="container-flex">
<div class="left">
<div class="row">
<div class="col-md-7 col-md-offset-1 border-right">
<p class="card-text white-text">Mejorar clima en finanzas</p>
<h4 class="card-subtitle white-text">Ponderación 33%</h4>
</div>
<div class="col-md-4 check-area">
<p class="card-text white-text" id="clicker-calificacion"><i class="fa fa-check text-white" aria-hidden="true"></i> Calificar</p>
</div>
</div>
<div class="row-celeste">
<p class="card-text centered"></p>
</div>
</div>
<section class="main">
<a href="">
<div id="clicker-menu-black" class="col top"><i class="fa fa-bars white-text" aria-hidden="true"></i>
</div>
</a>
<a href="">
<div id="clicker" class="col middle"><i class="fa fa-plus white-text" aria-hidden="true"></i>
</div>
</a>
</section>
</div>
How can I make the light blue row stick to the bottom of ".left" regardless of its height? I've tried positioning, but perhaps I don't really understand it.
You need to use absolute positioning, see the example below:
.container-flex {
display: flex;
flex-flow: row;
height: 100px;
}
.left {
flex: 1;
background-color: #2C77A5;
padding-top: 2%;
border-top-left-radius: 6px;
height: 100px;
position: relative; /* must be set to the container of the absolute positioned element */
}
.main {
display: flex;
flex-direction: column;
}
.top {
background: #27698D;
border-bottom: 1px solid #2a2a2a;
border-top-right-radius: 6px;
width: 42px;
height: 50px;
padding-left: 14px;
padding-top: 14px;
}
.middle {
background: #27698D;
border-bottom-right-radius: 6px;
width: 42px;
height: 50px;
padding-left: 14px;
padding-top: 16px;
}
.row-celeste {
height: 22px;
background-color: #8CE8FC;
position: absolute; /* this will make your div position calculated respecting its container */
bottom: -19px; /* this will stick it to the bottom */
width: 100%;
z-index: -1;
}
<div class="container-flex">
<div class="left">
<div class="row">
<div class="col-md-7 col-md-offset-1 border-right">
<p class="card-text white-text">Mejorar clima en finanzas</p>
<h4 class="card-subtitle white-text">Ponderación 33%</h4>
</div>
<div class="col-md-4 check-area">
<p class="card-text white-text" id="clicker-calificacion"><i class="fa fa-check text-white" aria-hidden="true"></i> Calificar</p>
</div>
</div>
<div class="row-celeste">
<p class="card-text centered"></p>
</div>
</div>
<section class="main">
<a href="">
<div id="clicker-menu-black" class="col top"><i class="fa fa-bars white-text" aria-hidden="true"></i>
</div>
</a>
<a href="">
<div id="clicker" class="col middle"><i class="fa fa-plus white-text" aria-hidden="true"></i>
</div>
</a>
</section>
</div>
The light blue row doesn't need to be a div. It can be just a blue border
#box {
display: inline-flex;
flex-direction: row;
border-radius: 6px;
overflow: hidden;
}
#left {
background-color: #0073a9;
border-bottom: 10px solid #6aebff; /* Light blue "bar" */
display: flex;
flex-direction: row;
}
#left > * {
padding: 10px 20px;
}
#left > *:not(:first-child) {
border-left: 1px solid black;
}
#right {
background-color: #00688f;
display: flex;
flex-direction: column;
font-size: 22px;
font-weight: bold;
}
#right > * {
flex-grow: 1;
flex-basis: 0;
padding: 5px 10px;
text-align: center;
}
#right > *:not(:first-child) {
border-top: 1px solid black;
}
.centered-container {
display: flex;
direction: row;
justify-content: center;
align-items: center;
}
#ellipsis {
line-height: 30%;
}
* {
color: white;
}
#left {
font-family: sans, "Raleway";
}
<div id="box">
<div id="left">
<div id="title-div" class="centered-container">
<div>
<p><b>Mejorar políticas de liderazgo</b><br>Ponderación 40%</p>
</div>
</div>
<div id="qualify-div" class="centered-container">
✔ Calificar
</div>
</div>
<div id="right">
<div id="ellipsis" class="centered-container">
<div>·<br>·<br>·</div>
</div>
<div class="centered-container">
<div>+</div>
</div>
</div>
</div>
Is this OK?
<style>
.container-flex {
display: flex;
flex-flow: row;
height: 100px;
}
.left {
flex: 1;
background-color: #2C77A5;
padding-top: 2%;
border-top-left-radius: 6px;
height: 100px;
}
.main {
display: flex;
flex-direction: column;
}
.top {
background: #27698D;
border-bottom: 1px solid #2a2a2a;
border-top-right-radius: 6px;
width: 42px;
height: 50px;
padding-left: 14px;
padding-top: 14px;
}
.middle {
background: #27698D;
border-bottom-right-radius: 6px;
width: 42px;
height: 50px;
padding-left: 14px;
padding-top: 16px;
}
.row-celeste {
height: 22%;
background-color: #8CE8FC;
}
.row-celeste {
height: 22%;
background-color: #8CE8FC;
bottom: 0;
position: absolute;
width: 100%;
}
</style>
<div class="container-flex">
<div class="left">
<div class="row">
<div class="col-md-7 col-md-offset-1 border-right">
<p class="card-text white-text">Mejorar clima en finanzas</p>
<h4 class="card-subtitle white-text">Ponderación 33%</h4>
</div>
<div class="col-md-4 check-area">
<p class="card-text white-text" id="clicker-calificacion"><i class="fa fa-check text-white" aria-hidden="true"></i> Calificar</p>
</div>
</div>
<div class="row-celeste">
<p class="card-text centered"></p>
</div>
</div>
<section class="main">
<a href="">
<div id="clicker-menu-black" class="col top"><i class="fa fa-bars white-text" aria-hidden="true"></i>
</div>
</a>
<a href="">
<div id="clicker" class="col middle"><i class="fa fa-plus white-text" aria-hidden="true"></i>
</div>
</a>
</section>
</div>
I have these divs that are products
<div class="container">
<div class="product">
<div class="image"><img class="img-responsive" src="http://www.shingpoint.com.pk/Images/Thumbnails/pc-a1-470-59100-080316082835.jpg"/></div>
<div class="description">
<h4 class="productname">ASUS VivoMini PC - UN65H-M030M</h4>
</div>
<div class="price">
<span>Rs. 37,900</span>
<input type="button" class="btn btn-primary btn-sm" value="Details"/>
</div>
</div>
<div class="product">
<div class="image"><img class="img-responsive" src="http://www.shingpoint.com.pk/Images/Thumbnails/pc-a1-470-59100-080316082835.jpg"/></div>
<div class="description">
<h4 class="productname">ASUS VivoMini PC - UN65H-M030M</h4>
</div>
<div class="price">
<span>Rs. 37,900</span>
<input type="button" class="btn btn-primary btn-sm" value="Details"/>
</div>
</div>
</div>
And its CSS
.image{
display: block;
overflow: hidden;
position: relative;
text-align: center;
width: 100%;
max-height: 180px;
height: 60%;
margin-left: auto;
margin-right: auto;
padding-left:.40cm;
}
.description{
margin: 0 auto;
max-width: 95%;
}
.productname{
overflow: hidden;
display: block;
margin: 25px 0 0;
padding: 0;
line-height: 24px;
}
.price{
margin-top: 10px;
margin-bottom: 8px;
font-size: 18px;
font-weight: 500;
color: #E40613;
}
.product{
height: 320px;
border: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
text-align: center;
padding: 10px 0;
}
Now these are just two divs but they can be 10 or 15 through foreach loop when data is fetched from mysql
Now these divs are showing horizontally I want to have them vertically in a container with a slider, if not slider possible then how could displaying vertically be achieved?
You have to add display: inline-block to the product class. You may need to define widths as well if you have many divs.