How to style cards in css - html

So I have this 2 cards aligned the way i want whit bootstrap and display: flex;. When i try to do some some changes in CSS like moving the details class in middle, or to change the width and height of the card etc it won't work. How can i do it ? Here is the code:
<div class="row">
<div class="col-lg-4 col-md-6 pop-up">
<div class="front">
<div>
<img class="girlimg" src="girl.jpg" alt="asdasda" />
<h2 class="activname">Guided hiking tours</h2>
<button class="activbutt" type="button" name="button">
SEE DETAILS
</button>
</div>
<div class="details">
<div class="duration">
<i class="fas fa-clock">Duration</i>
</div>
<div class="people">
<i class="fas fa-user-friends"></i><br />
<p>Max adults:10</p>
</div>
<div class="kids">
<i class="fas fa-child"></i><br />
<p>Max children:3</p>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="col-lg-4 col-md-6 pop-up-2">
<div class="front">
<div>
<img class="girlimg" src="bike.jpg" alt="asdasda" />
<h2 class="activname">Rent a bike(4 hours)</h2>
<button class="activbutt" type="button" name="button">
SEE DETAILS
</button>
</div>
<div class="details">
<div class="duration">
<i class="fas fa-clock">Duration
<p>QUARTER DAY</p> </i>
</div>
<div class="people">
<i class="fas fa-user-friends"></i><br />
<p>Max adults:9</p>
</div>
<div class="kids">
<i class="fas fa-child"></i><br />
<p>Max children:0</p>
</div>
</div>
</div>
</div>
</div>
</div>

I think you should use the card class from bootstrap. https://getbootstrap.com/docs/4.0/components/card/. Then you will be able to change the default width & height of the card by overriding it from custom CSS.

Related

Column Space, CSS Grid Layout

I am creating a Template HTML CSS page for a To-Do Application and I am using Grid Layout; Container-Fluid with Rows and Columns. I have spaced a Button, some Text, and further 2 Buttons as follows:
<div class="container-fluid">
<div class="row">
<div class="col-3"></div>
<div class="col-6">
<div class="card">
<div class="card-body">
<div class="flex-heading">
<i
class="fas fa-clipboard-list fa-4x icon-backgroundcolor addmain-icon"
></i>
<p class="subhead">ADD ITEM</p>
</div>
<hr />
<div class="row within">
<div class="col-6">
<label class="add_line"
>What do you want to do?</label
>
</div>
</div>
<div class="row within">
<div class="col-8">
<div class="md-form form-group">
<input
type="text"
class="form-control"
name = "description"
[(ngModel)] = "description"
placeholder="I want to do something good"
(keydown.enter)="onKeydown($event, content)"
/>
</div>
</div>
<div class="col-4">
<button
type="button"
class="btn btn-flat add-button"
(click)="open(content)"
>
<i
class="fas fa-plus-circle fa-2x add-icon"
></i>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-3"></div>
</div>
</div>
There are Gutters between each Column and the text goes to the next line. What can be a good way to decrease gutter space and let the text space out?

How to align 3 cards on a horizontally line

I recently started to use html, css and bootstrap-4, I am trying to make a page with a nav-bar, 4 cards and a footer whit info, I used bootstrap to make the row and cols but it seems that they not align how I want. What can I do in this mess?
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<link rel="stylesheet" href="MYCELIUM.CSS">
<link rel="stylesheet" href="activities.css">
</head>
<script src="https://kit.fontawesome.com/a8809e8f88.js" crossorigin="anonymous"></script>
<body>
<div class="col-md-4 col-sm-6 boxy" class="wrapper">
<div class="pop-up">
<div class="front">
<img class="girlimg" src="girl.jpg" alt="asdasda">
<p><h2 class="activname">Guided hiking tours</h2></p>
<button class="activbutt" type="button" name="button">SEE DETAILS</button>
<div class="details">
<div class="duration">
<i class="fas fa-clock">Duration</i>
</div>
<div class="people">
<i class="fas fa-user-friends"></i><br>
<p>Max adults:10</p>
</div>
<div class="kids">
<i class="fas fa-child"></i><br>
<p>Max children:3</p>
</div>
</div>
</div>
</div>
<p></p><br>
<div class="pop-up-2">
<div class="card-2">
<img class="girlimg" src="bike.jpg" alt="bikeactiv">
<p> <h2 class="activname1">Rent a bike(4 hours)</h2> </p>
<button class="activbutt1" type="button" name="button1">SEE DETAILS</button>
</div>
<div class="details">
<div class="duration1">
<i class="fas fa-clock">Duration</i><br>
<p></p>
<p> <span class="quarter">QUARTER DAY</span> </p>
</div>
<div class="adults">
<i class="fas fa-user-friends"></i><br>
<p>Max adults:10</p>
</div>
<div class="kids1">
<i class="fas fa-child"></i><br>
<p>Max children:3</p>
</div>
</div>
</div>
</div>
</div>
<div class="wrapper1">
<div class="pop-up-3">
<div class="card-3">
<img class="girlimg" src="climbing.jpg" alt="clim">
<p> <h2 class="climbing">Climbing</h2> </p>
<button class="activbutt1" type="button" name="button">SEE DETAILS</button>
</div>
<div class ="duration2">
<i class="fas fa-clock">Duration</i><br>
<p></p>
<p> <span>FULL DAY</span> </p>
</div>
<div class="adults1">
<i class="fas fa-user-friends"></i><br>
<p>Max adults:10</p>
</div>
<div class="kids2">
<i class="fas fa-child"></i><br>
<p>Max children:3</p>
</div>
</div>
<div class="pop-up-4">
<div class="card-4">
<img class="girlimg" src="canoe.jpg" alt="clim">
<p> <h2 class="climbing">Canoe</h2> </p>
<button class="activbutt1" type="button" name="button">SEE DETAILS</button>
</div>
<div class ="duration2">
<i class="fas fa-clock">Duration</i><br>
<p></p>
<p> <span class="quarter">QUARTER DAY</span> </p>
</div>
<div class="adults1">
<i class="fas fa-user-friends"></i><br>
<p>Max adults:6</p>
</div>
<div class="kids2">
<i class="fas fa-child"></i><br>
<p>Max children:2</p>
</div>
</div>
</div>
</body>
</html>
You have to make into a row like:
Basic structure:
<div class="row">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
</div>
You can make it evolve like:
<div class="row">
<div class="col row mx-0">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
</div>
<div class="col"></div>
<div class="col"></div>
</div>

How to move items in card using bootstrap-3

So i have this card, i am not sure how to pace items in it the way i want. In the html code i have used bootstrap-3. Css is just noob basic pixels movement.
<body>
<div class="row">
<div class="col-lg-4 col-md-6 pop-up">
<div class="front">
<img class="girlimg" src="girl.jpg" alt="asdasda" />
<h2 class="activname">Guided hiking tours</h2>
<button class="activbutt" type="button" name="button">
SEE DETAILS
</button>
<div class="details">
<div class="duration">
<i class="fas fa-clock">Duration</i>
</div>
<div class="people">
<i class="fas fa-user-friends"></i><br />
<p>Max adults:10</p>
</div>
<div class="kids">
<i class="fas fa-child"></i><br />
<p>Max children:3</p>
</div>
</div>
</div>
</div>
<br />
.front {
display: flex;
}
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
</head>
<body>
<div class="row">
<div class="col-lg-4 col-md-6 pop-up">
<div class="front">
<div>
<img class="girlimg" src="https://picsum.photos/250/150" alt="asdasda" />
<h2 class="activname">Guided hiking tours</h2>
<button class="activbutt" type="button" name="button">
SEE DETAILS
</button>
</div>
<div class="details">
<div class="duration">
<i class="fas fa-clock">Duration</i>
</div>
<div class="people">
<i class="fas fa-user-friends"></i><br />
<p>Max adults:10</p>
</div>
<div class="kids">
<i class="fas fa-child"></i><br />
<p>Max children:3</p>
</div>
</div>
</div>
</div>
</div>
<br />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</body>
</html>
This just uses flexbox, which is incredibly useful. If you want to learn more CSS-Tricks has a good article: A Complete Guide to Flexbox

Bootstrap row messing up

HTML
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-2"></div>
<div class="col-2 Jumbooptions" id="create" onclick="location.href='#';">
<p class="efr">Create</p>
<i class="fas fa-plus fa-2x" id="ci"></i>
</div>
<div class="col-2 Jumbooptions" id="add" onclick="location.href='#';">
<p class="efr">Add</p>
<i class="fas fa-address-book fa-2x" id="ai"></i>
</div>
<div class="col-2 Jumbooptions" id="stats" onclick="location.href='#';">
<p class="efr">Statistics</p>
<i class="fas fa-chart-pie fa-2x" id="si"></i>
</div>
<div class="col-2 Jumbooptions" id="export" onclick="location.href='#';">
<p class="efr">Export</p>
<i class="fas fa-file-export fa-2x" id="ei"></i>
</div>
</div>
<div class="row" id="bigger">
<div class="col-2" id=""></div>
<div id="created" class="dropdown col-4">
<h2>CREATE</h2>
<p>as many sheets as you want with ease!</p>
</div>
<div id="addd" class="dropdown col-4">
</div>
<div id="statsd" class="dropdown col-4">
</div>
<div id="exportd" class="dropdown col-4">
</div>
</div>
</div>
</div>
CSS
height:70px !important;
width:700px;
margin-left:47px
}
If I make the "height" any more than 70 the rest of the row goes to the start of the jumbotron
When height is less than 70: https://gyazo.com/6601be928cb893b5355c78fbc792e694
When height is more than 70 (200): https://gyazo.com/6b6f96fa6eadcffc6db3dd427cac8d03
I'm really not sure what to do.

Bootstrap grid layout alignment issue

Link to my project, I've been working on this project to make my portfolio, the grids of my expertise, portfolio and education block aren't aligning with respect to screen size, it remains to the left on large screen, please provide me necessary changes to be made so overcome this problem.
Ps: if I use "center" for alignment in these block, the website still doesn't work properly.
<div class="content container-fluid">
<h1 align="center">My Expertise</h1>
<div class="projects conatiner-fluid">
<div class="row">
<div class="col-xs-4" align="center">
<i class="fa fa-code fa-3x" aria-hidden="true" align="center"></i>
<div class="id1">
<h3 align="center">CODE</h3>
<p>I'm a versatile programmer with knowledge and interest to learn and code in any language</p>
</div>
</div>
<div class="col-xs-4" align="center">
<i class="fa fa-desktop fa-3x" aria-hidden="true" align="center"></i>
<div class="id2">
<h3 align="center">UI/UX</h3>
<p>I'm a front-end developer and UI/UX designer who loves building and designing websites from scratch</p>
</div>
</div>
<div class="col-xs-4" align="center">
<i class="fa fa-cogs fa-3x" aria-hidden="true" align="center"></i>
<div class="id3">
<h3>Machine Learning</h3>
<p>I'm keenly interested in machine learning and I have implemented a project to detect Hand-written digits using python</p>
</div>
</div>
</div>
</div>
<div class="projects">
<div>
<h1 align="center">Portfolio</h1></div>
<div class="conatiner-fluid">
<div class="row">
<div class="col-xs-4" align="center">
<img src="http://i68.tinypic.com/mw5vki.png" class="img-responsive" align="center" alt="Nikola Tesla">
</div>
<div class="col-xs-4" align="center">
<img src="http://i68.tinypic.com/mw5vki.png" class="img-responsive" align="center" alt="Nikola Tesla">
</div>
<div class="col-xs-4" align="center">
<img src="http://i68.tinypic.com/mw5vki.png" class="img-responsive" align="center" alt="Nikola Tesla">
</div>
</div>
</div>
<div class="conatiner-fluid">
<div class="row">
<div class="col-xs-4" align="center">
<img src="http://i68.tinypic.com/mw5vki.png" class="img-responsive" align="center" alt="Nikola Tesla">
</div>
<div class="col-xs-4" align="center">
<img src="http://i68.tinypic.com/mw5vki.png" class="img-responsive" align="center" alt="Nikola Tesla">
</div>
<div class="col-xs-4" align="center">
<img src="http://i68.tinypic.com/mw5vki.png" class="img-responsive" align="center" alt="Nikola Tesla">
</div>
</div>
</div>
</div>
<div class="education">
<div>
<h1 align="center">My Education</h1>
</div>
<div class="projects container-fluid">
<div class="row">
<div class="col-xs-4" align="center">
<i class="fa fa-graduation-cap fa-1x" aria-hidden="true" align="center"></i>
<div class="id1">
<h3 align="center">Secondary Education</h3>
<p>Passed out secondary education with a percentage of 89.6% from ICSE board</p>
</div>
</div>
<div class="col-xs-4" align="center">
<i class="fa fa-graduation-cap fa-2x" aria-hidden="true" align="center"></i>
<div class="id2">
<h3 align="center">High Secondary Education</h3>
<p>Passed out higher secondary education from CBSE board with science as stream scoring 85%</p>
</div>
</div>
<div class="col-xs-4" align="center">
<i class="fa fa-graduation-cap fa-3x" aria-hidden="true" align="center"></i>
<div class="id3">
<h3>Undergraduate</h3>
<p>Graduate from Jalpaiguri Goevrnment Engineering College with Bachelor in Information Technology with a CGPA of 8</p>
</div>
</div>
</div>
</div>
</div>
<div class="hireme" align="center">
<p>Want to get in touch with me, please fill the contact information and I'll respond as soon as possible
<p>
<button type="button" class="btn1">
<span>I'm Available for Hire</span>
</button>
</div>
<div class="mylinks" align="center">
<footer>Designed and Coded by <em>Nilabja Bhattacharya</em></footer>
<div class="icons" align="center">
<i class="fa fa-github" aria-hidden="true"></i>
<i class="fa fa-free-code-camp" aria-hidden="true"></i>
<i class="fa fa-quora" aria-hidden="true"></i>
<i class="fa fa-codepen" aria-hidden="true"></i>
<i class="fa fa-linkedin" aria-hidden="true"></i>
<i class="fa fa-stack-overflow" aria-hidden="true"></i>
</div>
</div>
</div>
Your .row has a max-width of 75rem. Overwrite this by:
.row {
max-width: none;
}