I noticed that my web page has a white space/bar right after the footer and at the bottom of the page:
I tried to find the cause of this by using the inspect element in Chrome and can't find anything. I'm using Boostrap and here's my footer HTML/CSS:
<div class="container">
<hr>
</div> <!--end container-->
<div id="footer">
<footer class="container">
<div class="row">
<div class="col-md-3" id="mail"> <img src="images/mail.png" alt="e-kiri" title="Kirjuta mulle!"/>
<p>info#8delfiini.ee</p>
</div>
<div class="col-md-3" id="tel"> <img src="images/phone.png" alt="telefon" title="Helista mulle!"/>
<p>(+372) 52 99 131</p>
</div>
<div class="col-md-3" id="addr"> <img src="images/location.png" alt="asukoht" title="Asukoht"/> <a href="https://goo.gl/maps/ny3wV" title="Asukoht" target="_blank">
<p>Jansuki Shop<br />
Müürivahe 17<br />
Tallinn </p>
</a> </div>
<div class="col-md-3" id="fb"> <img src="images/fb.png" alt="Facebook" title="Facebook"/> <a href="https://www.facebook.com/8Delfiini" title="Facebook" target="_blank">
<p>8 Delfiini Facebookis</p>
</a> </div>
</div>
<!--end row-->
</footer>
</div>
<!--end footer-->
And the CSS for the whole contact page:
/*kontakt*/
#kontakt
{
background: url(../images/IMG_1340.jpg) no-repeat fixed;
width: 100%;
margin-bottom: 0;
}
h2.cont-heading
{
background: url(../images/kontakt.png) no-repeat 0 155px;
background-size: 48.5px 53px;
padding: 160px 0 5px 60px;
color: rgb(255,255,255);
text-transform: uppercase;
}
h1.invitation
{
font-family: 'latoregular', sans-serif;
color: rgb(255,255,255);
font-size: 7em;
}
#logo
{
width: 28px;
height: 40px;
margin-top: 10px;
}
#part3, #part4
{
padding: 40px 40px 40px 0;
}
#part4
{
padding: 30px;
color: rgb(255,255,255);
}
hr
{
border: 0;
height: 1px;
margin: 0;
background-image: -webkit-linear-gradient(left, rgba(255,255,255,0.4), rgba(255,255,255,0.75), rgba(255,255,255,0.4));
background-image: -moz-linear-gradient(left, rgba(255,255,255,0.4), rgba(255,255,255,0.75), rgba(255,255,255,0.4));
background-image: -ms-linear-gradient(left, rgba(255,255,255,0.4), rgba(255,255,255,0.75), rgba(255,255,255,0.4));
background-image: -o-linear-gradient(left, rgba(255,255,255,0.4), rgba(255,255,255,0.75), rgba(255,255,255,0.4));
}
/*footer styles*/
#footer
{
padding: 40px;
color: rgb(255,255,255);
text-align: center;
}
#footer a
{
color: rgb(255,255,255);
font-size: 1.3em;
}
#mail img, #tel img, #addr img, #fb img
{
height: 60px;
width: 60px;
display: block;
margin: 0 auto;
}
#mail a, #tel a, #addr a, #fb a
{
padding: 50px;
font-family: 'latoregular', sans-serif;
}
I'm new to Bootstrap. Is there maybe something special in its CSS that causes this? Thank you for your help. :)
You can fix it by setting a padding for the #footer .row:
#footer .container .row {
padding-bottom:8px;
}
Beautiful layout btw :)
This kind of things has mostly to do with not setting the body style:
body
{
margin: 0;
padding: 0;
}
It can also happen that you have set the heights of other elements wrongly.
It's a good practice to reset all the predefined styles, see http://www.cssreset.com/
And just to be sure; your background image is big enough, right?
Related
I have here an html page and I want to make 2 footers below the page. But my problem is the second footer is merged with the first footer. Can someone tell me a solution to this?
Here is the code for my footer:
#footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #787a7c;
color: white;
padding: 0px 0px 18px 0px;
}
.footerLinks a {
text-decoration: none;
color: #f2f2f2;
font-size: 10px;
font-family: Malgun Gothic;
}
.footerLinks a:hover {
text-decoration: underline;
}
.lowerFooter {
background-color: orange;
}
.footerLinks {
float: left;
position: relative;
}
<div class="contextSize">
<div id="footer">
<div class="upperFooter content">
<nav class="footerLinks">
<a href="#">개인정보처리방침
</a> |
<a href="#">이메일무단수집거부
</a> |
사이트맵 |
찾아오시는 길
</nav>
<h6 class="account">ADMIN
<h6>
</div>
<div class="lowerFooter content">
sample
</div>
</div>
</div>
when compiled, the two footers merge with each other.
They do not merge with each other. Try to apply a background to each of them so you can see it. You set a background to the surrounding element but not to the upper footer. See here:
/*CSS code snippet*/
#footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: red; /* changed */
color: white;
padding: 0px 0px 18px 0px;
}
.footerLinks a {
text-decoration: none;
color: #f2f2f2;
font-size: 10px;
font-family: Malgun Gothic;
}
.footerLinks a:hover {
text-decoration: underline;
}
.lowerFooter {
background-color: orange;
}
.footerLinks {
float: left;
position: relative;
}
/* added: */
.upperFooter {
background: green;
}
.upperFooter, .lowerFooter {
padding: 10px;
margin: 0;
}
<!-- HTML Code Snippet-->
<div class="contextSize">
<div id="footer">
<div class="upperFooter content">
<nav class="footerLinks">
<a href="#">개인정보처리방침
</a> |
<a href="#">이메일무단수집거부
</a> |
사이트맵 |
찾아오시는 길
</nav>
<h6 class="account">ADMIN</h6>
</div>
<div class="lowerFooter content">
sample
</div>
</div>
</div>
Another hint: your closing </h6> had no / in it as well.
I am making a website which has a certain background image. When it changes screen size i need the middle part of an image do be removed so the graphic would look slimmer . Here is the picture.
This is how it is now :
This is how i need it when the screen is changed to tablet :
My html :
<section class="hero" style="background-image: url(./images/hero.png)">
<header class="header">
<img src="./images/logo.png" alt="Logo image" class="logo">
<div class="shape hamburger">
<!-- <span class="hide">Hamburger icon</span> -->
<a class="line-shape" href="javascript:;"><span></span><span class="hide">Hamburger icon</span></a>
<span class="shape-txt" >MENU</span>
</div>
</header>
<div class="row">
<div class="col col-2 offset-2 col-2-t offset-2-t">
<h1 class="section-title">
Living our values
Transforming our business
</h1>
<p class="txt">
UDG Healthcare plc</br>
Annual Report and Accounts 2015
</p>
<span class="s s-down-arrow"><span class="hide">download</span></span>Download Full Report <span class="no-under">(PDF, 2.5 MB)</span>
</div>
</div>
<span class="above-btn">Explore our year</br>
in review</span>
<button type="button" class="down"><img src="./images/down.png" alt="Move to the top content"><span class="s s-down-arrow btn-arrow"><span class="hide">Move Down</span></span></button>
My css :
.hero {
background-repeat: no-repeat;
background-size: cover;
background-color: $hero-bg-cream;
overflow: hidden;
.row {
margin: 0;
}
h1 {
padding: 106px 0 7px;
line-height: 1.15;
word-spacing: 5px;
letter-spacing: 0px;
width: 70%;
font-size: 40px;
color: $grey;
}
.txt {
line-height: 19px;
padding-bottom: 14px;
color: $grey;
}
.padded {
padding-bottom: 421px;
}
.s-down-arrow {
&:last-child {
left: -38px;
color: $grey;
top: 0;
}
}
.above-btn {
font-size: 14px;
text-align: center;
display: block;
padding-bottom: 16px;
color: $grey;
}
.down {
transform: translateX(13%);
}
#include breakpoint (tablet) {
h1 {
font-size: 29px;
padding: 217px 0 7px;
}
.txt {
padding-bottom: 10px;
}
.padded {
padding-bottom: 308px;
}
.down {
transform: translateX(10%);
}
}
}
I guess I would need to remove the right part of the image or something like that ?
Ok so the solution was to make the background-size: auto;
You can do this here in HTML :
<section class="hero" style="background-image: url(./images/hero.png); background-size: 100% 100%;">
Or here, in CSS
.hero {
background-repeat: no-repeat;
background-size: 100% 100%;
background-color: $hero-bg-cream;
overflow: hidden;
.row {
margin: 0;
}
I've created a left navigation bar using buttons. I'm trying to reduce the hyperlink area to just the background image. Also, another issue I'm having is the elements overlaying the background image are taking precedence over the hyperlink, so the button is not actually clickable. Page for reference
http://www.auburn.edu/administration/facilities/home-page/index.html
Hyperlink area
Here's the background image area
.img-responsive {
display: block;
padding: 0;
margin: 0;
}
.background:hover .head {
color: #d76e08;
}
.overlay {
position: absolute;
z-index: 1;
top: 0;
left: 0;
color: white;
}
.icon {
padding-top: 15px;
padding-left: 40px;
}
.head {
margin-top: -75px;
padding-left: 120px;
}
.content {
margin-top: -5px;
padding-left: 120px;
padding-right: 35px;
}
<div class="row">
<div class="col-sm-12">
<div class="background">
<a href="../Collin/misc/issues/index.html">
<img alt="background" class="img-responsive" src="buttons/images/button.png" />
</a>
<div class="overlay">
<div class="icon">
<img alt="test" class="img-responsive" src="buttons/images/info-icon.png" />
</div>
<p class="head">Ask Facilities</p>
<p class="content">Here will be text about the button. .</p>
</div>
</div>
</div>
</div>
I'm trying to reduce the hyperlink area to just the background image.
Your markup is incredibly complex for what you are displaying.
You could have something like:
<ul>
<li>
<a>
<h2></h2>
<p></p>
</a>
</li>
<li>
<a>
<h2></h2>
<p></p>
</a>
</li>
</ul>
and add the image and the gradient using CSS.
I would use a single link tag for your button and leverage CSS gradients for the background:
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}
.button {
background-image: linear-gradient(to bottom, #3D85C6, #07355F 50%, #07355F);
background-size: 100% 200%;
border-radius: 4px;
color: #fff;
display: block;
padding: 10px;
text-decoration: none;
transition: all 150ms ease-in-out;
}
.button:hover,
.button:focus,
.button:active {
background-position: 0 50%;
}
.button-icon {
float: left;
margin-right: 15px;
}
.button-content {
overflow: hidden;
}
.button-title {
font-size: 18px;
font-weight: bold;
}
.button-description {
font-size: 16px;
}
<a class="button" href="../Collin/misc/issues/index.html">
<div class="button-icon">
<img src="http://satyr.io/72/white?brand=github" alt=""/>
</div>
<div class="button-content">
<p class="button-title">Ask Facilities</p>
<p class="button-description">Here will be text about the button…</p>
</div>
</a>
Also here http://jsbin.com/rikisemawe/edit?html,css,output
The elements in OP were stacked in the markup, there were no nested components of the button. That would explain the unusual position coords and large padding.
Instead of <img>, background-image is used. Changed some of the tags to a real <button>, <h4> instead of <p>, etc.
SNIPPET
.button {
position: relative;
min-width: 350px;
max-width: 100%;
min-height: 95px;
height: auto;
padding: 5px 10px;
border: 0 none transparent;
border-radius: 6px;
background: url(http://www.auburn.edu/administration/facilities/home-page/buttons/images/button.png)no-repeat;
background-size: cover;
}
.background:hover .head {
color: #d76e08;
}
.text {
padding: 0 5px;
position: absolute;
left: 85px;
top: 5px;
text-align: left;
color: #def;
text-decoration: none;
}
.button:hover,
.text:hover {
text-decoration: none;
color: #def;
}
.button:hover .head {
color: gold;
}
.icon {
width: 75px;
height: 75px;
position: absolute;
top: calc(50% - 37.5px);
background: url(http://www.auburn.edu/administration/facilities/home-page/buttons/images/service-icon.png)no-repeat;
}
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<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.7/js/bootstrap.min.js"></script>
<div class="row">
<div class="col-sm-12">
<button class="button">
<div class="icon"></div>
<a class='text'>
<h4 class="head">Ask Facilities</h4>
<p class="content">Here will be text about the button.</p>
</a>
</button>
</div>
</div>
Whenever I link my images, it automatically brings the content down a little bit. I want it to be 3 in 1 row and aligned perfectly. When you look in the example, scroll down and the bottom 3 are the way I want it to look like.
Where is my mistake?
See it yourself here: http://thequizmania.com/2100-2/#
HTML
<div id="pagewrap">
<br>
<p style="text-align: center">Quiz yourself. It's all about you!</p>
<a href="#">
<section id="content">
<img src="http://thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/>
<h3>What Kind Of Karma Do You Have?</h3>
</section>
</a>
<a href="#">
<section id="middle">
<img src="http://thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/>
<h3>What Kind Of Karma Do You Have?</h3>
</section>
</a>
<a href="#">
<aside id="sidebar">
<img src="http://thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/>
<h3>What Kind Of Karma Do You Have?</h3>
</aside>
</a>
<a href="#">
<section id="content">
<img src="http://thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/>
<h3>What Kind Of Karma Do You Have?</h3>
</section>
</a>
<a href="#">
<section id="middle">
<img src="http://i.imgur.com/QUuWywi.png" />
<h3>What Color Is Your Personality?</h3>
</section>
</a>
<a href="#">
<section id="sidebar">
<img src="http://thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/>
<h3>What Kind Of Karma Do You Have?</h3>
</section >
</a>
</div>
CSS
<style>
#import url(http://fonts.googleapis.com/css?family=Open+Sans);
#middle:hover {
background-color: #FFBFFF;
color: white;
}
#sidebar:hover {
background-color: #FFBFFF;
color: white;
}
#content:hover {
background-color: #FFBFFF;
color: white;
}
body {
font-family: 'Open Sans', sans-serif;
color: #666;
}
/* STRUCTURE */
#pagewrap {
padding: 0px;
width: 960px;
margin: auto;
}
#content {
width: 265px;
float: left;
padding: 0px 0px;
border:thin #E4E4E4 solid;
transition:.3s;
}
#middle {
width: 265px; /* Account for margins + border values */
float: left;
padding: 0px 0px;
margin: 0px 5px 5px 5px;
border:thin #E4E4E4 solid;
}
#sidebar {
width: 265px;
padding: 0px 0px;
float: left;
border:thin #E4E4E4 solid;
}
h2 {
padding:0px;
margin:0px;
}
/************************************************************************************
MEDIA QUERIES
*************************************************************************************/
/* for 980px or less */
#media screen and (max-width: 980px) {
#pagewrap {
width: 94%;
}
#content {
width: 41%;
padding: 1% 4%;
}
#middle {
width: 41%;
padding: 1% 1%;
margin: 0px 0px 5px 5px;
float: right;
}
#sidebar {
clear: both;
padding: 1% 4%;
width: auto;
float: none;
}
}
/* for 700px or less */
#media screen and (max-width: 650px) {
#content {
width: auto;
float: none;
}
#middle {
width: auto;
float: none;
margin-left: 0px;
}
#sidebar {
width: auto;
float: none;
}
}
/* for 480px or less */
#media screen and (max-width: 480px) {
header {
height: auto;
}
h1 {
font-size: 2em;
}
#sidebar {
display: none;
}
}
#content {
background: white;
}
#middle { background: white; }
#sidebar {
background: white;
}
#content, #middle, #sidebar {
margin-bottom: 30px;
margin-right:50px;
text-align:center;
}
}
</style>
The HTML in your question is different from the source code of your site. On your site, there are a bunch of <p> tags in between each section that have default margins that are throwing off the alignment of your images.
If you remove the <p> tags from the code on your site, the images will once again be properly aligned.
Here is a snippet of the source code from your site that shows all the extra <p> elements:
<p style="text-align: center">Quiz yourself. It’s all about you!</p>
<p><a href="#"></p>
<section id="content">
<img src="//thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/></p>
<h3>What Kind Of Karma Do You Have?</h3>
</section>
<p></a><br/>
<a href="#"></p>
<div id="middle">
<img src="//thequizmania.com/wp-content/uploads/2015/09/01_quiz.png"/></p>
<h3>What Kind Of Karma Do You Have?</h3>
</p></div>
<p></a><br/>
I am trying to make a header wider, so that it extends to both sides of the browser size. I have all of my content inside of a wrapper div that is set to 990px. My header is the part I want to be full width. I also am trying to make my header have a fixed position. But when i put the corrected position into the css for the header, the title and the navigation bar stack vertically and do not remain how I originally set them.
<body>
<div class="wrapper">
<header class="header">
<h1>Automotive Industries</h1>
<ul class="navbar">
<li id="contact" class="navlist">Contact</li>
<li class="navlist">Services</li>
<li class="navlist">About</li>
<li class="navlist">Home</li>
</ul>
</header>
<div class="main">
<p>Welcome to the #1 stop in automotive today</p>
<div class="article">
<img class="image" src="http://cdnedge.vinsolutions.com/dealerimages/Dealer%204697%20Images/content/car-tire-repair.jpg">
</div>
<div class="article">
<img class="image" src="http://www.lonniesautomachineshop.com/shopimg/Engines1.jpg">
</div>
<div class="article">
<img class="image" src="http://image.superstreetonline.com/f/features/modp-1011-castrol-syntec-top-car-challenge-nissan-gtr/29181584/eurp_1011_02_o+castrol_syntec_top_car_challenge+lift.jpg">
</div>
</div><!--end of main-->
<div class="main-two">
<p id="two-header">Schedule today for a free consultation</p>
<div class="article">
<img class="image" src="http://s3-media2.fl.yelpcdn.com/bphoto/YDLPwsEk_fMXIw9Xwu_8rw/ls.jpg">
</div>
<div class="article">
<img class="image" src="http://image.trucktrend.com/f/tech/1011tr_2004_gmc_sierra_buildup/28770854/1011tr_03+2004_GMC_sierra_buildup+factory_ring_and_pinion.jpg">
</div>
<div class="article">
<img class="image" src="http://aautomotivetx.com/wp-content/uploads/2013/04/Brakes.jpg">
</div>
</div><!--end of main-two-->
<div class="main-three">
<p id="two-header">Guranteed service for 30 days</p>
<div class="article">
<img class="image" src="http://bernalautobodyrepair.com/images/paint_booth.jpg">
</div>
<div class="article">
<img class="image" src="https://www.bkreader.com/wp-content/uploads/2015/06/welding-1.jpg">
</div>
<div class="article">
<img class="image" src="http://cdn.instructables.com/F4Q/QD4F/HHS9SLP0/F4QQD4FHHS9SLP0.LARGE.jpg">
</div>
</div><!--end of main-three-->
<footer class="footer">
<p class="copyright">Schedule now! Call today at (123)456-7890.</p>
<p class="copyright-two">Copyright © All Rights Reserved.</p>
<div class="social-icons">
<img src="http://www.voxlumiere.com/wp-content/uploads/2009/12/facebook-logo-resized-image-50x50.png"/>
<img src="http://www2.actionforchildren.org.uk/media/128162/twitter_50x50.jpg"/>
<img src="http://www.clickondetroit.com/image/view/-/21435108/highRes/1/-/ubsa5pz/-/50x50-Instagram-logo-png.png"/>
</div><!--end of social-icons-->
</footer>
</div><!--end of wrapper-->
* {
padding: 0;
margin: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-size: 62.5%;
font-family: arial, sans-serif;
color: black;
background-image: url("http://www.theonecar.com/wp-content/uploads/2014/02/car-shops-499.jpg"), url("http://i.ytimg.com/vi/1n5j3sy-Rok/maxresdefault.jpg");
background-repeat: no-repeat;
background-position: top, bottom;
}
.wrapper {
font-size: 1.6em;
margin: 0 auto;
width: 990px;
background-color: white;
/*padding: 2em;*/
}
header {
background-color: white;
height: 50px;
display: block;
width: 100%;
}
header h1 {
float: left;
padding: 5px;
color: rgb(95, 207, 128);
margin-top: 5px;
margin-left: 100px;
font-size: 1.8em;
}
.navlist a {
text-decoration: none;
color: black;
}
.navlist a:hover {
color: white;
background-color: rgb(95, 207, 128);
padding: 15px;
}
.navlist {
float: right;
display: inline-block;
text-align: center;
padding: 15px;
font-size: 1.2em;
}
.main {
min-height: 20px;
background-color: rgb(95, 207, 128);
display: block;
width: 100%;
}
.main p {
color: white;
font-size: 1.6em;
padding: 50px;
float: left;
width: 100%;
}
.article {
display: inline-block;
width: 33%;
padding: 63px;
}
.image {
min-width: 200px;
min-height: 200px;
max-width: 200px;
max-height: 200px;
}
.main-two {
background-color: #39ADD1;
display: block;
}
.main-two p {
color: white;
font-size: 1.6em;
padding: 50px;
text-align: right;
width: 100%;
}
.main-three {
min-height: 20px;
background-color: #f08c35;
display: block;
width: 100%;
}
.main-three p {
color: white;
font-size: 1.6em;
padding: 50px;
float: left;
width: 100%;
}
.article {
display: inline-block;
width: 33%;
padding: 63px;
}
.article {
display: inline-block;
width: 33%;
padding: 63px;
}
footer {
background-color: #294860;
}
.copyright {
text-align: center;
padding: 5px;
color: white;
font-size: 1.4em;
}
.copyright-two {
text-align: center;
padding: 5px;
color: white;
font-size: 1.4em;
}
.social-icons {
display: inline-block;
padding: 5px;
margin-left: 40.2%;
width: 100%;
}
.social-icons a {
margin-left: 5px;
header {
...
width: 100%;
min-width: 990px;
position: fixed;
left: 0;
}
Demo
You're seeing horizontal scrolling because the site loads in a frame. That shouldn't happen in a full browser window.
you header would need to be outside the wrapper since the wrapper is 990px wide.
make the header width 100% but it needs to either be on the root of the div structure or in another 100% width element.
Because it's inside you're <div class="wrapper"> It's not possible,
Move it above the wrapper and it should work.
<header class="header">
<h1>Automotive Industries</h1>
<ul class="navbar">
<li id="contact" class="navlist">Contact</li>
<li class="navlist">Services</li>
<li class="navlist">About</li>
<li class="navlist">Home</li>
</ul>
</header>
<div class="wrapper">