remove vertical space between divs - html

I am trying to add two images in one row and it should go on continuously in a vertical direction but the issue I am facing is I am getting space between the images vertically.
I tried to add CSS but it did not work. (note: I am looping through images so I can't apply CSS for different images, it needs to be applicable to all images at once)
.menu-spacer {
flex: 1 1 auto;
}
a {
padding-right: 5em;
}
.menu-spacer1 {
flex: 1 1 auto;
padding-top: 15em;
}
#second-row {
margin-top: 2em;
}
#first-row {
border-top-left-radius: 3em;
box-shadow: 0 16px 24px 2px rgb(245, 245, 248), 0 6px 15px 1px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.3);
}
#search-button {
margin-left: 7em;
border-radius: 2em;
width: 24em;
height: 30px;
outline-style: none;
text-align: center;
border-width: 2px;
border-color: black;
}
#mn {
height: 12em;
}
h1 {
color: white;
margin-left: 2em;
margin-top: 3em;
font-size: 28px;
}
#img {
margin-top: 9em;
padding: 0;
width: 12em;
margin-left: 2em;
}
#img1 {
height: 13em;
padding: 0em;
}
#img2 {
float: right;
/* float: top; */
height: 13em;
position: relative;
top: -15em;
}
.example-card {
padding: 0em;
}
p {
margin-top: 10em;
margin-left: -214px;
color: #e67500;
font-size: 15px;
font-family: ProximaNova, Arial, Helvetica Neue, sans-serif;
}
h2 {
margin-top: 12em;
margin-left: -567px;
color: #e67500;
font-size: 15px;
font-family: ProximaNova, Arial, Helvetica Neue, sans-serif;
}
#rating {
font-size: 15px;
margin-top: 16em;
margin-left: -95px;
color: white;
}
mat-icon {
font-size: 15px;
position: relative;
top: 2px;
left: 5px;
}
#ratingcount {
font-size: 12px;
color: #e67500;
margin-top: 24em;
margin-left: -39px;
}
#time {
font-size: 16px;
margin-top: 15em;
margin-left: -32em;
color: white;
}
#timealias {
font-size: 12px;
margin-top: 24em;
margin-left: -5em;
color: #e67500;
}
#cost {
font-size: 16px;
color: white;
margin-top: 15em;
position: relative;
right: 32em;
}
#costalias {
position: relative;
font-size: 12px;
top: 12em;
left: -45em;
color: #e67500;
}
.mat-divider {
color: white;
background-color: yellow;
height: 43px;
position: relative;
left: -554px;
top: 132px;
}
/* #right-content{
margin-left: 74em;
margin-top: -13em;
} */
#menu-img {
margin-right: 4em;
/* margin-top: 6em; */
height: 13em;
margin-top: 0em;
/* vertical-align: bottom; */
}
#menu-name {
margin-left: 1.5em;
margin-top: 1em;
color: #282c3f;
font-size: 15px;
font-weight: 500;
font-family: Roboto, "Helvetica Neue", sans-serif;
}
#veg-img {
position: relative;
top: 115px;
right: 332px;
width: 15px;
}
#menu-type {
position: relative;
top: -10em;
left: 236px;
font-family: ProximaNova, Arial, Helvetica Neue, sans-serif;
color: #7e808c;
font-size: 13px;
}
#menu-price {
position: relative;
top: -275px;
right: -236px;
color: #535665;
font-size: 15px;
}
.menu-button {
color: green;
background-color: white;
border-color: yellowgreen;
position: relative;
top: -319px;
left: 194px;
width: 5em;
height: 2em;
border-style: solid;
}
<app-swiggy-header></app-swiggy-header>
<div class="row-6" id="second-row">
<mat-toolbar [ngStyle]="{'backgroundColor': '#171a29'}" id="mn">
<mat-toolbar-row>
<img src="assets/swiggyimages/moriz.jpg" id="img">
<h1>Moriz Restaurant</h1>
<p>Fast Food, Snacks, Pastas, Salads, Beverages, Home Food, Italian, North Indian, Ma</p>
<h2>ACES Layout</h2>
<span id="rating">
<mat-icon>star</mat-icon>4.5
</span>
<span id="ratingcount">100+ Ratings</span>
<hr>
<mat-divider vertical></mat-divider>
<span id="time">30 mins</span>
<span id="timealias">Delivery Time</span>
<hr>
<mat-divider vertical></mat-divider>
<span id="cost">150</span>
<span id="costalias">Cost for two</span>
</mat-toolbar-row>
</mat-toolbar>
</div>
<div class="row">
<div class="col-3" id="left-content">abc</div>
<div class="col-xs-12 col-md-8">
<div class="row">
<div class="col-xs-4 ">
<img src="assets/swiggyimages/moriz.jpg" class="img-responsive" alt="Logo" id="menu-img">
<img src="assets/swiggyimages/veg.png" id="veg-img">
<p id="menu-name">Paneer-Veg-Biryani</p>
<p id="menu-type">Rice</p>
<p id="menu-price">105</p>
<button class="menu-button">ADD</button>
</div>
<div class="col-xs-4 ">
<img src="assets/swiggyimages/moriz.jpg" class="img-responsive" alt="Logo" id="menu-img">
<img src="assets/swiggyimages/veg.png" id="veg-img">
<p id="menu-name">Paneer-Biryani</p>
<p id="menu-type">veg</p>
<p id="menu-price">105</p>
<button class="menu-button">ADD</button>
</div>
<div class="col-xs-4 ">
<img src="assets/swiggyimages/moriz.jpg" class="img-responsive" alt="Logo" id="menu-img">
<img src="assets/swiggyimages/veg.png" id="veg-img">
<p id="menu-name">Paneer-Biryani</p>
<p id="menu-type">veg</p>
<p id="menu-price">105</p>
<button class="menu-button">ADD</button>
</div>
<div class="col-xs-4 ">
<img src="assets/swiggyimages/moriz.jpg" class="img-responsive" alt="Logo" id="menu-img">
<img src="assets/swiggyimages/veg.png" id="veg-img">
<p id="menu-name">Paneer-Biryani</p <p id="menu-type">veg</p>
<p id="menu-price">105</p>
<button class="menu-button">ADD</button>
</div>
</div>
</div>
<div class="col-3" id="right-content">mnc</div>
</div>

Related

Extra whitespace on mobile version of website

I've trying to make a website just for a home project but having some trouble with the css for mobile.
There seems to be a lot of whitespace surrounding the elements to the right and bottom of the site. I'm newer to the world of CSS so any help would be appreciated.
Screenshot of what chrome shows in developer mode.
#media screen and (max-width:450px) {
body {
margin: 0 0 0 0;
padding: 0 0 0 0;
max-width: 100vw;
overflow-x: hidden;
}
html{scroll-behavior:smooth}
.navbar {
background-color: #008B8B;
position: fixed;
top: 0;
z-index: 100;
width: 100vw;
}
.navbar a {
text-decoration: none;
display: inline-block;
float: center;
padding-bottom: 20px;
}
.logo{
display: none;
}
.loginLogo{
width = 1px;
height = 1px;
visibility: hidden;
}
.navbar-name{
color: #f2f2f2;
font-size:25px;
padding-left: 25%;
font-family: 'Lobster', cursive;
}
.navbar-home{
font-size: 17px;
padding-top: 5px;
padding-right: 10px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-products{
font-size: 17px;
padding-top: 5px;
padding-right: 10px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-about{
font-size: 17px;
padding-top: 5px;
padding-right: 10px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-contact{
font-size: 17px;
padding-top: 5px;
padding-right: 17.5%;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-login{
font-size: 1px;
padding-top: 1px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
visibility: hidden;
}
/* Change the color of links on hover */
.navbar-home:hover {
color: black;
}
.navbar-products:hover {
color: black;
}
.navbar-about:hover {
color: black;
}
.navbar-contact:hover {
color: black;
}
.navbar-login:hover {
color: black;
}
/* Add a color to the active/current link */
.navbar a.active {
background-color: #4CAF50;
color: white;
}
/*--------HOME PAGE------------*/
.homePage{
margin: 0 0 0 0;
padding: 0;
width: 100vw;
height: 820px;
background-image: url(multiGrain.jpg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.homePageH1{
position: absolute;
text-align: center;
overflow: hidden;
white-space: nowrap;
top: 26%;
left:50%;
transform: translateX(-50%) translateY(-50%);
font-size: 40px;
color: white;
}
.homePageH2{
position: absolute;
text-align: center;
display: inline;
top: 28%;
left: 50%;
text-align: center;
transform: translateX(-50%) translateY(-50%);
font-size: 20px;
color: white;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
display: inline-block;
}
.aboutUsButton{
position: absolute ;
text-align: center;
top: 31%;
left:30%;
padding: 10px;
padding-right: 20px;
padding-left: 20px;
transform: translateX(-50%) translateY(-50%);
background-color: rgb(0, 159, 159);
border-radius: 25px;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
text-decoration: none;
}
.ourProductsButton{
position: absolute ;
text-align: center;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
display: inline-block;
top: 31%;
left:70%;
padding: 10px;
padding-right: 18px;
padding-left: 18px;
transform: translateX(-50%) translateY(-50%);
background-color: rgb(0, 159, 159);
border-radius: 25px;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
text-decoration: none;
}
/*-------ABOUT US PAGE----------*/
.aboutUsPage{
margin: 0 0 0 0;
padding: 0px;
background-color: white;
height: auto;
width: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.aboutUsH1{
position: relative;
padding-top: 20px;
padding-left: 20px;
margin: 0px;
text-align: left;
display: block;
width: 90%;
top: 20%;
font-size: 20px;
font-family: 'Lobster', cursive;
color: black;
background-color: rgb(255,255,255);
}
.aboutUsP{
position: relative;
padding-top: 20px;
padding-left: 20px;
padding-bottom: 30px;
margin: 0px;
text-align: left;
float: bottom;
display: block;
width: 90%;
top: 5%;
font-size: 15px;
font-family: 'Lobster', cursive;
color: black;
background-color: rgb(255,255,255);
}
.mixerImage{
position: relative;
object-fit: cover;
width: 100%;
height: 150px;
}
/*--------PRODUCTS PAGE------------*/
.productsPage{
position: relative;
margin: 0px;
padding: 0px;
background-color: white;
height: 300px;
width: auto;
}
.productsH1{
position: relative;
text-align: left;
top: 5%;
left: 4%;
font-size: 25px;
font-family: 'Titillium Web', sans-serif;
color: black;
}
.productsP{
position: relative;
padding: 10px;
padding-top: 15px;
text-align: left;
float: inherit;
width: 45%;
left: 2%;
font-size: 15px;
font-family: 'Titillium Web', sans-serif;
color: black;
background-color: white;
}
.productListButton{
position: absolute ;
text-align: center;
left: 2%;
padding: 10px;
padding-right: 20px;
padding-left: 20px;
background-color: black;
border-radius: 25px;
font-family: 'Titillium Web', sans-serif;
letter-spacing: 5px;
color: white;
text-decoration: none;
}
.slideshowImage1{
position: absolute;
width: auto;
left: 55%;
top: 15%;
height: 100px;
float: right;
margin: 10px;
padding: 10px;
box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
.slideshowImage2{
width = 0px;
height = 0px;
visibility: hidden;
}
/*-------CONTACT US PAGE---------*/
.contactPage{
margin: 0 0 0 0;
padding: 0px;
background-image: url(rollingPin2.JPG);
height: 700px;
width: 100%;
background-repeat: no-repeat;
background-size: cover;
background-size: 200% 100%;
}
.contactH1{
position: relative;
text-align: center;
overflow: hidden;
white-space: nowrap;
top: 10%;
left:0%;
font-size: 70px;
letter-spacing: 3px;
color: white;
font-family: 'Dancing Script', cursive;
}
.contactP1{
position: relative;
text-align: center;
top: 10%;
left:0%;
font-size: 18px;
color: white;
font-family: 'Slabo 27px', serif;
}
.contactP2{
position: relative;
text-align: center;
top: 10%;
left:0%;
font-size: 18px;
color: white;
font-family: 'Slabo 27px', serif;
}
.contact-form{
position: relative;
top: 15%;
width: 80%;
left: 47.5%;
transform: translateX(-50%);
}
input[type=text], select, textarea {
width: 100%; /* Full width */
padding: 12px; /* Some padding */
border: 1px solid #ccc; /* Gray border */
font-family: 'Titillium Web', sans-serif;
border-radius: 4px; /* Rounded borders */
margin-top: 6px; /* Add a top margin */
margin-bottom: 16px; /* Bottom margin */
resize: none; /* Allow the user to vertically resize the textarea (not horizontally) */
}
/* Style the submit button with a specific background color etc */
input[type=submit] {
width: 105%;
background-color: #008B8B;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
/* When moving the mouse over the submit button, add a darker green color */
input[type=submit]:hover {
background-color: black;
}
.nameInput{
position: relative;
top: 0px;
color: white;
}
.emailInput{
position: relative;
top: 5px;
color: white;
}
.messageInput{
position: relative;
top: 5px;
color: white;
}
.submitButton{
position: relative;
top: 5px;
}
/*--------FOOTER---------*/
.facebookLogo{
width: 0%;
height: 0%;
visibility: hidden;
}
.footer {
width: 0px;
height: 0px;
visibility: hidden;
}
.footerp1{
width: 0px;
height: 0px;
visibility: hidden;
}
.footerp2{
width: 0px;
height: 0px;
visibility: hidden;
}
.footerp3{
width: 0px;
height: 0px;
visibility: hidden;
}
}
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=yes">
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:wght#600&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Slabo+27px&display=swap" rel="stylesheet">
<title>Doughboys Bakery</title>
<link href="StyleSheet.css" rel="stylesheet">
</head>
<body>
<header class="site-header">
<nav class="navbar">
<img class = "logo" src="Doughboys Logo - Website Version.png" alt="Logo" width="80"height="45.109">
<a class="navbar-name" href="">Doughboy's Bakery.</a>
<a class="navbar-login" href="">Log In</a>
<img class = "loginLogo" src="loginLogo2.png" onmouseover="this.src='loginLogo2Black.png';" onmouseout="this.src='loginLogo2.png';" width="50"height="28.889"/>
<a class="navbar-contact" href="#contactPage">Contact</a>
<a class="navbar-products" href="#productsPage">Products</a>
<a class="navbar-about" href="#aboutUsPage">About</a>
<a class="navbar-home" href="#homePage">Home</a>
</nav>
</header>
<div class = "homePage" id="homePage">
<h1 class="homePageH1">Quality or Quantity</h1>
<h2 class="homePageH2">We're here to give you both</h2>
<div class = "homePageButtons">
<a class="aboutUsButton" href="#aboutUsPage">About Us</a>
<a class="ourProductsButton" href="#productsPage">Our Products</a>
</div>
</div>
<div class = "aboutUsPage" id="aboutUsPage">
<div class = "aboutUsText">
<h1 class="aboutUsH1">Who we are.</h1>
<p class="aboutUsP">Doughboys Bakery is a locally owned and operated wholesale bakery located near the city centre of Palmerston North. We produce traditional bakery goods like the classic Mince and Cheese Pies and Custard Squares. <br/><br/>We deliver actively in the Manawatu-Whanganui, Horowhenua & Wairarapa regions. (T's & C's Apply)<br/><br/>Use the contact section below to see how we can help suit your baking needs.</p>
</div>
</div>
<div class = "productsPage" id="productsPage">
<h1 class="productsH1">What we make.</h1>
<p class="productsP">At Doughboys' we supply traditionally sold bakery goods all the way from the classic Mince and Cheese Pie to the humble Scone.</p>
<button class="productListButton" type="submit" onclick="window.open('ProductList.doc')">Full Product List</button>
<div id="slideshow">
<div>
<img class="slideshowImage1" src="fruitPies.jpeg">
</div>
<div>
<img class="slideshowImage2" src="pies.jpg">
</div>
</div>
</div>
<div class="contactPage" id="contactPage">
<h1 class="contactH1">Contact Us.</h1>
<p class="contactP1">ADDRESS: 15 Johnston St </p>
<p class="contactP2">TEL: (06) 123 1234 | doughboys#gmail.net.nz</p>
<div class = "contact-form">
<form id = "contact-form" method="post" action="contactForm.php">
<input class= "nameInput" type="text" id="name" name="name" placeholder="Your name...">
<input class= "emailInput" type="text" id="email" name="email" placeholder="Your email...">
<textarea class= "messageInput" id="message" name="message" placeholder="Write something..." style="height:100px"></textarea>
<input class= "submitButton" type="submit" value="Submit">
</form>
</div>
</div>
<div class="footer">
<a href="https://www.facebook.com/Doughboys-Bakery-Ltd-216199385212667">
<img class = "facebookLogo" src="facebookLogo.png" >
</a>
<p class="footerp1">(06) 123 1234</p>
<p class="footerp2">doughboys#gmail.net.nz</p>
<p class="footerp3">15 Johnston St</p>
</div>
</body>
</html>

Back button not aligning itself to the bottom of a div

I have a div container with some text in it, and a back button. I want the text to be at the top of the div and the back button to be at the bottom of the div. How do I do this? Jsfiddle example of it
#view {
text-align: center;
width: 700px;
height: 700px;
background-color: #197000;
margin: auto;
padding: 20px;
border-radius: 10px;
margin-top: 50px;
margin-bottom: 50px;
font-weight: 400;
font-family: 'Montserrat', sans-serif;
}
#view_back_button {
vertical-align: bottom;
border-radius: 25px;
border: 2px solid #B40000;
background: none;
color: #060606;
width: 150px;
font-weight: 400;
font-size: 12px;
cursor: pointer;
padding: 15px;
font-family: 'Montserrat', sans-serif;
}
<div id="view">
<h1>Name</h1>
<p>Allergies: </p>
<p>Side effects: </p>
<p>Type of medication: </p>
<p>Additional information: </p>
<div id="view_button">
<form>
<button id="view_back_button" type="submit">BACK</button>
</form>
</div>
</div>
Is it useful for you? I just added position: relative; to your container and then used absolute,left,right and bottom to locate it.
#view {
text-align: center;
width: 700px;
height: 700px;
background-color: #197000;
margin: auto;
padding: 20px;
border-radius: 10px;
margin-top: 50px;
margin-bottom: 50px;
font-weight: 400;
font-family: 'Montserrat', sans-serif;
position: relative;
}
#view_back_button {
vertical-align: bottom;
border-radius: 25px;
border: 2px solid #B40000;
background: none;
color: #060606;
width: 150px;
font-weight: 400;
font-size: 12px;
cursor: pointer;
padding: 15px;
font-family: 'Montserrat', sans-serif;
}
#view_button {
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin-bottom: 50px;
}
<div id="view">
<h1>Name</h1>
<p>Allergies: </p>
<p>Side effects: </p>
<p>Type of medication: </p>
<p>Additional information: </p>
<div id="view_button">
<form>
<button id="view_back_button" type="submit">BACK</button>
</form>
</div>
</div>
Archive by revise some css code like below:
#view {
position: relative; /* add */
text-align: center;
width: 700px;
height: 700px;
background-color: #197000;
margin: auto;
padding: 20px;
border-radius: 10px;
margin-top: 50px;
margin-bottom: 50px;
font-weight: 400;
font-family: 'Montserrat', sans-serif;
}
#view_button { /* add */
position: absolute;
bottom: 30px;
width: 100%;
}
#view_back_button {
/* vertical-align: bottom; */
border-radius: 25px;
border: 2px solid #B40000;
background: none;
color: #060606;
width: 150px;
font-weight: 400;
font-size: 12px;
cursor: pointer;
padding: 15px;
font-family: 'Montserrat', sans-serif;
}
<div id="view">
<h1>Name</h1>
<p>Allergies: </p>
<p>Side effects: </p>
<p>Type of medication: </p>
<p>Additional information: </p>
<div id="view_button">
<form>
<button id="view_back_button" type="submit">BACK</button>
</form>
</div>
</div>
#view {
text-align: center;
width: 700px;
height: 700px;
background-color: #197000;
margin: auto;
padding: 20px;
border-radius: 10px;
margin-top: 50px;
margin-bottom: 50px;
font-weight: 400;
font-family: 'Montserrat', sans-serif;
position: relative;
}
#view_back_button {
vertical-align: bottom;
border-radius: 25px;
border: 2px solid #B40000;
background: none;
color: #060606;
width: 150px;
font-weight: 400;
font-size: 12px;
cursor: pointer;
padding: 15px;
font-family: 'Montserrat', sans-serif;
margin-bottom: 20px;
}
#view_button {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
<div id="view">
<h1>Name</h1>
<p>Allergies: </p>
<p>Side effects: </p>
<p>Type of medication: </p>
<p>Additional information: </p>
<div id="view_button">
<form>
<button id="view_back_button" type="submit">BACK</button>
</form>
</div>
</div>
added position: relative to parent container and css for view_button
#view {
text-align: center;
width: 700px;
height: 700px;
background-color: #197000;
margin:auto;
padding: 20px;
border-radius: 10px;
margin-top: 50px;
margin-bottom: 50px;
font-weight: 400;
font-family: 'Montserrat', sans-serif;
position:relative; /* added */
}
/* added*/
#view_button {
position: absolute;
bottom:10px;
width:100%;
}
#view_back_button {
/* removed vertical-align */
border-radius: 25px;
border: 2px solid #B40000;
background: none;
color: #060606;
width: 150px;
font-weight: 400;
font-size: 12px;
cursor: pointer;
padding: 15px;
font-family: 'Montserrat', sans-serif;
}
<div id="view">
<h1>Name</h1>
<p>Allergies: </p>
<p>Side effects: </p>
<p>Type of medication: </p>
<p>Additional information: </p>
<div id="view_button">
<form>
<button id="view_back_button" type="submit">BACK</button>
</form>
</div>
</div>

adjust div when browser resizes

I'm trying to adjust the div containers on my page to fit into the browser window when the browser resizes. I need help with this.
I use the class col-md-2 from bootstrap. There are several other classes in use.
What i want is that the div containers keep maintaining the position inside the whole window.
#font-face {
font-family: Blanch-Condensed;
src: url(BLANCH_CONDENSED.otf);
}
#fully {
right: 14px;
position: relative;
padding-right: 23px;
}
#img1 {
width: 530px;
height: 339px;
padding-left: 49px;
}
#rsoftbackground {
background-color: #D2E3CF;
width: auto;
height: auto;
margin-left: auto;
margin-right: auto;
}
#content2 {
background-color: #EBC083;
width: auto;
height: auto;
}
#menubar {
background-color: #428cba;
font-family: "Oswald";
}
#t2 {
font-family: "Blanch-Condensed";
color: #0840B1;
font-size: 64px;
left: 195px;
position: relative;
background-color: #D2E3CF;
}
#t3 {
font-family: "Blanch-Condensed";
color: #0840B1;
font-size: 22px;
left: 195px;
position: relative;
background-color: #D2E3CF;
}
.opcion1 {
line-height: 35px;
color: white;
font-family: "Blanch-Condensed";
font-weight: bold;
font-size: 20px;
}
.opcion2 {
line-height: 35px;
color: white;
font-family: "Blanch-Condensed";
font-weight: bold;
font-size: 20px;
}
.opcion3 {
line-height: 35px;
color: white;
font-family: "Blanch-Condensed";
font-weight: bold;
font-size: 20px;
}
.opcion4 {
line-height: 35px;
color: white;
font-family: "Blanch-Condensed";
font-weight: bold;
font-size: 20px;
}
.opcion5 {
line-height: 35px;
color: white;
font-family: "Blanch-Condensed";
font-weight: bold;
font-size: 20px;
}
#interiormenu {
width: 150px;
height: 170px;
background-color: #428cba;
position: relative;
top: 0px;
padding-top: 58px;
border-color: #737373;
border-style: solid;
border-width: 3px;
left: 409px;
}
#interiormenu2 {
width: 150px;
height: 170px;
background-color: #428cba;
position: relative;
top: 0px;
padding-top: 58px;
border-color: #737373;
border-style: solid;
border-width: 3px;
left: 409px;
}
#interiormenu3 {
width: 150px;
height: 170px;
background-color: #428cba;
position: relative;
top: 0px;
padding-top: 58px;
border-color: #737373;
border-style: solid;
border-width: 3px;
left: 409px;
}
#interiormenu4 {
width: 150px;
height: 170px;
background-color: #428cba;
position: relative;
top: 0px;
padding-top: 58px;
border-color: #737373;
border-style: solid;
border-width: 3px;
left: 409px;
}
#interiormenu5 {
width: 150px;
height: 170px;
background-color: #428cba;
position: relative;
top: 0px;
padding-top: 58px;
border-color: #737373;
border-style: solid;
border-width: 3px;
left: 409px;
}
.BlueClass {
color: white;
font-family: "Oswald";
font-weight: bold;
width: 150px;
height: 170px;
background-color: #8933B4;
position: relative;
top: 0px;
border-color: #FFFFFF;
border-style: solid;
border-width: 3px;
margin-left: -17px;
margin-top: -60px;
padding-top: 58px;
}
<div class="continer-fluid">
<div class="row" id="fully">
<div class="col-md-2" id="rsoftbackground">
<h1 id="t2">RSOFT S.A</h1>
<h2 id="t3"> Construimos tecnologia para el futuro</h2>
</div>
<div class="row" id="rsoftbackground">
<div class="col-md-2" id="interiormenu">
<div class="text-center">
<div class="sonido1">
<audio src="sonido/switch-flick.wav" preload="auto"></audio>
Quienes Somos
</div>
</div>
</div>
<div class="col-md-2" id="interiormenu2">
<div class="text-center">
<div class="sonido1">
<audio src="sonido/switch-flick.wav" preload="auto"></audio>
Clientes
</div>
</div>
</div>
<div class="col-md-2" id="interiormenu3">
<div class="text-center">
<div class="sonido1">
<audio src="sonido/switch-flick.wav" preload="auto"></audio>
Portafolio
</div>
</div>
</div>
<div class="col-md-2" id="interiormenu4">
<div class="text-center">
<div class="sonido1">
Servicios
</div>
</div>
</div>
<div class="col-md-2" id="interiormenu5">
<div class="text-center">
<div class="sonido1">
Intranet
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="content2">
<img src="fotos/shutterstock_189855374 (1).png" width="530" height="339" id="img1">
</div>
<div class="col-md-12" id="content2">
<p> CREAMOS LO MEJOR PARA TI</p>
</div>
</div>
</div>
In order to do this you might need to use Java Script:
var div = document.getElementsByTagName("div");
for (var i in div){
div[i].width = window.innerWidth;
div[i].height = window.innerHeight;
}

Absolute position of a div inside a div without absolute position

I made a fiddle of my problem to easily see it:
https://jsfiddle.net/6jzb09nd/
I have a series of nested divs. And the very bottom of the nest i want a div absolutely positioned so I can center it inside it's parent div.
It works find when it's the only thing on the page but when I start adding other elements the positioning gets all messed up.
In the fiddle if you uncomment the "//float:left", you can see the positioning break.
Here's the code:
.col-sm-2,
.col-sm-10 {
//float:left;
}
.leftnumouter {
color: #fff;
font-size: 4.5vw;
height: 4.5vw;
width: 4.5vw;
float: left;
background: #393;
position: relative;
border: 0px solid black;
}
.rightnumouter {
color: #fff;
font-size: 4.5vw;
height: 4.5vw;
width: 4.5vw;
float: left;
background: #C33;
position: relative;
border: 0px solid black;
}
.leftnuminner {
color: #000;
position: absolute;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.rightnuminner {
color: #fff;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.lefttextouter {
background: #3C9;
border-radius: 0 1.5vw 1.5vw 0;
color: #000;
font-size: 3vw;
height: 3.2vw;
text-transform: uppercase;
float: left;
padding: 0 0 0 0;
position: relative;
}
.righttextouter {
background: #C69;
border-radius: 0 1.5vw 1.5vw 0;
color: #000;
font-size: 3vw;
height: 3.2vw;
text-transform: uppercase;
float: left;
padding: 0 0 0 .2vw;
position: relative;
}
.lefttextinner {
color: #000;
margin: 0 .5vw 0 0;
}
.righttextinner {
color: #000;
margin: 0 1vw 0 0;
}
<div class="col-sm-2"> Blah
</div>
<div class="col-sm-10">
<div class="preview">
<div class="databubble">
<div class="leftnumouter">
<div class="leftnuminner">5
</div>
</div>
<div class="lefttextouter">
<div class="lefttextinner">Sales
</div>
</div>
</div>
<div class="databubble">
<div class="rightnumouter">
<div class="rightnuminner">3
</div>
</div>
<div class="righttextouter">
<div class="righttextinner">Orders
</div>
</div>
</div>
</div>
</div>
Since an element with float collapse to its content, you need to give it a width
.col-sm-2,
.col-sm-10 {
float:left;
width: 100%;
}
.leftnumouter {
color: #fff;
font-size: 4.5vw;
height: 4.5vw;
width: 4.5vw;
float: left;
background: #393;
position: relative;
border: 0px solid black;
}
.rightnumouter {
color: #fff;
font-size: 4.5vw;
height: 4.5vw;
width: 4.5vw;
float: left;
background: #C33;
position: relative;
border: 0px solid black;
}
.leftnuminner {
color: #000;
position: absolute;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.rightnuminner {
color: #fff;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.lefttextouter {
background: #3C9;
border-radius: 0 1.5vw 1.5vw 0;
color: #000;
font-size: 3vw;
height: 3.2vw;
text-transform: uppercase;
float: left;
padding: 0 0 0 0;
position: relative;
}
.righttextouter {
background: #C69;
border-radius: 0 1.5vw 1.5vw 0;
color: #000;
font-size: 3vw;
height: 3.2vw;
text-transform: uppercase;
float: left;
padding: 0 0 0 .2vw;
position: relative;
}
.lefttextinner {
color: #000;
margin: 0 .5vw 0 0;
}
.righttextinner {
color: #000;
margin: 0 1vw 0 0;
}
<div class="col-sm-2"> Blah
</div>
<div class="col-sm-10">
<div class="preview">
<div class="databubble">
<div class="leftnumouter">
<div class="leftnuminner">5
</div>
</div>
<div class="lefttextouter">
<div class="lefttextinner">Sales
</div>
</div>
</div>
<div class="databubble">
<div class="rightnumouter">
<div class="rightnuminner">3
</div>
</div>
<div class="righttextouter">
<div class="righttextinner">Orders
</div>
</div>
</div>
</div>
</div>
Or set up a few more rules to make it all behave
.preview {
overflow: hidden;
white-space: nowrap;
}
.databubble {
display: inline-block;
}
Sample
.col-sm-2,
.col-sm-10 {
float:left;
}
.col-sm-2:after,
.col-sm-10:after {
content: '';
clear: both;
display: block;
}
/* added these 2 rules */
.preview {
overflow: hidden;
white-space: nowrap;
}
.databubble {
display: inline-block;
}
.leftnumouter {
color: #fff;
font-size: 4.5vw;
height: 4.5vw;
width: 4.5vw;
float: left;
background: #393;
position: relative;
border: 0px solid black;
}
.rightnumouter {
color: #fff;
font-size: 4.5vw;
height: 4.5vw;
width: 4.5vw;
float: left;
background: #C33;
position: relative;
border: 0px solid black;
}
.leftnuminner {
color: #000;
position: absolute;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.rightnuminner {
color: #fff;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.lefttextouter {
background: #3C9;
border-radius: 0 1.5vw 1.5vw 0;
color: #000;
font-size: 3vw;
height: 3.2vw;
text-transform: uppercase;
float: left;
padding: 0 0 0 0;
position: relative;
}
.righttextouter {
background: #C69;
border-radius: 0 1.5vw 1.5vw 0;
color: #000;
font-size: 3vw;
height: 3.2vw;
text-transform: uppercase;
float: left;
padding: 0 0 0 .2vw;
position: relative;
}
.lefttextinner {
color: #000;
margin: 0 .5vw 0 0;
}
.righttextinner {
color: #000;
margin: 0 1vw 0 0;
}
<div class="col-sm-2"> Blah
</div>
<div class="col-sm-10">
<div class="preview">
<div class="databubble">
<div class="leftnumouter">
<div class="leftnuminner">5
</div>
</div>
<div class="lefttextouter">
<div class="lefttextinner">Sales
</div>
</div>
</div>
<div class="databubble">
<div class="rightnumouter">
<div class="rightnuminner">3
</div>
</div>
<div class="righttextouter">
<div class="righttextinner">Orders
</div>
</div>
</div>
</div>
</div>

How to align div to bottom in parent element

I'm using the foundation framework to create a website, I am having a little trouble aligning a div class container to the bottom of the parents container.
Here is a photo of the problem.
Notice the first image, everything is aligned properly. The second image on the other hand the <div> content is way off. I have it set to bottom:0; in the css but it's not working.
Here is the CSS:
.container-home {
max-width: 1175px;
background: #fff;
margin: 0 auto;
padding: 20px 0px 0 0px;
position: relative;
z-index: 1;
}
.first-title-music {
background: url('http://cdn.ratedrnb.com/2016/06/large-title.png');
width: 100%;
max-width: 425px;
height: 160px;
position: absolute;
bottom: 0;
padding: 5% 0 0 3%;
clear: bottom;
}
.artist-title {
color: #fff;
font-family: poppins;
font-weight: 700;
text-transform: uppercase;
font-size: 36px;
line-height: 22px;
}
.song-title {
color: #fff;
font-family: poppins;
font-weight: 300;
text-transform: uppercase;
font-size: 24px;
}
.big-play {
position: absolute;
top: 150px;
left: 170px;
}
.second-title-music {
background: url('http://cdn.ratedrnb.com/2016/06/small-title.png');
width: 100%;
max-width: 190px;
height: 70px;
position: absolute;
bottom: 0;
padding: 0;
}
.artist-title-small {
color: #fff;
font-family: poppins;
font-weight: 700;
text-transform: uppercase;
font-size: 18px;
line-height: 20px;
}
.song-title-small {
color: #fff;
font-family: poppins;
font-weight: 300;
text-transform: uppercase;
font-size: 14px;
}
.big-play {
position: absolute;
top: 150px;
left: 170px;
}
and here is the html:
<div class="row container-home">
<div class="row column" style="position:relative; padding:15px 0 0 2%;">
<div class="medium-6 column" style="max-width:425px; margin:0px; padding:0;">
<img src="http://cdn.ratedrnb.com/2016/06/mario2.png">
<div class="medium-4 column first-title-music">
<h1 class="artist-title">MARIO</h1>
<h1 class="song-title">I NEED MORE</h1>
</div>
<div class="large-12 column big-play">
<img src="http://cdn.ratedrnb.com/2016/06/big-play2.png">
</div>
</div>
<div class="medium-6 column" style="max-width:190px;max-height:190px; margin:0px; padding:0px; float:left;">
<img src="http://cdn.ratedrnb.com/2016/06/alicia2.png">
<div class="medium-4 column second-title-music">
<h1 class="artist-title-small">ALICIA KEYS</h1>
<h1 class="song-title-small">IN COMMON</h1>
</div>
</div>
</div>
</div>
Here is what I am trying to accomplish.
Does anyone have a solution as to why the bottom aligned <div> in the second part of the html code is stretching that far beyond the height of the parent div.
Instead of trying to "dock" a panel to the bottom using absolute position which could kill your app's ability to be mobile responsive, why not structure your html to better support what you're trying to accomplish. You'll end up with simpler css that way too.
For example, you seem to be attempting to accomplish this:
.darkgray { background: #999;}
.parent-panel {width: 600px; margin: auto; }
.left-panel {float: left; width: 200px; height: 200px; margin: 10px;}
.right-panel {float: left; width: calc(100% - 220px);}
.right-child {float: left; width: calc(33.33% - 20px); height: 90px; margin: 10px;}
<div class="parent-panel">
<div class="left-panel darkgray"></div>
<div class="right-panel">
<div class="right-child darkgray"></div>
<div class="right-child darkgray"></div>
<div class="right-child darkgray"></div>
<div class="right-child darkgray"></div>
<div class="right-child darkgray"></div>
<div class="right-child darkgray"></div>
<div>
</div>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script data-require="jquery" data-semver="2.2.0" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="script.js"></script>
<style>
</style>
</head>
<body>
<div class="row container-home">
<div class="row column newclass">
<div class="medium-6 column bottomdiv" style="">
<img src="http://cdn.ratedrnb.com/2016/06/mario2.png" class="img1">
<div class="medium-4 column first-title-music">
<h1 class="artist-title" style="">MARIO</h1>
<h1 class="song-title">I NEED MORE</h1>
</div>
<div class="large-12 column big-play">
<img src="http://cdn.ratedrnb.com/2016/06/big-play2.png">
</div>
</div>
<div class="medium-6 column newclass2" style="">
<img src="http://cdn.ratedrnb.com/2016/06/alicia2.png">
<div class="medium-4 column second-title-music">
<h1 class="artist-title-small">ALICIA KEYS</h1>
<h1 class="song-title-small">IN COMMON</h1>
</div>
</div>
</div>
</div>
</body>
</html>
and CSS:
/* Put your css in here */
h1 {
color: red;
}
.container-home {
max-width: 1175px;
background: #fff;
margin: 0 auto;
padding: 20px 0px 0 0px;
position: relative;
z-index: 1;
}
.first-title-music {
background: url('http://cdn.ratedrnb.com/2016/06/large-title.png');
width: 100%;
max-width: 425px;
height: 100px;
position: absolute;
bottom: 0;
/* padding: 5% 0 0 3%; */
clear: bottom;
top: 331px;
}
.artist-title {
color: #fff;
font-family: poppins;
font-weight: 700;
text-transform: uppercase;
font-size: 36px;
line-height: 22px;
}
.song-title {
color: #fff;
font-family: poppins;
font-weight: 300;
text-transform: uppercase;
font-size: 24px;
}
.big-play {
position: absolute;
top: 150px;
left: 170px;
}
.second-title-music {
background: url('http://cdn.ratedrnb.com/2016/06/small-title.png');
width: 100%;
max-width: 190px;
height: 70px;
position: absolute;
bottom: 0;
padding: 0;
position: absolute;
bottom: 0;
/* padding: 5% 0 0 3%; */
clear: bottom;
top: 135px;
}
.artist-title-small {
color: #fff;
font-family: poppins;
font-weight: 700;
text-transform: uppercase;
font-size: 18px;
line-height: 20px;
}
.song-title-small {
color: #fff;
font-family: poppins;
font-weight: 300;
text-transform: uppercase;
font-size: 14px;
}
.big-play {
position: absolute;
top: 150px;
left: 170px;
}
.newclass {
position: relative;
padding: 15px 0 0 2%;
width: 100%;
}
.bottomdiv {
margin: 0px;
padding: 0;
float: left;
width: 100%;
max-width: 425px;
}
.artist-title,
.song-title {
margin-left: 60px !important;
}
.newclass2 {
width: 100%;
max-width: 190px;
max-height: 190px;
margin: 0px;
padding: 0px;
float: left;
padding-left: 20px;
}
.artist-title-small,
.song-title-small {
margin-left: 20px !important;
}
.img1 {
height: 425px;
width: 425px;
}
and the link https://plnkr.co/edit/52Ga8dT6wpTRklGDtvMX?p=preview for ref