I want to change bootstrap layout elements in different positions when in mobile resolutions like (max-width: 768px) and smaller.
This photo shows what i need to do exactly:
EXAMPLE
How and what i need to change to achieve that positions?
My code: jsfiddle
HTML
<!-- FOOTER-->
<section id="footer">
<div class="container-fluid">
<div class="row">
<div class="col-md-2 left-col">
<p><a class="contacts" href="#">CONTACTS</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>STUART LAWSON</h2>
<p>20 7409 8920</p>
<p>07870 555 930</p>
<p><a class="email" href="#">slawson#savills.com</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>JOSH LAMB</h2>
<p>020 7409 8891</p>
<p>07976 988 486</p>
<p><a class="email" href="#">jlamb#savills.com</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>SAM BOREHAM</h2>
<p>020 7710 7963</p>
<p>07917 635 465</p>
<p><a class="email" href="#">samb#gmreal.com</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>DAN ROBERTS</h2>
<p>020 7710 7963</p>
<p>07801 143 909</p>
<p><a class="email" href="#">danr#gmreal.com</a></p>
</div>
<div class="col-md-2 right-col">
<h2><a class="info" href="#">info#theriverbuilding.com</a></h2>
</div>
</div>
</div>
</section> <!-- END END FOOTER -->
CSS
/*** FOOTER ***/
.col-md-2 {
width: 16.66666666666667%;
float: left;
bottom: -67px;
}
.contacts {
position: absolute;
top: 110px;
left: 118px;
}
.col-md-2.contact-person {
color: #4cae4c;
}
#footer {
padding: 0 10px;
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
.left-col {
padding: 110px;
margin-left: -50px;
bottom: -65px;
}
.right-col {
padding: 86px;
position: absolute;
right: 76px;
bottom: -40px;
}
#footer p, #footer .email, #footer .contacts, #footer h2, #footer .info{
font-family: 'GothamBook', sans-serif;
color: #ffffff;
font-size: 1.063em; /*13pt in psd*/
opacity: 1.0;
}
#footer .info {
font-size: 1.3em; /*15pt in psd*/
position: absolute;
top: 95px;
right: -28px;
}
.row {
margin-left: -10px;
margin-right: -10px;
}
.row:before, .row:after{
content: " ";
display: table;
}
.row:after{
clear: both;
}
/***MEDIA QUERIES***/
#media(max-width: 768px){
.container-fluid {
width: 550px;
}
#header .logo img{
margin: 15px 0 20px;
height: 120px;
}
h1{
font-family: 'GothamMedium', sans-serif;
position: absolute;
text-align: center;
font-size: 1.55em; /*19pt in psd*/
margin: 100px 215px;
}
#footer .contacts {
left: 25px;
top: 95px;
}
.col-md-2.contact-person {
left: -110px;
top: 65px;
margin-left: 14px;
}
#footer{
text-align: center;
}
.info{
padding-top: 50px;
font-size: 9px;
text-align: center;
}
.left-col {
text-align: center;
margin-left: 0;
margin-right: 0;
padding: 100px;
font-size: 12px;
}
}
Use 2 different rows instead of 1 to stack the elements.
<section id="footer">
<div class="container-fluid">
<div class="row">
<div class="col-md-2 left-col">
<p><a class="contacts" href="#">CONTACTS</a></p>
</div>
</div>
<div class="row">
<div class="col-md-2 contact-person">
<h2>STUART LAWSON</h2>
<p>20 7409 8920</p>
<p>07870 555 930</p>
<p><a class="email" href="#">slawson#savills.com</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>JOSH LAMB</h2>
<p>020 7409 8891</p>
<p>07976 988 486</p>
<p><a class="email" href="#">jlamb#savills.com</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>SAM BOREHAM</h2>
<p>020 7710 7963</p>
<p>07917 635 465</p>
<p><a class="email" href="#">samb#gmreal.com</a></p>
</div>
<div class="col-md-2 contact-person">
<h2>DAN ROBERTS</h2>
<p>020 7710 7963</p>
<p>07801 143 909</p>
<p><a class="email" href="#">danr#gmreal.com</a></p>
</div>
<div class="col-md-2 right-col">
<h2><a class="info" href="#">info#theriverbuilding.com</a></h2>
</div>
</div>
</div>
</section> <!-- END END FOOTER -->
Related
https://codepen.io/sahandz/pen/BrYGKa
I'm making a website where I want a sidebar, header and search bar to be fixed while the results of the search are scrollable. I'm using React, but the rendered HTML looks like this:
.topdiv {
max-height: 100px;
min-height: 100px;
background-color: #DCDCDC;
margin-top: 0px;
margin-right: 0px;
margin-left: 0px;
position: sticky;
top: 0px;
z-index: 1;
width: 100%;
border-bottom: solid;
overflow-x: hidden;
}
.topdiv h1 {
font-family: "Comic Sans MS";
font-weight: bold;
position: absolute;
top: 5px;
text-align: center;
width: 100%;
}
.container-fluid {
padding: 0px;
width: 100%;
height: 100%;
overflow-x: hidden;
}
#media (max-width: 766px) {
.container-fluid {
height: 1200px;
}
}
.sidebar {
position: fixed;
width: 300px;
top: 100px;
height: 100%;
border-right: solid;
padding: 0px;
}
.noofpeople {
position: relative;
padding-top: 20px;
padding-right: 0px;
padding-bottom: 20px;
padding-left: 50px;
right: 0px;
width: 100%;
}
.noofpeople-wrapper input {
width: 55px;
}
.dinneroverview {
width: 100%;
padding: 0px;
margin: 0px;
}
.dish-overview-header {
border-bottom: solid;
border-top: solid;
height: 25px;
padding-left: 25px;
padding-right: 30px;
margin: 0px;
background-color: #d4d5d8;
}
.dish-name {
float: left;
}
.cost {
float: right;
}
.dinneroverview-price {
color: red;
padding-top: 50px;
padding-bottom: 0px;
padding-right: 30px;
}
.dinneroverview-pricetag {
float: right;
}
.confirm {
padding-left: 10px;
text-align: center;
padding-top: 40px;
}
#media (max-width: 766px) {
.sidebar {
width: 100%;
height: 40%;
position: static;
display: none;
background-color: #e5e6e8;
padding-bottom: 20px;
}
.confirm {
padding-top: 40px;
}
}
#media (min-width: 767px) {
.sidebar {
display: block !important;
border-right: solid;
height: 100% !important;
}
#hamburger {
display: none;
}
.hamburgerdiv {
display: none;
}
.menuitem {
width: 270px;
left: 20px;
}
}
#media (max-width: 360px) {
.confirm button {
width: 30px;
}
}
.dishsearch .keyword {
padding-right: 0px;
}
.dishsearch .select {
padding: 0px;
}
.dishsearch .search {
padding: 0px;
}
.searchbar {
border-style: solid;
border-color: black;
}
.main-bar {
position: relative;
left: 300px;
right: 0px;
}
.dishsearch {
padding-left: 10px;
padding-bottom: 20px;
border-bottom: solid;
position: sticky;
top: 100px;
z-index: 1;
background-color: white;
}
.dishsearch-dish {
text-align: center;
display: inline-block;
padding: 10px;
margin-top: 20px;
}
.dishreel {
top: 196px;
padding-top: 40px;
text-align: center;
}
.imgframe {
width: 146px;
height: auto;
margin: 0 auto;
border: solid;
background-color: #DCDCDC;
}
.dishsearch-img {
width: 140px;
height: 140px;
}
#media (min-width: 768px) {
.main-bar {
width: calc(100% - 297px);
}
}
<div id="root">
<div class="App">
<header class="App-header">
<div class="topdiv">
<h1 class="App-title">Dinner Planner</h1>
</div>
</header>
<div class="SelectDish">
<div class="Sidebar" id="sidebar">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 sidebar collapse">
<div>
<div class="noofpeople">
<div class="row noofpeople-wrapper">
<label>People <input type="number" min="0" id="numberOfGuests" class="form-control"></label></div>
</div>
<div id="dinneroverview" class="dinneroverview">
<div class="dish-overview-header"><span class="dish-name">Dish name</span><span class="cost">Cost</span></div>
<div id="sidebar-dishes"></div>
<div class="dinneroverview-price">
<span id="sidebar-total-price" class="dinneroverview-pricetag">SEK 0.00</span>
</div>
<div class="confirm"><button id="confirm" type="button" class="btn btn-default">Confirm Dinner</button></div>
</div>
</div>
</div>
</div>
<div class="Dishes" id="dishSearcher">
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 main-bar">
<div class="row dishsearch">
<div class="col-xs-12">
<h4>Find a dish</h4>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-4 keyword">
<input type="text" id="searchbar" class="form-control" value=""></div>
<div id="dishsearcher-select" class="col-lg-3 col-md-3 col-sm-3 col-xs-4 select">
<select id="select" class="form-control">
</select>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-4 search">
<button id="search-button" type="button" class="btn btn-default">search</button>
</div>
</div>
<div class="dishreel" id="dishreel">
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/cabbage-salad-with-peanuts-723984.jpg" class="dishsearch-img" alt="img">
<p>Cabbage Salad with Peanuts</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/Garlicky-Pasta-with-Swiss-Chard-and-Beans-482788.jpg" class="dishsearch-img" alt="img">
<p>Garlicky Pasta with Swiss Chard and Beans</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/Slow-Cooker-Vegetarian-Chili-with-Butternut-Squash-482574.jpg" class="dishsearch-img" alt="img">
<p>Slow Cooker Vegetarian Chili with Butternut Squash</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/Beef-Liver-with-Fig--Bacon-and-Caramelized-Onion-Compote-[or-the-ultimate-beef-liver-]-551452.png" class="dishsearch-img" alt="img">
<p>Beef Liver with Fig, Bacon and Caramelized Onion Compote [or the ultimate beef liver ]</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/steak-potato-kebabs-with-creamy-cilantro-sauce-for-two-695646.jpg" class="dishsearch-img" alt="img">
<p>Steak & Potato Kebabs with Creamy Cilantro Sauce for Two</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/Roasted-vegetable---feta-tostada-222482.jpg" class="dishsearch-img" alt="img">
<p>Roasted vegetable & feta tostada</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/blackened-salmon-tacos-with-cilantro-yogurt-sauce-551484.jpg" class="dishsearch-img" alt="img">
<p>blackened salmon tacos with cilantro yogurt sauce</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/Three-Bean-Greek-Kale-Salad-609091.jpg" class="dishsearch-img" alt="img">
<p>Three Bean Greek Kale Salad</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/Cedar-Planked-Salmon-with-Fresh-Sorrel-Sauce-610524.jpg" class="dishsearch-img" alt="img">
<p>Cedar-Planked Salmon with Fresh Sorrel Sauce</p>
</div>
</div>
<div class="dishsearch-dish handhover">
<div id="dish.id" class="imgframe">
<img src="https://spoonacular.com/recipeImages/liver-and-onions-w_-gravy-2-146557.jpg" class="dishsearch-img" alt="img">
<p>Liver and Onions W/ Gravy</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
To my great frustration, the header, with the text "Dinner Planner" doesn't stick to the top. I've tried a bunch of combinations of fixed and sticky elements, but nothing does the trick. How can I make the header stick to its position when scrolling just like the sidebar and the search bar?
.header {
position: sticky;
top: 0;
background: #fff;
}
Look at this picture:
This is what you want, right?
Basically you have four divs. Three are fixed (top-header, search bar and side bar), and the last one (search-results) is relative. Start with this in mind, then create the HTML structure, then the CSS. Please take a look at the next simple example:
html, body{
margin: 0;
padding: 0;
}
#top-header{
background-color: #000;
color: #fff;
position: fixed;
height: 100px;
left: 0;
right: 0;
top: 0;
z-index: 100;
}
#side-menu{
background-color: #ff0000;
color: #fff;
position: fixed;
left: 0;
width: 200px;
top: 100px;
bottom: 0;
z-index: 100;
}
#search-bar{
background-color: #00ff00;
color: #000;
position: fixed;
left: 200px;
right: 0;
top: 100px;
height: 50px;
z-index: 100;
}
#search-results{
position: relative;
z-index: 50;
height: 1500px; /*remove me*/
background-color: #ccc;
margin-left: 200px;
margin-top:150px;
}
<div id="root">
<div class="App">
<header id='top-header'>
top header
</header>
<div id='side-menu'>
side bar
</div>
<div id='search-bar'>
search bar
</div>
<div id='search-results'>
search results
</div
</div>
</div>
You will scroll only inside search results, as you want. Using this simple example you can update your CSS code.
Use position: fixed; to make them stay fixed, and the relative container push it down using margin-top and margin-left. Make sure that the z-index value on the fixed elements is greater than the one in relative element.
I tried to fix this problem multiple times but it still occurs, I just can't find the right fix.
I cannot create gutter around columns in Bootstrap 3. Here's my Fiddle: jsfiddle.net/creuxttL
My exact problem: When I create these three columns, I expect some gutter to be between them, so they don't look like one big brick. I don't get any gutter by default, so I tried to do it manually - with css class .col . I still don't get any margin/padding around the boxes. What should I do?
You're fiddle does not have bootstrap 3 included. http://jsfiddle.net/va94exo2/ is a slight modification.
Have wrapped all of your col-md-4 content with an inner div and changed the ID="row" to class and removed your extra .col class, have also then styled the inner div.
.inner-content{
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: white;
text-align: center;
background-color: #00b9ff;
border: 1px solid black;
}
.overlay-pic {
max-height: 200px;
display: block;
margin: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #44cbff;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.overlay p {
font-family: 'Raleway';
font-style: italic;
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.col {
/*gutter*/
padding-right: 7px;
padding-left: 7px;
}
.col:not(:first-child, :last-child) {
padding-right: 7px;
padding-left: 7px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row" style="margin-top: 10px;">
<div class="col-md-4">
<div class="inner-content">
<h1>Festival 2001</h1>
<img src="event.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Our event.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="inner-content">
<h1>Who are we?</h1>
<img src="question.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Read more about us</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="inner-content">
<h1>where, when?</h1>
<img src="calendar.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Look at our calendar.</p>
</div>
</div>
</div>
</div>
</div>
Not positive this is exactly what you're looking for but if you just want space between the rows you can add a "margin-top" attribute to your css in the ".col-md-4" class.
Hope this helps.
.col-md-4 {
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: white;
text-align: center;
background-color: #00b9ff;
border: 1px solid black;
margin-top:10px;
}
.overlay-pic {
max-height: 200px;
display: block;
margin: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #44cbff;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.overlay p {
font-family: 'Raleway';
font-style: italic;
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.col {
/*gutter*/
padding-right: 7px;
padding-left: 7px;
}
.col:not(:first-child, :last-child) {
padding-right: 7px;
padding-left: 7px;
}
<div class="container">
<div id="row" style="margin-top: 10px;">
<div class="col-md-4 col">
<h1>Festival 2001</h1>
<img src="event.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Our event.</p>
</div>
</div>
<div class="col-md-4 col">
<h1>Who are we?</h1>
<img src="question.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Read more about us</p>
</div>
</div>
<div class="col-md-4 col">
<h1>where, when?</h1>
<img src="calendar.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Look at our calendar.</p>
</div>
</div>
</div>
</div>
Bootstrap is not added. I modified your code. And I hope you are expecting this.
.col {
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: white;
text-align: center;
background-color: white;
}
.overlay-pic {
max-height: 200px;
display: block;
margin: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #44cbff;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.overlay p {
font-family: 'Raleway';
font-style: italic;
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.col h1{
margin-top:0px;
}
<div class="container">
<div id="row">
<div class="col-md-4 col">
<div style="margin:5px; background:#00b9ff;border: 1px solid black;">
<h1>Festival 2001</h1>
<img src="event.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Our event.</p>
</div>
</div>
</div>
<div class="col-md-4 col">
<div style="margin:5px; background:#00b9ff;border: 1px solid black;">
<h1>Who are we?</h1>
<img src="question.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Read more about us</p>
</div></div>
</div>
<div class="col-md-4 col">
<div style="margin:5px; background:#00b9ff;border: 1px solid black;">
<h1>where, when?</h1>
<img src="calendar.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Look at our calendar.</p>
</div>
</div></div>
</div>
</div>
All are working however in 800 px, 1100px, 1400px , the navigation bar is not showing up as I think that the 400 px media query have overlapped others queries. I need help on how to make navigation bar show up ...
CSS Code:
#media screen and (min-width: 400px)
{
header {
padding: 1%;
}
header h1 {
position: relative;
left: 0.5%;
bottom: 10%;
}
header div{
display: none;
}
nav.sitenavigation {
}
nav.sitenavigation ul {
border: 3px solid #34180f;
display: none;
background-color: #B8944D;
position: absolute;
right: 5%;
top: 80%;
z-index: 1;
}
nav.sitenavigation ul li {
display: inline-block;
}
.navigation-menu-button {
float: right;
}
article.container{
padding:0%;
}
figure {
display: none;
}
aside {
display: none;
}
aside p {
display: none;
}
}
#media screen and (min-width:800px),print
{
header h1 {
position: absolute;
top: 8%;
left: 28.0%;
}
header div{
display: inline;
position: relative;
right: 39%;
}
nav.sitenavigation {
position: relative;
bottom: 2%;
padding: 0.3%;
}
.navigation-menu-button {
display:none;
}
ul li {
display:inline;
margin-right: 2%;
position: relative;
left: 36.5%;
}
article {
width: 62.6%;
padding: 2%;
}
article p {
padding-right: 0%;
}
#contentstart {
padding-right: 0%;
}
figure {
display: none;
}
aside {
display: inline;
}
aside p {
position: relative;
left: 3.5%;
margin: 2% 0 0 5%;
padding-right: 5%;
}
}
#media screen and (min-width:1100px){
header h1 {
position: absolute;
top: 5.5%;
left: 37%;
}
header div {
display: inline;
position: relative;
right: 39%;
}
nav.sitenavigation {
position: relative;
bottom: 2%;
padding: 0.3%;
}
.navigation-menu-button {
display:none;
}
ul li {
display:inline;
margin-right: 2%;
position: relative;
left: 43.5%;
}
article {
width: 62.6%;
padding: 2%;
}
article p {
padding-right: 50%;
}
#contentstart {
padding-right: 50%;
}
figure {
position: absolute;
left: 50%;
bottom: 28.7%;
margin: 2% 2% 0 0.3%;
}
aside {
display: inline;
width: 30%;
}
aside p {
position: relative;
left: 3%;
padding: 2% 6% 0 6%;
margin: 1% 0 0 0%;
}
}
#media screen and (min-width:1400px) {
body {
width: 1400px;
}
header h1 {
position: absolute;
top: 7%;
left: 42%;
}
header div {
display: inline;
position: relative;
right: 39%;
}
nav.sitenavigation {
position: relative;
bottom: 2%;
padding: 0.3%;
}
ul li {
display:inline;
margin-right: 2%;
position: relative;
left: 47.1%;
}
article {
width: 62.6%;
padding: 2%;
}
article p {
padding-right: 54%;
padding-bottom: 2%;
}
figure {
position: absolute;
left: 45%;
bottom: 1%;
top: 0.2%;
margin: 2%;
}
aside {
display: inline;
width: 30%;
}
aside p {
position: relative;
left: 3%;
padding: 2% 6% 0 6%;
padding-right: 7%;
margin: 1% 0 0 0%;
}
}
HTML Code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Revisions Bookstore & Cafe</title>
<!--
Revisions Bookstore and Cafe main web page
Filename: index.html
Author: Wong Wan Zhen Sofia
Date: 5 January 2017
HTML5 and CSS3 Illustrated Unit I, Visual Workshop
-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="modernizr.custom.40753.js"></script>
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="icon" sizes="192x192" href="images/android.png">
</head>
<body>
<div class="container">
<p class="skipnavigation">Skip navigation </p>
<header>
<h1>Revisions Bookstore & Cafe</h1>
<div>
<img src="images/logo.gif" width="120" height="100" alt="">
</div>
</header>
<nav class="sitenavigation">
<div class="navigation-menu-button">
<img src="images/menu.png" width = "60" height="60" alt="Show Navigation">
</div>
<ul>
<li>Home</li>
<li>Events</li>
<li>New Releases</li>
</ul>
</nav>
<article>
<div class="container">
<h2 id="contentstart">10th Anniversary Sale!</h2>
<figure><img src="images/browsing.jpg" width="500" height = "378" alt="picture of person browsing"></figure>
<p>10% off our top 10 best sellers</p>
<p>Buy any two books, get a third at 50% off</p>
<p>In-store giveaways every day this month</p>
<p>Through November 30</p>
</div>
</article>
<aside>
<p>Custom brewed coffee and hand-selected books.</p>
<p>Special orders are our specialty.</p>
</aside>
<footer>
<p>412 N. 25th St.</p>
<p>Richmond, VA 23223</p>
<p>(804) 555-2565</p>
</footer>
</div>
<script src ="script.js"></script>
</body>
</html>
Try to use bootstrap for responsive and mobile-first. Quickly demo for you.
HTML:
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Logo -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mainNavBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
COLLAPSE NAVBAR
</div>
<!-- Menu Items -->
<div class="collapse navbar-collapse" id="mainNavBar">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<!--<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">-->
<!--<div class="input-group" id="wm_btn_cholai">-->
<!--<i class="glyphicon glyphicon-repeat"></i> Cho lại-->
<!--</div>-->
<!--</div>-->
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="input-group" id="wm_btn_boqua">
<i class="glyphicon glyphicon-refresh"></i> Bỏ qua
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="input-group" id="wm_btn_new">
<i class="glyphicon glyphicon-floppy-saved"></i> Thêm Mới
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="input-group" id="wm_btn_sua">
<i class="glyphicon glyphicon-edit"></i> Sửa
</div>
</div>
<!--<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">-->
<!--<div class="input-group" id="wm_btn_luu">-->
<!--<i class="glyphicon glyphicon-floppy-save"></i> Lưu-->
<!--</div>-->
<!--</div>-->
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="input-group" id="wm_btn_them">
<i class="glyphicon glyphicon-plus"></i> Thêm
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="input-group" id="wm_btn_xoa">
<i class="glyphicon glyphicon-remove"></i> Xóa
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="input-group" id="wm_btn_huy">
<i class="glyphicon glyphicon-trash"></i> Hủy
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<div class="input-group" id="wm_btn_in">
<i class="glyphicon glyphicon-print"></i> In
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<div class="input-group" id="wm_btn_inkemchidinh">
<a href="#" class="input-group-addon button-load"><i class="glyphicon glyphicon-list-alt"></i> In kèm chỉ
định</a>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<div class="input-group" id="wm_btn_ketthuc">
<i class="glyphicon glyphicon-off"></i> Kết thúc
</div>
</div>
CSS:
.row {
margin-bottom: 5px;
margin-top: 10px;
}
#wm_header {
width: 100%;
min-height: 22px;
margin: 0;
/*background-image: linear-gradient(to bottom, #428bca 0px, #2d6ca2 100%);*/
/*background-repeat: repeat-x;*/
background-color: #428bca;
border-color: #2b669a;
color: #ffffff;
font-weight: bold;
padding: 5px;
font-size: 15px;
}
.input-label {
/*background-color: #428bca;*/
background-color: #fff;
border: 0;
font-weight: 700;
min-width: 110px;
text-align: left;
}
.input-group {
margin-bottom: 5px;
margin-top: 10px;
}
.input-group-addon:first-child {
text-decoration: none;
font-weight: bold
}
.button-load {
cursor: default;
background-color: #428bca;
color: #fff;
font-weight: bold;
}
I have list items with text and they have a plus icon in a circle after them done with the pseudo-element :before. How could I center all the plus icons?
.advantages .item-list-section .item {
position: relative;
margin-bottom: 15px;
}
.advantages .item-list-section .item .inner {
position: relative;
display: inline-block;
}
.advantages .item-list-section .item .inner:after {
position: absolute;
font-family: 'FontAwesome';
content: "\f067";
color: #ef6611;
width: 14px;
height: 14px;
border: 1px solid;
border-radius: 30px;
top: 5px;
right: -30px;
font-size: 8px;
line-height: 14px;
text-align: center;
display:block;
}
.advantages .item-list-section .item .inner.bottom-icon:after {
top: 100%;
margin-top: -18px;
}
.advantages .item-list-section .item.active .inner:after {
background: #f13a01;
color: #ffffff;
content: "\f068";
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>
<section class="advantages primary">
<div class="container">
<div class="row">
<div class="col-sm-3 col-sm-offset-1 item-list-section">
<div class="item-list">
<div class="item">
<div class="inner">
<p>Продолжительный<br/>
срок службы</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Компактные<br/>
размеры</p>
</div>
</div>
<div class="item active">
<div class="inner">
<p>Насос с сухим ротором</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Котел способен стабильно<br/>работать даже при самом<br/>низком давлении</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Встроенная защита от<br/>
перепадов напряжения</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Надежная система<br/>
безопасности</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Наличие аварийных<br/>
режимов работы</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
Update Css
.advantages .item-list-section .item .inner:after {
position: absolute;
font-family: 'FontAwesome';
content: "\f067";
color: #ef6611;
width: 14px;
height: 14px;
border: 1px solid;
border-radius: 30px;
top: 5px;
right: -30px;
font-size: 8px;
line-height: 16px;
text-align: center;
display:block;
}
Live Demo Here
I'm trying to create a footer class however it seems to be at the bottom of my .body-wrap class as opposed to the actual page.
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
border: 1px black solid;
position: relative;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
}
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
I'm also using a bootstrap sidebar template. Found here: http://startbootstrap.com/template-overviews/simple-sidebar/
Help would be appreciated.
Please try to add this code:
.footer-wrap {
border: 1px black solid;
position: fixed;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
width: 100%;
bottom: 0;
left: 0;
}
Use position:fixed with bottom:0 it will remain stable at bottom of page
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
border: 1px black solid;
position: fixed;
bottom:0;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
}
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
You would need position: fixed and bottom: 0 on your footer-wrap. Check the update below!
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
border: 1px black solid;
position: fixed;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
bottom: 0;
left: 0;
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
width:100%;
border: 1px black solid;
position: absolute;
bottom:0px;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
}
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
Add width and height to your .body-wrap and width to footer too. Changes footer position as in below codes.
.body-wrap {
width:200px;
height: 200px;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
background:#111;
color:#fff;
}
.footer-wrap {
border: 1px black solid;
z-index: 9;
height: 3em;
text-align: center;
background:#f22;
bottom:0;
position:absolute;
width:100%;
}