I'm trying to each this effect:
What I've developed till now:
http://wedevelop.net63.net/j/
I can't manage to use bootstrap to stick the "RED" div to the footer.
Any tips?
Here is the code:
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-3"></div>
<div class="col-md-3">
<div class="table-content-container row">
<div class="main-content">
<h1>Take 10 off any purchase of 50 or more at Gamestop</h1>
<div class="row">
<div class="col-md-6"><img src="images/GameStop.png"/></div>
<div class="col-md-6"><span>Code:</span><span>play10</span></div>
</div>
<p>1. Enter the email you use on Jifity 2. Share this coupon on Facebook 3. Your coupon is activated 4. Apply your savings to any gift</p>
<input class="center-block email-field form-control" type="text" value="Enter Your E-mail" />
<div class="row">
<div class="btn share-btn"></div>
</div>
</div>
</div>
</div>
<div class="col-md-3"></div>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-3"></div>
<div class="col-md-3">
<div class="table-content-container row">
<div class="mobile-ad-content">
<h2>Ready to download your Coupon?</h2>
<p class="download-phrase">Download right now</p>
<div class="row stores-logos">
<div class="col-xs-6"><div class="btn btn-success right">Apple</div></div>
<div class="col-xs-6"><div class="btn btn-success">Google</div></div>
</div>
</div>
</div>
</div>
<div class="col-md-3"></div>
</div>
LESS Code:
#content {
text-align: center;
height: 90%;
.table-content-container {
display: table;
}
.main-content {
background: url('../images/content_whitebg.png') no-repeat;
background-size: cover;
display: table-cell;
h1 {
margin-left: 20%;
margin-right: 20%;
padding-top: 2em;
font-size: 2em;
margin-bottom: 1em;
}
.gamestop-logo {
background: url('../images/GameStop.png') no-repeat;
}
p{
padding-bottom: 1.2em;
padding-top: 1.2em;
font-size: 0.7em;
margin-top: 2em;
}
.email-field {
margin-bottom: 1.5em;
width: 92%;
}
.share-btn {
background: url('../images/share.png') no-repeat;
width: 100px;
height: 38px;
margin-bottom: 2em;
}
}
.mobile-ad-content {
background: url('../images/content_redbg.png') no-repeat;
background-size: cover;
display: table-cell;
color:white;
text-align: center;
h2 {
padding-top: 2em;
margin: 1em;
}
p{
font-weight: bold;
}
.stores-logos {
padding-bottom: 2em;
}
}
}
Related
I have 2 columns of numbers that I want them to appear side by side. It works when I try using float: left but I want them to appear in the center. Without the float they appear one row then next row downwards.
body {
color: #fff;
text-align: center;
}
#roll, #roll2, #roll3, #roll4 {
width: 40px;
height: 360px;
background: #0077ee;
margin: 0 auto;
}
.roll-h {
width: 40px;
height: 120px;
margin: 0 auto;
overflow: hidden;
}
.shadow {
height: 40px;
margin: 0 auto;
transform: translateY(40px);
}
.black,
.his-h {
width: 40px;
height: 40px;
font-size: 20px;
line-height: 40px;
font-weight: 700;
text-align: center;
float: left;
}
.black {
background: black;
}
.floatleft {
float: left;
}
<div class="floatleft">
<div class="shadow"></div>
<div class="roll-h">
<div id="roll3">
<div class="black">9</div>
<div class="black">0</div>
<div class="black">1</div>
<div class="black">2</div>
<div class="black">3</div>
<div class="black">4</div>
<div class="black">5</div>
<div class="black">6</div>
<div class="black">7</div>
<div class="black">8</div>
<div class="black">9</div>
<div class="black">0</div>
</div>
</div>
</div>
<div class="floatleft">
<div class="shadow"></div>
<div class="roll-h">
<div id="roll4">
<div class="black">9</div>
<div class="black">0</div>
<div class="black">1</div>
<div class="black">2</div>
<div class="black">3</div>
<div class="black">4</div>
<div class="black">5</div>
<div class="black">6</div>
<div class="black">7</div>
<div class="black">8</div>
<div class="black">9</div>
<div class="black">0</div>
</div>
</div>
</div>
you have to add a parent (container) div around all your html with following styles:
<div style="margin:0 auto; display:inline-block">
see it here:
body {
color: #fff;
text-align: center;
}
#roll, #roll2, #roll3, #roll4 {
width: 40px;
height: 360px;
background: #0077ee;
margin: 0 auto;
}
.roll-h {
width: 40px;
height: 120px;
margin: 0 auto;
overflow: hidden;
}
.shadow {
height: 40px;
margin: 0 auto;
transform: translateY(40px);
}
.black,
.his-h {
width: 40px;
height: 40px;
font-size: 20px;
line-height: 40px;
font-weight: 700;
text-align: center;
float: left;
}
.black {
background: black;
}
.floatleft {
float: left;
}
.container {
display:inline-block;
margin:0 auto;
}
<div class="container">
<div class="floatleft">
<div class="shadow"></div>
<div class="roll-h">
<div id="roll3">
<div class="black">9</div>
<div class="black">0</div>
<div class="black">1</div>
<div class="black">2</div>
<div class="black">3</div>
<div class="black">4</div>
<div class="black">5</div>
<div class="black">6</div>
<div class="black">7</div>
<div class="black">8</div>
<div class="black">9</div>
<div class="black">0</div>
</div>
</div>
</div>
<div class="floatleft">
<div class="shadow"></div>
<div class="roll-h">
<div id="roll4">
<div class="black">9</div>
<div class="black">0</div>
<div class="black">1</div>
<div class="black">2</div>
<div class="black">3</div>
<div class="black">4</div>
<div class="black">5</div>
<div class="black">6</div>
<div class="black">7</div>
<div class="black">8</div>
<div class="black">9</div>
<div class="black">0</div>
</div>
</div>
</div>
</div>
you can center and keep items side by side using inline-block like this
.floatleft {
display: inline-block;
}
I'm trying to center some divs within another div for a webapp I'm making. I'm using the bootstrap 3 framework, but cannot get the divs to center vertically.
HTML:
<body>
<div id="container-main" class="container" align="center" style="min-height:100%">
<div class="row">
<div id="player-page-top" class="container">
<div id="player-page-summoner" class="container-fluid">
<h1>
<img src="http://i.imgur.com/eDeFxAe.png"> Name
</h1>
<div id="player-page-ranks">
<ul class="ul-ranks">
<li class="ranks">S3 Silver</li>
<li class="ranks">S4 Gold</li>
<li class="ranks">S5 Diamond</li>
<li class="ranks">S6 Master</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row">
<div id="player-page-left" class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
Leagues
</div>
<div class="panel-body">
Panel content
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
Champion Stats
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div>
<div id="player-page-right" class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
Recent Matches
</div>
<div class="panel-body">
<div class="player-match container-fluid" align="left">
<div class="championdetails col-md-4">
<div class="champimage">
<img src="http://i.imgur.com/CWlqNvT.png">
</div>
<div class="summonerspells">
<div class="player-match-spell">
<img src="http://i.imgur.com/rTpkXlb.png">
</div>
<div class="player-match-spell">
<img src="http://i.imgur.com/nXFjz2w.png">
</div>
</div>
<div class="keymastery">
<img src="http://i.imgur.com/b5lszzu.png">
</div>
</div>
<div class="score col-md-2">
<div class="kda .text-center">
10 / 7 / 12
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
CSS:
h1,
h2,
h3,
h4,
h5 {
font-family: "source sans pro", "proxima-nova", sans-serif;
color: #4b4b4b;
}
#media (min-width: 1200px) {
.container {
max-width: 960px;
}
}
.holder {
height: 100%;
width: 100%;
display: block;
}
.match-middle {
display: inline-block;
vertical-align: middle;
float: none;
}
.player-match {
border: solid 1px #ddd;
padding-top: 7px;
padding-bottom: 7px;
}
.championdetails,
.score {
padding-left: 0px;
padding-right: 0px;
text-align: center;
height: 100%;
}
.summonerspells,
.champimage,
.keymastery {
display: inline-block;
vertical-align: middle;
text-align: center;
}
.player-match-spell {
display: block;
margin-bottom: 2px;
}
.summonerspells img,
.keymastery img {
height: 30px;
width: 30px
}
.champimage img {
height: 60px;
width: 60px;
border-radius: 40px;
}
#player-page-left,
#player-page-right {
/*border: 1px solid grey; */
}
#gameplay-baseball-field {
padding-right: 10px;
padding-left: 10px;
}
#player-page-top {
margin: 20px 0 20px 0;
}
#player-page-top img {
width: 60px;
height: 60px;
border-radius: 8px;
}
.ul-ranks>.ranks {
display: inline-block;
color: #4b4b4b;
background: #e0e3e3;
padding: 0 4px 0 4px;
margin: 3px 2px 0px 2px;
border-radius: 4px;
}
.ul-ranks {
-webkit-padding-start: 0px;
}
JSFiddle
I'm trying to center the "score" and "championdetails" divs vertically inside the "player-match" div. I can't get it to center without it skewing the other divs.
I've created a login page, everything seems normal when the page is maximized but when I'm on xs and sm sized screen my footer and content area goes inside of each other and there's a gap at the bottom how may I solve this problem?
https://jsfiddle.net/tLhy3av1/
Full Code:
.navbar-default.navbar-fixed-top {
background-color: #FFFFFF;
border-color: #E7E7E7;
font-family: gesta;
font-size: 20px;
padding-bottom: 10px;
}
.container.top {
margin-top: 50px;
}
.navbar-header.topHeader {
margin-left: 50%;
}
.mid {
width: 100%;
height: 497px;
background-color: #F1F2F4;
margin-top: 110px
}
.myFooter {
margin-bottom: 0px;
width: 100%;
height: 50px;
background-color: #2F2F2F;
border-top: 2px inset #F1F2F4;
}
.formSignIn {
width: 25%;
height: 100%;
margin: 60px auto 30px auto;
}
.form-signin-heading {
color: #8F95A3;
font-weight: 400;
}
.btn {
font-size: 1.1em;
background-color: #F04B14;
border: 1px solid #CE3D0D;
background-color: #f04b14;
box-shadow: 0px -1px 0px #CE3D0D inset;
border-radius: 0;
text-align: center;
}
.btn:hover {
background-color: #F04B14;
box-shadow: 0px -1px 0px #CE3D0D inset;
border: 1px solid #CE3D0D;
background-color: #F47E57;
}
.forget {
margin-top: 10px;
float: right;
}
a {
font-weight: 400;
color: #2693CE;
}
a:hover {
font-weight: 400;
color: #2693CE;
}
.checkbox {
display: inline-block;
}
.formSignIn p {
margin-top: 30px;
text-align: center;
}
#name {
text-align: center;
color: #8F95A3;
font-family: arial;
font-weight: 400px;
font-size: 15px;
}
#bottomLinks a {
text-decoration: none;
color: #8F95A3;
font-family: arial;
font-weight: 400px;
}
#bottomLinks a:hover,
bottomLinks a:focus,
bottomLinks a:active {
text-decoration: underline;
color: #535865;
font-family: arial;
font-weight: 400px;
}
.break {
clear: both;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container top">
<div class="navbar-header topHeader">
<a class="navbar-brand" href="index.html">Logo</a>
</div>
</div>
</nav>
<div class="container mid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<form class="form-signin formSignIn">
<h4 class="form-signin-heading">Log in</h4>
<br>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<br>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
<br>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me">Remember me
</label>
</div>
<div class="forget">
Forgot password?
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<button class="btn btn-lg btn-primary btn-block" type="submit">Log in</button>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<p>Not a member yet? Sign Up
</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<p id="name">© Biz Yapalım <span id="bottomLinks"> Privacy Terms</span>
</div>
</div>
</form>
</div>
</div>
</div>
<div class "break">
</div>
<footer class="container myFooter">
</footer>
<!--Javascript-->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</body>
On your form set width to px or some other fixed value since percentage is from the width of a window and will always be a trouble:
.formSignIn {
width: 200px; // 25%
}
Beside that, since you are covering more resolutions set some properties through media queries where you can stay with % value.
I am fairly new to web development and I am trying to stretch the footer section horizontally on my website so, but instead it is appearing as a box. I have repeatedly tried changing the background of every div of the code but things are not working out. As a troubleshooting step I also tried this.I am using Bootstrap.
Here is my HTML:
<div role="navigation" style="background-color: blue">
<div class="container">
<footer class="container-fluid" id="contact" style="width: 100%;">
<div class="row">
<div class="col-md-12">
<h2>Contact Us</h2>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8 boxes">
<div class="contact-box">
<div class="contact-icon pull-left"><i class="fa fa-map-marker fa-fw"></i></div>
<div class="contact-details pull-left">
221 Baker Street
</div>
</div>
<div class="contact-box extra-left-padding">
<div class="contact-icon pull-left"><i class="fa fa-mobile fa-fw"></i></div>
<div class="contact-details pull-left">
fun#funny.nl<br />
000-000-000
</div>
</div>
</div>
<div class="col-md-2"></div>
</div>
<span class="copyright">© Hello!</span>
</div>
</div>
</footer>
</div>
</div>
And my CSS:
footer {
background-color: #002776;
padding-top: 80px;
padding-bottom: 80px;
text-align: center;
color: #F0F0F0;
font-weight: 300;
font-size: 14px;
}
footer h2 {
margin: 0 0 40px;
font-weight: 400;
}
footer div.boxes {
text-align: center;
}
footer div.contact-box {
display: inline-block;
margin-bottom: 40px;
width: 280px;
vertical-align: top;
}
#media screen and (max-width: 767px) {
footer div.contact-box {
width: 90%;
}
}
footer div.contact-box.extra-left-padding {
padding-left: 80px;
}
#media screen and (max-width: 767px) {
footer div.contact-box.extra-left-padding {
padding-left: 0;
}
}
footer div.contact-box div.contact-icon {
background-color: #0038a9;
padding: 6px;
margin: 0 20px 20px 0;
text-align: center;
font-size: 2em;
}
footer div.contact-box div.contact-details {
text-align: left;
line-height: 1.75em;
}
#media screen and (max-width: 767px) {
footer div.contact-box div.contact-details {
font-size: 12px;
}
}
footer span.contact-link {
display: inline-block;
padding: 0 10px 70px;
}
footer a {
color: #F0F0F0;
}
footer a:hover {
color: #00a1de;
}
footer span.copyright {
color: #999;
display: block;
text-align: center;
font-size: 14px;
}
footer span.copyright img {
max-width: 75px;
position: relative;
top: -2px;
}
HTML code must be only :
Css is good.
<footer class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>Contact Us</h2>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8 boxes">
<div class="contact-box">
<div class="contact-icon pull-left"><i class="fa fa-map-marker fa-fw"></i></div>
<div class="contact-details pull-left">
221 Baker Street
</div>
</div>
<div class="contact-box extra-left-padding">
<div class="contact-icon pull-left"><i class="fa fa-mobile fa-fw"></i></div>
<div class="contact-details pull-left">
fun#funny.nl<br />
000-000-000
</div>
</div>
</div>
<div class="col-md-2"></div>
</div>
<span class="copyright">© Hello!</span>
</div>
</div>
</footer>
I've got a lot of trouble with getting my checkboxes vertical aligned in my divs with a dynamic height.
I have some of my view:
<div class="col-md-7">
<div class="row recent-information">
<div class="product-navigation">
<div class="product-header-text">
<div class="col-md-3 product-details">
<p>Product name</p>
</div>
<div class="col-md-4 product-details">
<p>Note</p>
</div>
<div class="col-md-2 product-details">
<p>Price</p>
</div>
<div class="col-md-2 product-details">
<p>Stock</p>
</div>
</div>
</div>
#foreach (var item in Model.Products)
{
<div class="product-header">
<div class="product-header-text">
<div class="col-md-3 product-details-entity">
<h6>#item.Name</h6>
</div>
<div class="col-md-4 product-details-entity">
<h6>#item.Description</h6>
</div>
<div class="col-md-2 product-details-entity">
<h6>#item.Price DKK</h6>
</div>
<div class="col-md-1 product-details-entity">
<h6>#item.Stock</h6>
</div>
<div class="col-md-1 product-details-checkbox">
#Html.CheckBox("naem", new { #class = "products-checkbox" })
</div>
</div>
</div>
}
</div>
</div>
And the style:
.product-header {
min-height: 7%;
min-width: 100%;
margin-bottom: 3px;
border-bottom: 1px solid #e6e6e6;
overflow: hidden;
}
.product-header-text {
width: 98%;
margin-left: 10px !important;
margin-right: 10px !important;
float: left;
font-weight: 700 !important;
margin-bottom: 3px;
height: 100%;
}
.product-details {
font-weight: 500 !important;
margin-top: 13px;
font-family: 'Raleway', sans-serif;
font-size: 12px;
height: auto;
min-height: 100%;
}
.product-details-entity {
margin-top: 20px;
height: auto;
}
input[type="checkbox"] {
background: #f8f8f5;
-webkit-appearance: none;
height: 22px;
width: 22px;
margin-top: 20%;
cursor: pointer;
margin-left: 65px;
}
input[type="checkbox"]:checked {
background-image: url("../Images/checkmark2.png");
height: 22px;
width: 22px;
}
My problem is, that my divs, the product-details are dynamically based on the content from the database, and I can't get my checkboxes to follow.