So this is what I did so far :
#mybutton {
background-color: #08c2f3;
width: 200px;
height: 35px;
padding: 6px;
color: white;
font-size: 30px;
font-family: sans-serif;
text-align :center;
border: 1px solid white;
}
body {
background-color: #1599e1
}
#myBar {
width: 100%;
height: 9px;
background: white;
transform: rotateZ(-54deg);
position: relative;
left: 42px;
}
<div id="mybutton">
<span>OK</span>
<div id="myBar"></div>
</div>
but my goal is :
Just add overflow: hidden to the parent container as it will hide your unwanted portion peeping out.
#mybutton {
background-color: #08c2f3;
width: 200px;
height: 35px;
padding: 6px;
color: white;
font-size: 30px;
font-family: sans-serif;
text-align: center;
border: 1px solid white;
overflow: hidden;
}
body {
background-color: #1599e1
}
#myBar {
width: 100%;
height: 9px;
background: white;
transform: rotateZ(-54deg);
position: relative;
left: 42px;
}
<div id="mybutton">
<span>OK</span>
<div id="myBar"></div>
</div>
You don't actually need the "bar" element at all.
This can be achieved with an angled background gradient
#mybutton {
background: linear-gradient(124deg, #08c2f3 70%, white 70%, white 75%, #08c2f3 75%);
width: 200px;
height: 35px;
padding: 6px;
color: white;
font-size: 30px;
font-family: sans-serif;
text-align: center;
border: 1px solid white;
}
body {
background-color: #1599e1
}
<div id="mybutton">
<span>OK</span>
</div>
Related
Please refer to this image as a visual aid for my question.
I want the text input with "Sindre", the other input, and the buttons, to be placed higher, so they vertically align with the Icehotel logo. How can I do this?
Here's my code...
HTML
<div id="header-content">
<br>
<a href="/index">
<img draggable="false" src="{url}/app/tpl/skins/{skin}/images/logo.gif" style="position:relative; margin-left: 20px; <div align=; color: #FA0000;margin-top: 15px;margin-left: 180px">
</a>
<input id="username" name="log_username" placeholder="Username" style="position:relative; margin-left: 20px;padding:5px;box-shadow:3px 3px 5px black;border: 0;width:250px;background: #3b8ba4;border-radius: 6px;color: #baedf5;" type="text">
<input id="password" name="log_password" placeholder="Password" style="position:relative;margin-left: 1px;padding:5px;box-shadow:3px 3px 5px black;border: 0;width:250px;background: #3b8ba4;border-radius: 6px;color: #baedf5;" type="password">
<a href="{url}/api.php">
<button class="login green" name="login" style="height:34px;" type="submit">Let's go!</button>
</a>
<a>
<button class="login red" style="height:34px; margin-left: 4px" type="sumbit">Forgot your password?</button>
</a>
</div>
CSS
pre, blockquote {
border: 1px solid #999;
page-break-inside: avoid
}
thead {
display: table-header-group
}
tr, img {
page-break-inside: avoid
}
img {
max-width: 100%!important
}
#page {
margin: .5cm
}
p, h2, h3 {
orphans: 3;
widows: 3
}
h2, h3 {
page-break-after: avoid
}
}
html {
height: 100%
}
body {
height: 100%;
margin: 0;
padding: 0;
color: #e0eff5;
background-attachment: fixed;
background-color: #013448;
background-image: url('http://localhost/app/tpl/skins/aura/habboweb/planet.png');
background-image: url('http://localhost/app/tpl/skins/aura/habboweb/planet.png'), -webkit-radial-gradient(190px 190px, circle farthest-side, #0297c8 0, #013448 480px);
background-image: url('http://localhost/app/tpl/skins/aura/habboweb/planet.png'), -moz-radial-gradient(190px 190px, circle farthest-side, #0297c8 0, #2D3877 480px);
, -ms-radial-gradient(190px 190px, circle farthest-side, #0297c8 0, #013448 480px);
, radial-gradient(circle farthest-side at 190px 190px, #0297c8 0, #013448 480px);
min-height: 755px
}
i, cite, em, var, address, dfn {
font-style: italic;
}
body {
font-family: "Ubuntu Condensed", Arial, serif;
font-weight: normal;
min-height: 0;
}
#footer a {
color: #a1b5c8;
text-decoration: none;
font-size: 13px;
}
body {
font-size: 1em;
line-height: 1.4;
}
.form__input, .form__select {
box-shadow: inset 0 2px 0 0 #9ebecc;
line-height: 1.2;
padding: 5px 12px;
width: 100%;
font-size: 16px;
}
.button b, .new-button i {
position: absolute;
display: block;
left: 2px;
top: 3px;
right: 2px;
height: 9px;
background-color: #4a9fb4;
z-index: 0
}
.button:hover, .new-button:hover {
background-color: #418491
}
.button:hover b, .new-button:hover i {
background-color: #46a9bf
}
.button span, .new-button b {
position: relative;
z-index: 100
}
.button:active, .button-active, .new-button:active {
left: 1px;
top: 1px;
box-shadow: 2px 2px rgba(0, 0, 0, 0.4)
}
.button.dimmed {
-ms-filter: "alpha(opacity=50)";
filter: alpha(opacity=50);
-moz-opacity: .5;
opacity: .50
}
.button.large {
height: 100px;
background-color: #c78800;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #5f4416
}
.button.large:hover {
background-color: #d99b00
}
.button.large:hover b {
background-color: #f7ce00
}
.button.large b {
left: 4px;
top: 4px;
right: 4px;
height: 48px;
background-color: #f0bb00;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0
}
.button.large span {
display: block;
font-size: 27px;
font-weight: bold;
text-transform: uppercase;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
line-height: 54px
}
.button.large span.sub {
display: block;
font-size: 17px;
font-weight: bold;
line-height: 42px;
text-transform: none
}
.button.large.not-so-large {
height: 48px
}
.button.large.not-so-large b {
height: 20px
}
.button.large.not-so-large span {
text-transform: none;
font-size: 22px;
line-height: 46px
}
header, footer {
width: 100%;
background: #101016;
background: rgba(16, 16, 22, 0.85);
position: fixed;
z-index: 999
}
#login-errors {
width: 100%;
height: 35px;
background-color: #c00;
color: #fff;
font-size: 17px;
font-weight: bold;
text-align: center;
line-height: 35px
}
#login-errors a {
color: #000
}
#footer-content {
float: left;
margin-left: 50px
}
#footer-content.partner-logo-present {
margin-left: 20px
}
#footer {
width: 100%;
min-width: 780px;
margin-top: 19px
}
header {
top: 0;
min-height: 99px
}
header #border-left {
position: absolute;
width: 500px;
height: 1px;
left: 0;
bottom: 0;
border-bottom: 1px solid #7aa3b9
}
header #border-right {
position: absolute;
width: 100%;
height: 1px;
left: 220px;
bottom: 0;
border-bottom: 1px solid #7aa3b9
}
footer {
height: 69px;
bottom: 0;
border-top: 1px solid #7aa3b9
}
#top-bar-triangle, #top-bar-triangle-border {
position: absolute;
left: 163px;
bottom: -29px
}
#top-bar-triangle {
font-size: 0;
height: 0;
line-height: 0;
border-style: solid;
float: left;
margin: 0;
border-color: #101016 transparent;
border-color: rgba(16, 16, 22, 0.85) transparent;
border-width: 29px 29px 0 29px
}
#top-bar-triangle-border {
background-image: url('http://localhost/images/new_index/images/v3/top_bar_arrow_border.out.png');
width: 58px;
height: 29px
}
header #habbo-logo {
position: absolute;
width: 190px;
height: 52px;
background-image: url('http://localhost/app/tpl/skins/aura/images/logo.png');
left: 32px;
top: 27px
}
#login-form-container {
position: relative
}
header form {
position: relative;
left: 239px;
top: 0;
width: 740px;
height: 99px
}
#login-columns {
position: relative
}
header form.captcha {
height: 200px
}
header form.captcha #login-recaptcha {
height: 103px;
margin-top: 8px
}
#login-recaptcha .field-error, #login-recaptcha #captcha-overlay {
display: none
}
#login-column-1 {
position: absolute;
left: 0;
top: 11px;
width: 205px;
height: 70px
}
#login-column-2 {
position: absolute;
left: 214px;
top: 11px;
width: 134px;
height: 70px
}
#login-column-3 {
position: absolute;
left: 358px;
top: 32px;
width: 205px;
height: 55px
}
Set vertical-align: middle; on the inputs and remove the margin-top from the inline styles in the logo <img> tag.
While I'm at this, though...General cleanup of this code is probably a good idea. I would like to caution you to avoid mixing inline styles and CSS. Also, the <br> tag should probably be replaced with padding - that line break and the inline styles are there only for design purposes and design is handled in CSS. Keeping as much design out of the HTML will help you (or someone else) easily make changes to this site later, if needed. The <img> tag's styles also include two margin-left values. I would remove one to avoid confusion. Lastly, I think you will want to remove <div align=; from the <img> tag's styles. As far as I know, this doesn't accomplish anything.
Hope that helps!
When ever I re-size the window the header moves leaving a space on the right side. (Refer to image ). If I shrink the window horizontally even more the gap increases. I have only been able to fix this problem by making the position for header to fixed but then the text overlaps. I want the header to move with the vertical scroll. Any help on here where I am going wrong is highly appreciated.
*{
padding:0;
margin:0 auto;
font-family: 'Museo Slab 300';
}
html{
background: url("Images/backlines.png") no-repeat center center fixed;
}
.company-header {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%,color-stop(0, rgb(226, 226, 226)),color-stop(0, rgb(254, 254, 254)),color-stop(0.1, rgb(254, 254, 254)),color-stop(1, rgb(219, 219, 219)),color-stop(1, rgb(209, 209, 209)));
height: 140px;
box-shadow: 0px 2px;
position: absolute;
width: 100%;
top: 0px;
}
.company-footer{
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #efefef;
text-align: left;
z-index:-1;
box-shadow: 0px -4px rgba(0, 173, 239, 1);
}
img#logo-image {
position: absolute;
left: 270px;
}
div#setting-dropdown {
position: relative;
float: right;
right: 250px;
top: 58px;
}
div#setting-dropdown-content {
display: none;
background: rgba(0, 173, 239, 1);
width: 196px;
margin-left: -70px;
padding: 4px 5px 5px 7px;
}
div#setting-dropdown-content a {
color: white;
text-decoration: none;
font-size: 16px;
font-family: 'Museo Slab 300';
display: inline-block;
}
div#setting-dropdown i {
display: inline-block;
padding: 5px;
padding-right: 7px;
text-align: center;
border-radius: 10px 10px 0 0;
padding-bottom: 10px;
color: rgba(0, 173, 239, 1);
}
div#setting-dropdown:hover i {
background-color: rgba(0, 173, 239, 1);
color:white;
}
#setting-dropdown:hover #setting-dropdown-content {
display:block;
}
p#setting-dropdown {
font-size: 20px;
font-weight: bold;
}
button#company-logout {
background: rgba(255, 255, 255, 1);
border: none;
border-radius: 40px 40px 40px 40px;
width: 135px;
height: 40px;
font-size: 19px;
font-weight: 900;
font-family: 'Museo Slab 700';
float: right;
top: 54px;
right: -40px;
position: relative;
}
div#log-in {
position: relative;
top: 200px;
}
div#welcome-text {
margin-left: 276px;
font-family: 'Museo Slab 300';
font-size: 22px;
}
div#loginHeader {
margin-top: 60px;
margin-left: 276px;
}
div#dropdown-main-content {
position: relative;
top: 230px;
left: 276px;
display: inline-flex;
}
.dropdown {
position: relative;
width: 11em;
top: 60px;
right: 260px;
}
.dropbtn {
color: white;
width: 100%;
height: 3.2em;
font-size: 16px;
border: none;
text-align: start;
font-weight: 900;
background: rgba(0, 173, 239, 1);
border-radius: 50px 50px 50px 50px;
-moz-border-radius: 0px;
z-index: 2;
text-indent: 23px;
}
.dropdown-content {
display: none;
z-index: -1;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
margin-top: -64px;
width: 176px;
}
.dropdown a {
background:url("Images/sidearrow.png") no-repeat 7px;
}
.dropdown-content a {
color: black;
padding: .75em;
text-decoration: none;
display: block;
border: 1px solid #000;
border-top: none;
text-indent: 12px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
.dropdown-content a:hover {
background:url("Images/sidewhite.png") no-repeat 3px;
background-color: rgb(255,131,0);
color:white;
font-weight:900;
}
.dropdown-content a:first-child {
padding-top: 35px;
background: url("Images/sidearrow.png") no-repeat 7px 36px;
}
.dropdown-content a:first-child:hover {
background: url("Images/sidewhite.png") no-repeat 3px 36px;
color:white;
background-color: rgb(255,131,0);
font-weight:900;
}
img#sphere {
position: relative;
width: 35px;
height: 34px ;
left: 133px;
bottom: 42px;
}
img#sphere-arrow {
position: relative;
bottom: 44px;
left: 99px;
}
div#login-form {
margin-top: 100px;
margin-left: 276px;
}
.page-label {
font-size: 19px;
}
button#loginSubmit {
margin-top: 75px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 185px;
height: 60px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
div#login-landingpage{
margin-left: 276px;
margin-top: 90px;
}
select.security-questions {
width: 450px;
height: 40px;
font-weight: bold;
}
.security-question-labels {
font-size: 21px;
font-family: 'Museo Slab 300';
}
<!DOCTYPE html>
<html>
<head>
<title>Averios</title>
<link rel="stylesheet" type="text/css" href="test.css">
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" />
<meta charset="utf-8">
</head>
<body>
<div class="company-header">
<img id="averios-logo-image" src="Images/averioslogo.png" width="176" height="129">
<div id="setting-dropdown">
<!-- SETTING DROPDOWN WILL GO HERE -->
<p id="setting-dropdown"> SETTINGS <i class="ion-chevron-down"></i></p>
<div id="setting-dropdown-content">
Change Password
Change Security Settings
</div>
</div>
<button id="company-logout"> LOGOUT </button>
</div>
<div id="log-in">
<div id="loginHeader">
<h1>Portal</h1>
</div>
<br>
<br>
<div id="welcome-text">
<p> Welcome name </p>
<p> Your last login was time on date </p>
<br>
<p> Please select an application below to begin </p>
</div>
</div>
<div id="dropdown-main-content">
<img id="pulse-image" src="C:\Users\user\Desktop\Final-Designs\Images\pulse.png" width="320" height="50" alt=""/>
<div id="dropdown-one">
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<img id="sphere" src="C:\Users\user\Desktop\Final-Designs\Images\sphere.png" alt=""/>
<img id="sphere-arrow" src="C:\Users\user\Desktop\Final-Designs\Images\arrow.png" alt=""/>
<div class="dropdown-content">
option0
option1
</div>
</div>
</div>
<!-- SENTINAL -->
<img id="sentinal-image" src="C:\Users\user\Desktop\Final-Designs\Images\sentinal.png" width="380" height="50" alt=""/>
<div id="dropdown-second">
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<img id="sphere" src="C:\Users\user\Desktop\Final-Designs\Images\sphere.png" alt=""/>
<img id="sphere-arrow" src="C:\Users\user\Desktop\Final-Designs\Images\arrow.png" alt=""/>
<!--<div class="sphere-two">
<div id="arrow-two">
<img src="C:\Users\user\Desktop\Images\arrow.png" width="29" height="27" alt=""/>
</div>
</div>-->
<div class="dropdown-content">
option0
option1
</div>
</div>
</div>
</div>
<div class="company-footer">
<div id="footer-text">
© 2016 Company, All Rights Reserved.
</div>
</div>
</body>
</html>
Problem is
div#dropdown-main-content {
position: relative;
top: 230px;
left: 276px;
display: inline-flex; }
try to remove display to inline and left to 0 like this
div#dropdown-main-content {
position: relative;
top: 230px;
display: inline; }
also remove fixed widths from images and divs, try to use max-width.
update
*{
padding:0;
margin:0 auto;
font-family: 'Museo Slab 300';
}
html{
background: url("Images/backlines.png") no-repeat center center fixed;
}
.averios-header {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%,color-stop(0, rgb(226, 226, 226)),color-stop(0, rgb(254, 254, 254)),color-stop(0.1, rgb(254, 254, 254)),color-stop(1, rgb(219, 219, 219)),color-stop(1, rgb(209, 209, 209)));
height: 140px;
box-shadow: 0px 2px;
position: absolute;
width: 100%;
top: 0px;
}
.averios-footer{
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #efefef;
text-align: left;
z-index:-1;
box-shadow: 0px -4px rgba(0, 173, 239, 1);
}
img#averios-logo-image {
position: absolute;
left: 270px;
}
div#setting-dropdown {
position: relative;
float: right;
right: 250px;
top: 58px;
}
div#setting-dropdown-content {
display: none;
background: rgba(0, 173, 239, 1);
width: 196px;
margin-left: -70px;
padding: 4px 5px 5px 7px;
}
div#setting-dropdown-content a {
color: white;
text-decoration: none;
font-size: 16px;
font-family: 'Museo Slab 300';
display: inline-block;
}
div#setting-dropdown i {
display: inline-block;
padding: 5px;
padding-right: 7px;
text-align: center;
border-radius: 10px 10px 0 0;
padding-bottom: 10px;
color: rgba(0, 173, 239, 1);
}
div#setting-dropdown:hover i {
background-color: rgba(0, 173, 239, 1);
color:white;
}
#setting-dropdown:hover #setting-dropdown-content {
display:block;
}
p#setting-dropdown {
font-size: 20px;
font-weight: bold;
}
button#averios-logout {
background: rgba(255, 255, 255, 1);
border: none;
border-radius: 40px 40px 40px 40px;
width: 135px;
height: 40px;
font-size: 19px;
font-weight: 900;
font-family: 'Museo Slab 700';
float: right;
top: 54px;
right: -40px;
position: relative;
}
div#log-in {
position: relative;
top: 200px;
}
div#welcome-text {
margin-left: 276px;
font-family: 'Museo Slab 300';
font-size: 22px;
}
div#loginHeader {
margin-top: 60px;
margin-left: 276px;
}
div#dropdown-main-content {
position: relative;
top: 230px;
display: inline-block;
text-align: center;
width: 100%;
}
.dropdown {
position: relative;
width: 11em;
top: 60px;
}
.dropbtn {
color: white;
width: 100%;
height: 3.2em;
font-size: 16px;
border: none;
text-align: start;
font-weight: 900;
background: rgba(0, 173, 239, 1);
border-radius: 50px 50px 50px 50px;
-moz-border-radius: 0px;
z-index: 2;
text-indent: 23px;
}
.dropdown-content {
display: none;
z-index: -1;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
margin-top: -64px;
width: 176px;
}
.dropdown a {
background:url("Images/sidearrow.png") no-repeat 7px;
}
.dropdown-content a {
color: black;
padding: .75em;
text-decoration: none;
display: block;
border: 1px solid #000;
border-top: none;
text-indent: 12px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
.dropdown-content a:hover {
background:url("Images/sidewhite.png") no-repeat 3px;
background-color: rgb(255,131,0);
color:white;
font-weight:900;
}
.dropdown-content a:first-child {
padding-top: 35px;
background: url("Images/sidearrow.png") no-repeat 7px 36px;
}
.dropdown-content a:first-child:hover {
background: url("Images/sidewhite.png") no-repeat 3px 36px;
color:white;
background-color: rgb(255,131,0);
font-weight:900;
}
img#sphere {
position: relative;
width: 35px;
height: 34px ;
left: 133px;
bottom: 42px;
}
img#sphere-arrow {
position: relative;
bottom: 44px;
left: 99px;
}
div#login-form {
margin-top: 100px;
margin-left: 276px;
}
.page-label {
font-size: 19px;
}
input[type="text"] {
background: #EDEDEE;
background : rgba(237, 237, 238, 1);
border-style : Solid;
border-color : #4B4E53;
border-color : rgba(75, 78, 83, 1);
border-width : 1px;
width: 370px;
height: 35px;
font-size: 26px;
}
input[type="password"] {
background: #EDEDEE;
background : rgba(237, 237, 238, 1);
border-style : Solid;
border-color : #4B4E53;
border-color : rgba(75, 78, 83, 1);
border-width : 1px;
width: 370px;
height: 35px;
font-size: 26px;
}
button#loginSubmit {
margin-top: 75px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 185px;
height: 60px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
div#login-landingpage{
margin-left: 276px;
margin-top: 90px;
}
select.security-questions {
width: 450px;
height: 40px;
font-weight: bold;
}
.security-question-labels {
font-size: 21px;
font-family: 'Museo Slab 300';
}
button#saveSubmit {
margin-top: 55px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 170px;
height: 55px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
button#cancelSubmit {
margin-top: 55px;
background: rgb(75,79,84);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 170px;
height: 55px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 478px;
}
div#security-form {
margin-top: 60px;
margin-left: 276px;
}
/* TEST */
div#dropdown-col-2 {
display:inline-block;
}
div#dropdown-second {
position: absolute;
left: 1040px;
top: -10px;
}
//HTML
<div class="averios-header">
<img id="averios-logo-image" src="http://lorempixel.com/176/129/"></img>
</a>
<div id="setting-dropdown">
<!-- SETTING DROPDOWN WILL GO HERE -->
<p id="setting-dropdown"> SETTINGS <i class="ion-chevron-down"></i></p>
<div id="setting-dropdown-content">
Change Password
Change Security Settings
</div>
</div>
<button id="averios-logout"> LOGOUT </button>
</div>
<div id="log-in">
<div id="loginHeader">
<h1> Portal</h1>
</div>
<br>
<br>
<div id="welcome-text">
<p> Welcome name </p>
<p> Your last login was time on date </p>
<br>
<p> Please select an application below to begin </p>
</div>
</div>
<div id="dropdown-main-content">
<div id="dropdown-col-2">
<img id="averios-pulse-image" src="http://lorempixel.com/362/46/" alt="" />
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<div class="dropdown-content">
Option1
</div>
</div>
</div>
<!-- SENTINAL -->
<div id="dropdown-col-2">
<img id="averios-sentinal-image" src="http://lorempixel.com/362/46/" alt="" />
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<div class="dropdown-content">
Option1
</div>
</div>
</div>
</div>
<div class="averios-footer">
<div id="footer-text">
© 2016, All Rights Reserved.
</div>
</div>
I am pretty new to HTML5 and CSS and decided to try and make my own website to get my feet wet. I am looking to make a simpler version of http://www.igshoutouts.com/ to advertise my Instagram pages.
I am having trouble lining up the boxes such as putting the MEDIA, FOLLOWERS, and FOLLOWING along with the numbers in a box.
How do I get the MEDIA, FOLLOWERS, and FOLLOWING along with the numbers in each box.
I cant seem to line up the text where I want it on the page either. I was told not to put the text in CSS so how do I put it all
I have attached my code, please let me know how it looks so far.
/* Base Styles -------------------- */
* {
box-sizing: border-box;
}
body {
color: #878787;
margin: 0;
font: 1em/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
h1 {
font-size: 5.625rem; /* 90px/16px */
font-family: serif;
color: rgba(255, 255, 255, 1);
text-transform: uppercase;
font-weight: bold;
line-height: 1.3;
}
img {
max-width: 100%
margin-bottom: 20px;
}
/* Pseudo-classes ------------------ */
a:link {
color: rgb(255, 169, 73);
text-decoration: none;
}
a:visited {
color: lightblue;
}
a:hover {
color: rgba(255, 169, 73, .4);
}
a:active {
color: lightcoral;
}
.flex-item {
color: black;
font-size: 14px;
font-weight: bold;
}
/* Main Styles --------------------- */
.main-header {
background-color: blue;
padding-top: 20px;
height: 300px;
box-sizing: border-box;
}
.title {
color: white;
font-size: 1.625rem; /* 26px/16px */
}
.intro {
font-size: 1.25em; /* 20px/16px */
line-height: 1.6;
}
.primary-content,
.main-header,
.main-footer {
text-align: center;
}
.primary-content {
padding-top: 25px;
padding-bottom: 95px;
}
.secondary-content {
padding-top: 80px;
padding-bottom: 70px;
border-bottom: 2px solid #dfe2e6;
}
.callout {
font-size: 1.25em;
border-bottom: 3px solid;
padding: 0 9px 3px;
margin-top: 20px;
display: inline-block;
}
.main-footer {
padding-top: 60px;
padding-bottom: 60px;
border-bottom: 10px solid #ffa949;
}
.t-border {
border-top: 2px solid #dfe2e6;
}
/* Layout Styles ------------------ */
.primary-content,
.secondary-content {
width:10%;
box-sizing: border-;
padding-left: 10px;
padding-right: 50px;
margin: left-side;
max-width: 50px;
}
.box {
background: url(igbodybuildingworld2.jpg);
background-size: 150px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 300px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 1px solid black;
height: 400px;
}
.box2 {
background: url(absmotivation1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box3 {
background: url(instafitnesslifestyle1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box4 {
background: url(absinspiration1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box5 {
background: url(gymcomedy1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box6 {
background: url(instafitnesstransformations2.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box7 {
background: url(motivation2squat2.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box8 {
background: url(fitness_lifestyle202.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box9 {
background: url(gymlife222.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
.ad-left {
float: left;
}
<!DOCTYPE html>
<html>
<head>
<title>Instagram Shoutouts</title>
<link rel="stylesheet" href="Instagrampage.css">
</head>
<body>
<header id="top" class="main-header">
<h1>Instagram Shoutouts</h1>
<span class="title">Increase followers with instagram shoutouts!</span>
</header>
<p>igbodybuildingworld<br>MEDIA FOLLOWERS FOLLOWING<br>101 32K 321<br>Select Options</p>
</body>
</html>
<div class="box"></div>
<div class="box2">absmotivation101</div>
<div class="box3">instafitnesslifestyle101</div>
<div class="box4">absinspiration101</div>
<div class="box5">gymcomedy101</div>
<div class="box6">instafitnesstransformations</div>
<div class="box7">motivation2squat</div>
<div class="box8">fitness_lifestyle20</div>
<div class="box9">gymlife22</div>
</div>
</div><!-- End .secondary-content -->
<html>
<head>
</head>
<style>
.flex-container {
display: -webkit-flex;
display: flex;
width: 280px;
height: 400px;
background-color: white;
border: 0px solid black;
}
.flex-item {
background-color: white;
padding-top: 5px;
border: 1px solid black;
text-align: center;
width: 100px;
height: 50px;
margin:5px;
margin-top: 300px;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">MEDIA</div>
<div class="flex-item">FOLLOWERS</div>
<div class="flex-item">FOLLOWING</div>
</div>
</body>
</html>
I don't know what exactly you want but it may like below code
<html><head>
<style>
/* Base Styles -------------------- */
* {
box-sizing: border-box;
}
body {
color: #878787;
margin: 0;
font: 1em/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
h1 {
font-size: 5.625rem; /* 90px/16px */
font-family: serif;
color: rgba(255, 255, 255, 1);
text-transform: uppercase;
font-weight: bold;
line-height: 1.3;
}
img {
max-width: 100%
margin-bottom: 20px;
}
/* Pseudo-classes ------------------ */
a:link {
color: rgb(255, 169, 73);
text-decoration: none;
}
a:visited {
color: lightblue;
}
a:hover {
color: rgba(255, 169, 73, .4);
}
a:active {
color: lightcoral;
}
.flex-item {
color: black;
font-size: 14px;
font-weight: bold;
float: left;
width: 33.3%;
text-align: center;
}
.flex-container {
width: 100%;
display: table;
}
/* Main Styles --------------------- */
.main-header {
background-color: blue;
padding-top: 20px;
height: 300px;
box-sizing: border-box;
}
.title {
color: white;
font-size: 1.625rem; /* 26px/16px */
}
.intro {
font-size: 1.25em; /* 20px/16px */
line-height: 1.6;
}
.primary-content,
.main-header,
.main-footer {
text-align: center;
}
.primary-content {
padding-top: 25px;
padding-bottom: 95px;
}
.secondary-content {
padding-top: 80px;
padding-bottom: 70px;
border-bottom: 2px solid #dfe2e6;
}
.callout {
font-size: 1.25em;
border-bottom: 3px solid;
padding: 0 9px 3px;
margin-top: 20px;
display: inline-block;
}
.main-footer {
padding-top: 60px;
padding-bottom: 60px;
border-bottom: 10px solid #ffa949;
}
.t-border {
border-top: 2px solid #dfe2e6;
}
/* Layout Styles ------------------ */
.primary-content,
.secondary-content {
width:10%;
box-sizing: border-;
padding-left: 10px;
padding-right: 50px;
margin: left-side;
max-width: 50px;
}
.box {
background: url(igbodybuildingworld2.jpg);
background-size: 150px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 300px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 1px solid black;
height: 400px;
}
.box2 {
background: url(absmotivation1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box3 {
background: url(instafitnesslifestyle1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box4 {
background: url(absinspiration1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box5 {
background: url(gymcomedy1012.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box6 {
background: url(instafitnesstransformations2.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box7 {
background: url(motivation2squat2.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box8 {
background: url(fitness_lifestyle202.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
}
.box9 {
background: url(gymlife222.jpg);
background-size: 250px;
background-repeat: no-repeat;
background-position: top center;
float: left;
color: black;
font-weight: bold;
font-size: 18px;
text-align: center;
line-height: 500px;
background-color: white;
width: 280px;
margin-left: 10px;
margin-right: 10px;
margin-top: 30px;
padding: 5px;
border: 2px solid black;
height: 400px
.ad-left {
float: left;
}
</style>
</head>
<body>
<title>Instagram Shoutouts</title>
<link rel="stylesheet" href="Instagrampage.css">
<header id="top" class="main-header">
<h1>Instagram Shoutouts</h1>
<span class="title">Increase followers with instagram shoutouts</span>
</header>
<p>igbodybuildingworld
<br>
MEDIA FOLLOWERS FOLLOWING
<br>
101 32K 321
<br>
Select Options</p>
<div class="box"></div>
<div class="box2">absmotivation101</div>
<div class="box3">instafitnesslifestyle101</div>
<div class="box4">absinspiration101</div>
<div class="box5">gymcomedy101</div>
<div class="box6">instafitnesstransformations</div>
<div class="box7">motivation2squat</div>
<div class="box8">fitness_lifestyle20</div>
<div class="box9">gymlife22</div>
<div class="flex-container">
<div class="flex-item"><p>12K</p><p>MEDIA</p></div>
<div class="flex-item"><p>12K</p><p>FOLLOWERS</p></div>
<div class="flex-item"><p>24K</p><p>FOLLOWING</p></div>
</div>
<script type="text/javascript">
</script>
</body></html>
Basically, the image below summarizes my question.
Is there any elegant solution to make it work? I've tried to use rotate, skew and perspective, but didn't work for me.
Note: the background needs to be transparent.
My code for you. :)
* { box-sizing: border-box; }
body { font: normal 16px sans-serif; }
.spaceship {
height: 430px;
position: relative;
width: 140px;
}
.spaceship::before {
background: #006dd9;
border-radius: 100%;
content: '';
height: 70px;
position: absolute;
width: 140px;
z-index: 1;
}
.abduction {
background: #0f0;
height: 370px;
left: 20px;
padding-top: 10px;
position: absolute;
top: 60px;
width: 100px;
}
.abduction a {
color: #fff;
display: block;
height: 60px;
padding-top: 25px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: background 500ms;
}
.abduction a:nth-child(even) { background: #00d900; }
.abduction a:hover { background: #008c00; }
<div class="spaceship">
<div class="abduction">
Button 1
Button 2
Button 3
Button 4
Button 5
Button 6
</div>
</div>
Here's what I changed your css to make it look like your picture and do the correct hover effect:
* { box-sizing: border-box; }
body { font: normal 16px sans-serif; }
.spaceship {
height: 430px;
position: relative;
width: 140px;
}
.spaceship::before {
background: #006dd9;
border-radius: 100%;
content: '';
height: 70px;
position: absolute;
width: 140px;
z-index: 1;
}
.abduction {
height: 370px;
left: 20px;
padding-top: 5px;
position: absolute;
top: 60px;
width: 100px;
}
.abduction a {
color: #fff;
display: block;
height: 65px;
margin: 0 auto;
padding: 0;
border-bottom: 65px solid #0f0;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
line-height: 5;
font-size: 12px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: border-bottom-color 500ms;
}
.abduction a:nth-child(5){
width: 94px;
}
.abduction a:nth-child(4){
width: 88px;
}
.abduction a:nth-child(3){
width: 82px;
}
.abduction a:nth-child(2){
width: 76px;
}
.abduction a:nth-child(1){
width: 70px;
}
.abduction a:nth-child(even) { border-bottom-color: #00d900; }
.abduction a:hover { border-bottom-color: #008c00; }
<div class="spaceship">
<div class="abduction">
Button 1
Button 2
Button 3
Button 4
Button 5
Button 6
</div>
</div>
So basically to create a 65px high trapezoid with borders (colored #0f0) you'd do this:
border-bottom: 65px solid #0f0;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
The width of the last element is 100px. So since the left border width + the right border width = 6px and 100px - 6px = 94px, the second to last element will have a width of 94px to match the top of the last element. You subtract the side border sum from the previous elements width to get the current element width.
Also the transition property needs to be changed to border-bottom-color instead of background because border-bottom-color is what sets the color of the trapezoid.
* { box-sizing: border-box; }
body { font: normal 16px sans-serif; }
.spaceship {
height: 430px;
position: relative;
width: 140px;
}
.spaceship::before {
background: #006dd9;
border-radius: 100%;
content: '';
height: 70px;
position: absolute;
width: 140px;
z-index: 1;
}
.abduction {
height: 370px;
left: 15px;
padding-top: 10px;
position: absolute;
top: 50px;
width: 110px;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 400px solid #0f0;
}
.abduction a {
color: #fff;
display: block;
height: 60px;
padding-top: 25px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: background 500ms;
}
.abduction a:nth-child(even) { background: #00d900; }
.abduction a:hover { background: #008c00; }
<div class="spaceship">
<div class="abduction">
Button 1
Button 2
Button 3
Button 4
Button 5
Button 6
</div>
</div>
I'm pretty sure you need javascript for that.
jQuery(document).ready(function(){
var buttons = [{name:'button'},{name:'button'},{name:'button'},{name:'button'},{name:'button'},{name:'button'}];
var b;
for(b in buttons){
var rev = buttons.length - (b*10);
var btn = jQuery(''+ buttons[b].name + ' ' + b +'').css({left:rev/2, width:100 - rev} );
jQuery('.abduction').append(btn);
}
});
* { box-sizing: border-box; }
body { font: normal 16px sans-serif; }
.spaceship {
height: 430px;
position: relative;
width: 140px;
}
.spaceship::before {
background: #006dd9;
border-radius: 100%;
content: '';
height: 70px;
position: absolute;
width: 140px;
z-index: 1;
}
.abduction {
height: 370px;
left: 20px;
padding-top: 10px;
position: absolute;
top: 60px;
width: 100px;
}
.abduction a {
display:block;
position:relative;
color: #fff;
display: block;
height: 60px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: background 500ms;
border-bottom:80px solid #0f0;
border-left:5px solid transparent;
border-right:5px solid transparent;
}
.abduction a:nth-child(even) { border-bottom: 80px solid #00d900; }
.abduction a:hover { border-bottom: 80px solid #008c00; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="spaceship">
<div class="abduction">
</div>
</div>
I'm making a webpage with a fixed footer. If there is a lot of content, there must be a scroll bar. If there is only one line of input in the content-part, there is no need to scroll. The way the page is made now, gives me a scroll bar all the time! It scrolls just as far so that the header disappears from the screen. --> My header is 150px high and I can scroll exactly 150px. But I don't want this. What is wrong with my html or CSS?
This is the html:
<body>
<div id="header">
<h1>The <span>ultimate</span><br />DVD collection</h1>
</div>
<div id="main_wrapper">
<div id="main">
<div id="choose">#abcdefghijklmnopqrstuvwxyz</div>
<div id="content">Main content comes here.</div>
</div>
</div>
<div id="footer">
<p>My Name <span>admin log-in</span>
</p>
</div>
Here's my CSS:
html, body {
height: 100%;
margin: 0 auto;
}
body {
font-family: Helvetica, Arial, sans-serif;
color: #666;
font-size: 12px;
line-height: 1.5em;
/*position: relative;*/
}
#header {
height: 150px;
background: linear-gradient(left, #2a2620, #a35e47);
border-top: 10px solid #f6e6c5;
border-bottom: 10px solid #f6e6c5;
background-color: #a35e47;
}
h1 {
width: 960px;
margin: 35px auto 0;
font-family:'Luckiest Guy', cursive;
font-size: 3.5em;
line-height: 1em;
text-transform: uppercase;
font-weight: 400;
color: #a35e47;
text-shadow: 0px 0px 2px #f6e6c5, 4px 4px 8px #000000;
}
h1 span {
font-family:'Aclonica', Verdana, sans-serif;
font-size: 1.75em;
}
#main_wrapper {
height: 100%;
min-height: 100%;
background-image: url('http://4.bp.blogspot.com/-jPxP0Hgum7o/T0OiL_IupqI/AAAAAAAAAMs/Xu5zNtqULoE/s1600/IMG_0665+Hollywood+star.jpg');
background-repeat: no-repeat;
background-position: 50% 60%;
background-color: #5a646d;
}
#main {
width: 960px;
height: 100%;
margin: 0 auto;
background-color: #fff;
opacity: .75;
/*overflow: auto;*/
}
#choose {
margin-left: 20px;
font-family: georgia, serif;
font-style: italic;
font-weight: bold;
text-transform: uppercase;
font-size: 1.5em;
line-height: 2em;
letter-spacing: 20px;
overflow: hidden;
}
#content {
margin-left: 20px;
margin-right: 20px;
}
#footer {
height: 40px;
width: 100%;
border-top: 10px solid #f6e6c5;
background: linear-gradient(left, #2a2620, #a35e47);
position: fixed;
left: 0;
bottom: 0;
}
You can also see my code in this jsFiddle.
What am I doing wrong? (look at the scroll bar in the picture)
Thanks in advance!
Remove height:100% on the main-wrapper. The height of 100% means 100% of the available space inside the parent (the header and the main-wrapper has the same parent). But the main-wrapper is not aware of the headers height. So the result will be 100% + 150px.
I have made a few adjustment in style.
I have given percentage height for your container(you can adjust them as per you need) and scroll property to div.
<style>
html, body {
height: 100%;
margin: 0 auto;
}
body {
font-family: Helvetica, Arial, sans-serif;
color: #666;
font-size: 12px;
line-height: 1.5em;
/*position: relative;*/
}
#header {
height: 15%px;
background: linear-gradient(left, #2a2620, #a35e47);
border-top: 10px solid #f6e6c5;
border-bottom: 10px solid #f6e6c5;
background-color: #a35e47;
}
h1 {
width: 960px;
margin: 35px auto 0;
font-family:'Luckiest Guy', cursive;
font-size: 3.5em;
line-height: 1em;
text-transform: uppercase;
font-weight: 400;
color: #a35e47;
text-shadow: 0px 0px 2px #f6e6c5, 4px 4px 8px #000000;
}
h1 span {
font-family:'Aclonica', Verdana, sans-serif;
font-size: 1.75em;
}
#main_wrapper {
/*height: 100%;*/
/*min-height: 100%;*/
background-image: url('http://4.bp.blogspot.com/-jPxP0Hgum7o/T0OiL_IupqI/AAAAAAAAAMs/Xu5zNtqULoE/s1600/IMG_0665+Hollywood+star.jpg');
background-repeat: no-repeat;
background-position: 50% 60%;
background-color: #5a646d;
}
#main {
width: 960px;
height: 70%;
margin: 0 auto;
background-color: #fff;
opacity: .75;
/*overflow: auto;*/
overflow:scroll;
}
#choose {
margin-left: 20px;
font-family: georgia, serif;
font-style: italic;
font-weight: bold;
text-transform: uppercase;
font-size: 1.5em;
line-height: 2em;
letter-spacing: 20px;
overflow: hidden;
}
#content {
margin-left: 20px;
margin-right: 20px;
}
#footer {
height: 15%;
width: 100%;
border-top: 10px solid #f6e6c5;
background: linear-gradient(left, #2a2620, #a35e47);
position: fixed;
left: 0;
bottom: 0;
}
</style>
I worked around it using this explanation: http://dorayme.netweaver.com.au/ciaran.html
My wrapper now has a position:absolute with top: and bottom: equal to the height of header and footer (+ height of borders)
#main_wrapper{
position: absolute;
top: 170px; /* header + bordertop + borderbottom */
bottom: 50px; /* footer + bordertop */
left: 0;
right: 0;
background-image: url('path/to/img.jpg');
background-repeat: no-repeat;
background-position: 50% 40%;
background-color: #5a646d;
}
Thx to Johan Sundén for pushing me into the right direction!!