CSS button will not align at center of div - html

I have this website with a showcase div, within the div I have a "Get Started" button. I am able to vertically align the button with the margin attribute. However I do not want to horizontally align the button with margin as this will lead to some trouble for me in the future, I've tried align: center; and align="center" but the button sticks to the left side of the showcase. How can I unstick this button and horizontally align it without having to use a margin attribute?
html,
body,
header {
position: absolute;
left: 0;
top: 0;
width: 100%;
margin: 0;
margin-top: 0;
margin: auto;
padding: 0;
}
h1 {
display: inline-block;
font-family: Trebuchet MS;
font-size: 75px;
letter-spacing: 3px;
margin: 10px 0px 0px 20px;
}
h2 {
display: inline-block;
flex-direction: row;
margin: 0px 0px 0px 50px;
font-family: Georgia;
}
.highlight {
color: #45d845;
}
.heading {
background-color: #d84545;
border-bottom: 5px solid black;
padding-top: 20px;
padding-bottom: 20px;
}
#comet {
font-size: 65px;
margin-left: 20px;
}
.showcase {
background: url('background1.jpeg');
border-bottom: 5px solid black;
height: 1000px;
width: 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
color: #cccccc;
}
.showcase h2 {
color: #fff;
margin-top: 170px;
font-size: 60px;
font-family: Verdana;
text-align: center;
text-shadow: 1px 3px #000;
}
#start {
align: center;
margin-top: 130px;
background-color: transparent;
color: #fff;
padding: 20px 30px 20px 30px;
text-align: center;
font-family: Helvetica;
font-weight: bold;
border-radius: 10px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
}
#start:hover {
cursor: pointer;
background-color: #fff;
color: #000;
}
<header>
<div class="heading">
<h1>ThumbTac <span id="comet">☄</span> </h1>
</div>
</header>
<div class="showcase">
<h2>He moonlight difficult engrossed an it sportsmen. Interested has all devonshire difficulty jay assistance joy. Unaffected at ye </h2>
<button id="start" align="center">Get Started</button>
</div>

You can wrap your button in a div with the style text-align: center; to horizontally center your button. Example:
html, body, header{
position:absolute;
left:0;
top:0;
width: 100%;
margin: 0;
margin-top: 0;
margin: auto;
padding: 0;
}
/*Heading*/
h1{
display: inline-block;
font-family: Trebuchet MS;
font-size: 75px;
letter-spacing: 3px;
margin: 10px 0px 0px 20px;
}
h2{
display: inline-block;
flex-direction: row;
margin: 0px 0px 0px 50px;
font-family: Georgia;
}
.highlight{
color: #45d845;
}
.heading{
background-color: #d84545;
border-bottom: 5px solid black;
padding-top: 20px;
padding-bottom: 20px;
}
#comet{
font-size: 65px;
margin-left: 20px;
}
/*Showcase*/
.showcase{
background: url('background1.jpeg');
border-bottom: 5px solid black;
height: 1000px;
width: 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
color: #cccccc;
}
.showcase h2{
color: #fff;
margin-top: 170px;
font-size: 60px;
font-family: Verndana;
text-align: center;
text-shadow: 1px 3px #000;
}
#start{
align: center;
margin-top: 130px;
background-color: transparent;
color: #fff;
padding: 20px 30px 20px 30px;
text-align: center;
font-family: Helvetica;
font-weight: bold;
border-radius: 10px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
}
#start:hover{
cursor: pointer;
background-color: #fff;
color: #000;
}
<header>
<div class="heading">
<h1>ThumbTac <span id="comet">☄</span> </h1>
</div>
</header>
<div class="showcase">
<h2>He moonlight difficult engrossed an it sportsmen.
Interested has all devonshire difficulty jay
assistance joy. Unaffected at ye </h2>
<div style="text-align: center;">
<button id="start">Get Started</button>
</div>
</div>

You can consider using a flexbox. Documentation in the CSS source.
/* Global Sets */
html,
body,
header {
position: absolute;
left: 0;
top: 0;
width: 100%;
margin: 0;
margin-top: 0;
margin: auto;
padding: 0;
}
/*Heading*/
h1 {
display: inline-block;
font-family: Trebuchet MS;
font-size: 75px;
letter-spacing: 3px;
margin: 10px 0px 0px 20px;
}
h2 {
display: inline-block;
flex-direction: row;
margin: 0px 0px 0px 50px;
font-family: Georgia;
}
.highlight {
color: #45d845;
}
.heading {
background-color: #d84545;
border-bottom: 5px solid black;
padding-top: 20px;
padding-bottom: 20px;
}
#comet {
font-size: 65px;
margin-left: 20px;
}
/*Showcase*/
.showcase {
background: url('background1.jpeg');
border-bottom: 5px solid black;
height: 1000px;
width: 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
color: #cccccc;
display: flex; /* Added */
flex-direction: column; /* Added */
align-items: center; /* Added, horizonal alignment */
}
.showcase h2 {
color: #fff;
margin-top: 170px;
font-size: 60px;
font-family: Verndana;
text-shadow: 1px 3px #000;
text-align: center;
}
#start {
/* align: center; Not valid CSS */
margin-top: 130px;
background-color: transparent;
color: #fff;
padding: 20px 30px 20px 30px;
/* text-align: center; No longer required */
font-family: Helvetica;
font-weight: bold;
border-radius: 10px;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.4s;
}
#start:hover {
cursor: pointer;
background-color: #fff;
color: #000;
}
<header>
<div class="heading">
<h1>ThumbTac <span id="comet">☄</span> </h1>
</div>
</header>
<div class="showcase">
<h2>He moonlight difficult engrossed an it sportsmen. Interested has all devonshire difficulty jay assistance joy. Unaffected at ye </h2>
<button id="start" align="center">Get Started</button>
</div>

Related

Why is the <div> element not filling the rest of the screen wen I use height: 100%;

I am making a sidebar for my site and I want the side bar to fill the rest of the screen but also scroll separate to the right of the screen when it overflows with other elements inside. When I use 100% for the height the element only goes to the height of the last element inside of it.
I am trying to get it to fill the rest of the screen as I stated previously but it only goes to not all the way.
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.main {
margin-left: 345px;
border: 0px solid #ffffff;
padding: 0px 0px;
flex-direction: column;
align-content: center;
text-align: center;
width: 450px;
}
.card {
display: inline-block;
width: 400px;
height: 160px;
background-color: #404040;
border: 1px solid #404040;
border-radius: 4px;
margin: 0px;
margin-top: 20px;
text-decoration: none;
}
.toptext {
display: inline-block;
width: 400px;
height: 45px;
color: #ffffff;
background-color: #ffffff;
border: 1px solid #ffffff;
border-radius: 4px;
margin: 0px;
margin-top: 5px;
text-decoration: none;
text-align: left;
}
.toptext h1 {
font-size: 20px;
margin-left: 0px;
margin-top: 1px;
color: #404040;
}
.toptext p {
font-size: 12px;
margin-left: 0px;
margin-top: -10px;
color: #404040;
}
.flexcolumn {
flex-direction: column;
}
.leftmain {
height: 100%;
width: 325px;
padding: 0px 10px;
flex-direction: column;
align-content: center;
background-color: #333333;
overflow: scroll;
}
.leftmain p {
float: left;
color: #ffffff;
text-align: left;
padding: 0px 10px;
text-decoration: none;
font-size: 12px;
line-height: 25px;
border-radius: 4px;
background-color: #333333;
width: 300px;
}
.leftmain p:hover {
background-color: #404040;
color: #ffffff;
}
.header {
overflow: hidden;
background-color: #404040;
padding: 10px 10px;
height: 36px;
text-align: center;
}
.header-right {
float: right;
padding: 0px 0px;
}
.header a {
float: left;
color: #ffffff;
text-align: center;
padding: 5px 10px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
align-content: center;
}
.header a:hover {
background-color: #333333;
color: #ffffff;
}
<div class="header">
📄 My Paper Company
<div class="header-right">
Settings
Contact
Donate
<div class="flexcolumn">
</div>
</div>
</div>
<div id="leftmain" class="leftmain">
<p id="button" div="leftmain" onclick='show("htpmain")'>📢 How To Play</p>
</div>
<center>
<div id=htpmain class="main">
<div class="toptext">
<h1>
📢 How To Play
</h1>
<p>This guide will get you start the game and will be helpful to grasp everything you need to do.
</p>
</div>
<div class="card" />
</div>
</center>
Your leftmain IS taking up 100% of the space available to it, leftmain stops when it reaches . You have leftmain set to flex-direction: column;
when only the .main should have it. Also don't use the tag, it is no longer supported in HTML5 and is display: block; when it should be inline-block.
I would change just to and set display to inline-block and set a width so the leftmain has room to go past it.
I hope this solves your problem.
.leftmain {
height: 100%;
width: 325px;
padding: 0px 10px;
align-content: center;
background-color: #333333;
overflow: scroll;
}
#nameOfCenterDiv {
position: absolute;
left: 300px;
display: inline-block;
}
Give to the sidebar a position fixed so it always stays there wherever you scroll and and a margin-left to your content on the right (the width of the margin-left must be the same of sidebar width)
.leftmain{
position: fixed
}
.main{
margin-left: 345px;
width: 450px //remove this so it's 100%
}
You have to wrap the left sidebar and right panel within the same container.
Using the display: flex on the container, you no longer need to specify a 100% height for the left sidebar since it will automatically fill in the remaining space.
You also need to remove the margin-left rule for the right content so that it lays nicely with the sidebar.
You can optionally set a max-height of 100vh to the sidebar so that it scrolls when its content exceeds the viewport height.
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.main {
border: 0px solid #ffffff;
padding: 0px 0px;
flex-direction: column;
align-content: center;
text-align: center;
width: 450px;
}
.card {
display: inline-block;
width: 400px;
height: 160px;
background-color: #404040;
border: 1px solid #404040;
border-radius: 4px;
margin: 0px;
margin-top: 20px;
text-decoration: none;
}
.toptext {
display: inline-block;
width: 400px;
height: 45px;
color: #ffffff;
background-color: #ffffff;
border: 1px solid #ffffff;
border-radius: 4px;
margin: 0px;
margin-top: 5px;
text-decoration: none;
text-align: left;
}
.toptext h1 {
font-size: 20px;
margin-left: 0px;
margin-top: 1px;
color: #404040;
}
.toptext p {
font-size: 12px;
margin-left: 0px;
margin-top: -10px;
color: #404040;
}
.flexcolumn {
flex-direction: column;
}
.container {
display: flex;
}
.leftmain {
width: 325px;
padding: 0px 10px;
flex-direction: column;
align-content: center;
background-color: #333333;
overflow: scroll;
}
.leftmain p {
float: left;
color: #ffffff;
text-align: left;
padding: 0px 10px;
text-decoration: none;
font-size: 12px;
line-height: 25px;
border-radius: 4px;
background-color: #333333;
width: 300px;
}
.leftmain p:hover {
background-color: #404040;
color: #ffffff;
}
.header {
overflow: hidden;
background-color: #404040;
padding: 10px 10px;
height: 36px;
text-align: center;
}
.header-right {
float: right;
padding: 0px 0px;
}
.header a {
float: left;
color: #ffffff;
text-align: center;
padding: 5px 10px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
align-content: center;
}
.header a:hover {
background-color: #333333;
color: #ffffff;
}
<div class="header">
📄 My Paper Company
<div class="header-right">
Settings
Contact
Donate
<div class="flexcolumn">
</div>
</div>
</div>
<div class="container">
<div id="leftmain" class="leftmain">
<p id="button" div="leftmain" onclick='show("htpmain")'>📢 How To Play</p>
</div>
<center>
<div id=htpmain class="main">
<div class="toptext">
<h1>
📢 How To Play
</h1>
<p>This guide will get you start the game and will be helpful to grasp everything you need to do.
</p>
</div>
<div class="card" />
</div>
</center>
</div>

How to make whole Div hoverable

I am trying to make somethng like that:enter image description here
Image from the left I have done without botton-right cut, I have made border-radius.
Image from the right is what happens when you hover on whole item. AS you can see only middle is highlighted. Any idea how to fix it?
Here is my Code:
HTML:
<div class="pojemnik" onclick="location.href='nitystandardowe.html'" >
<div class="zdjecie"> <img src="img/nitystandardowe.jpg"> </div>
<div class="tekst_"><h5>Nity Standardowe</h5> </div>
</div>
CSS:
.pojemnik{
display: flex;
width: 190px;
height: 170px;
background-color: #f5f7f6;
flex-wrap: wrap;
flex-direction: column;
color: silver;
font-family: sans-serif;
text-decoration: none;
border-bottom-right-radius: 30px;
}
.pojemnik:hover {
text-decoration: none;
cursor: pointer;
width: 190px;
height: 190px;
background-position:bottom;
background-image: url("../images/icons/strzalka-w-praw-tlo.png");
background-repeat: no-repeat;
bottom: 20px;
}
.tekst_ {
border-bottom: solid 2px white;
padding-left: 10px;
}
.tekst_:hover {
border-bottom: solid 2px blue;
background-color:#00a2fa;
border-bottom: solid 1px white;
color: white;
}
.tekst_ h5{
font-family: sans-serif;
font-size: 15px;
margin-top: 5px;
margin-left: 5px;
}
.tekst_ h5:hover{
font-family: sans-serif;
font-size: 15px;
margin-top: 5px;
margin-left: 5px;
color: white;
}
.zdjecie{
align-self: flex-start;
}
.zdjecie img{
position: relative;
width: 190px;
}
You need to specify that you also need to target the .tekst_ class upon hover of .pojemnik like so:
.pojemnik:hover .tekst_ {
border-bottom: solid 2px blue;
background-color:#00a2fa;
border-bottom: solid 1px white;
color: white;
}
.pojemnik{
display: flex;
width: 190px;
height: 170px;
background-color: #f5f7f6;
/* flex-wrap: wrap; */
flex-direction: column;
color: silver;
font-family: sans-serif;
text-decoration: none;
border-bottom-right-radius: 30px;
}
.pojemnik:hover {
text-decoration: none;
cursor: pointer;
width: 190px;
height: 190px;
background-position:bottom;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAUVBMVEX///8AAAD7+/s7OzusrKze3t7Z2dmvr6/b29tVVVUFBQVdXV34+Pjt7e0SEhKUlJRCQkLl5eXy8vJzc3NlZWXLy8tra2u9vb1KSkp5eXmZmZlkbd6rAAACfElEQVR4nO2di27aQBBFbWhSYhzCK03T///QVkhR0mAjEyBrn3vOB6C5mjs7uwvLVJWIiIiIiIiIiIiIiIiIiIjIG+1mWzqEW7LYNfU/9s+lA7kRs9f6jeVj6WBuQTuv31ndlQ7nBqzr/+BJ/FN/4r50RFdmu/qssF6Ujum6/DwSSDPqrkMhK4vLLoWoWnzoVEgy6q9uhSCJTz0KOUa971PIkdi91JCMuulViGkaL/0SKUb9wc/iCYmUWuzanOZkMaAWA4waIDHAqAESA4xq05gMARs4mwaB7FoMMCpFYrZRKU0juxYDsmgtToaApuEGjkB206BIzDYqpWlk12JAFgNqMcCoARIDjBogMcCoNo3JELCBs2kQyK7FAKNSJGYb1abRw2xsXDeLm6f9ej42fvcrPLcW29cTnzVSzsri5vjl3AQ4oxYfm9LBfolm+FvinkdXo+dhqMAT7yBGzgs8hXW9HCawLR3nBbSDFN6VDvMChi2nz6XDvIBh/z7BzyG/DvlraUA/nGwSB+9pAval/LPFNM+H515k0M/4B0pfyxzBv23DXwr3Z7BhZBB/5x1sUbzABm9RxiKTXIOMDCa3CXwG6TUI2arhfyqU3CbwAvEWZSwyyRbFZxBfg3iL0gXyT/R4gXSL8gXiLYpv9HiL4jOIr0G8RekC+Vs1xiKTXIOMDCa3CXwG6TXoly/TILlN4AXiLcpYZJItysggft7TiZldDIvy564t4BZNmH/In2HJn0PKnyXLnwfMn+nMn8vNn61eVWuyRQ+08w/6VkCBVTV7f6m6POMN76RY7A6PqvfD/u1horSbbekQRERERERERERERERERERE5Jv4CxOfKflP0w6QAAAAAElFTkSuQmCC");
background-size: 20px 20px;
background-repeat: no-repeat;
bottom: 20px;
}
.tekst_ {
border-bottom: solid 2px white;
padding-left: 10px;
}
/* .tekst_:hover {
border-bottom: solid 2px blue;
background-color:#00a2fa;
border-bottom: solid 1px white;
color: white;
} */
.pojemnik:hover .tekst_ {
border-bottom: solid 2px blue;
background-color:#00a2fa;
border-bottom: solid 1px white;
color: white;
}
.tekst_ h5{
font-family: sans-serif;
font-size: 15px;
margin-top: 5px;
margin-left: 5px;
}
/* .tekst_ h5:hover{
font-family: sans-serif;
font-size: 15px;
margin-top: 5px;
margin-left: 5px;
color: white;
} */
.zdjecie{
align-self: flex-start;
}
.zdjecie img{
position: relative;
width: 190px;
}
<div class="pojemnik" onclick="location.href='nitystandardowe.html'" >
<div class="zdjecie"> <img src="https://cdn.pixabay.com/photo/2020/11/17/15/44/cup-5752775__340.jpg"> </div>
<div class="tekst_"><h5>Nity Standardowe</h5> </div>
</div>

Fine tune a css element :hover area

I have a little tab coming out of a box, and for some reason applying a hover on that tab is very buggy and the actual hovering area is way above it. What is causing that and how can i fix it?
JSFiddle: https://jsfiddle.net/nmr4wu2z/
body {
background-color: #F5F5F5;
font-family: 'Open Sans Condensed', sans-serif;
width: 90%;
margin: 0 auto;
}
.logo {
height: 250px;
width: 250px;
background-color: #FF7148;
margin-top: 5%;
margin-left: 5%;
font-family: 'Open Sans Condensed', sans-serif;
font-weight: 300;
z-index: -1;
box-shadow: 1px 1px 1px black;
}
.contact {
height: 70px;
width: 280px;
position: relative;
background-color: #FF7148;
box-shadow: 1px 1px 1px black;
top: -150%;
z-index: -2;
transition: all 0.5s ease;
}
.contact:hover {
margin-left: 80%;
}
.contactText {
margin-right: -15.5em;
text-align: center;
transform: rotate(90deg);
font-family: 'Open Sans Condensed', sans-serif;
color: white;
padding-top: 40px;
}
.contactEmail {
color: white;
margin-top: -3.4em;
text-align: center;
padding-left: 5px;
}
.logoText {
color: #F5F5F5;
text-align: right;
padding: 170px 10px;
}
<!-- use <header>, <nav>, <article>, <section>, <aside>, and <footer> -->
<header>
<div class="logo">
<h3 class="logoText"> Name <br> &nbsp &nbsp A Blog </h3>
<div class="contact">
<h3 class="contactText"> Contact </h3>
<h3 class="contactEmail"> Example#blabla.com </h3>
</div>
</div>
You have to make some changes
body {
background-color: #f5f5f5;
font-family: "Open Sans Condensed",sans-serif;
margin: 0 auto;
width: 90%;
}
.logo {
background-color: #ff7148;
box-shadow: 1px 1px 1px black;
font-family: "Open Sans Condensed",sans-serif;
font-weight: 300;
height: 250px;
margin-left: 5%;
margin-top: 5%;
position: relative;
width: 250px;
}
.contact {
background-color: #ff7148;
box-shadow: 1px 1px 1px black;
height: 105px;
position: absolute;
top: 30px;
transition: all 0.5s ease 0s;
width: 280px;
cursor: pointer;
}
.contact:hover {
margin-left: 85%;
}
.contactText {
color: white;
font-family: "Open Sans Condensed",sans-serif;
/* margin-right: -15.5em; */
/* padding-top: 40px; */
text-align: center;
transform: rotate(90deg);
transform-origin: 192px 85px 0;
}
.contactEmail {
color: white;
margin-top: -1.1em;
padding-left: 5px;
text-align: center;
}
.logoText {
background: #ff7148 none repeat scroll 0 0;
color: #f5f5f5;
padding: 170px 10px 35px;
position: relative;
text-align: right;
z-index: 1;
}
<header>
<div class="logo">
<h3 class="logoText"> Name <br> &nbsp &nbsp A Blog </h3>
<div class="contact">
<h3 class="contactText"> Contact </h3>
<h3 class="contactEmail"> Example#blabla.com </h3>
</div>
</div>
in with your style like I do in below snippet -
While the answer above triggers the hover for .contact, it's still buggy when you hover above the square.
In this jsfiddle I changed the approach a bit. Take .contact out of .logo (as it doesn't make logical sense) and apply float: left to both. Instead of overlaying them and adjusting the margin to make .contact move left, I start with a lower width and overflow: hidden; on contact, and increase the width on hover.

Cross-browser legend centering

I'm getting different results on my legend centering across browsers:
Should be like this:
But instead I get different margins on other browsers:
HTML
<div class="teaser-header">
<fieldset class="teaser-fieldset">
<legend class="teaser-legend">We are a very passionate team</legend>
<h1>Who we are</h1>
</fieldset>
</div>
CSS
.teaser-header {
padding-top: 70px;
}
.teaser-fieldset {
border: 1px solid white;
color: white;
text-align: center;
width: 400px;
margin: auto;
}
.teaser-fieldset h1 {
color: white;
text-align: center;
margin: 0;
padding-bottom: 20px;
font-family: "Montserrat";
}
.teaser-legend {
padding: 0 10px;
width: 80%;
margin-left: auto;
margin-right: auto;
color: white;
font-size: 1em;
text-transform: uppercase;
margin-bottom: 0;
}
Any ideas? Thanks!
Setting the margin-left and margin-right explicitly as 10% seems to fix the centering issue. The 10% value is nothing but half of (100% - width).
.teaser-header {
padding-top: 70px;
}
.teaser-fieldset {
border: 1px solid white;
color: white;
text-align: center;
width: 400px;
margin: auto;
}
.teaser-fieldset h1 {
color: white;
text-align: center;
margin: 0;
padding-bottom: 20px;
font-family: "Montserrat";
}
.teaser-legend {
/* padding: 0 10px; remove this */
width: 80%;
margin-left: 10%; /* change this */
margin-right: 10%; /* change this */
color: white;
font-size: 1em;
text-transform: uppercase;
margin-bottom: 0;
text-align: center; /* add this */
}
body {
background: black;
}
<div class="teaser-header">
<fieldset class="teaser-fieldset">
<legend class="teaser-legend">We are a very passionate team</legend>
<h1>Who we are</h1>
</fieldset>
</div>

Margin collapse after relative positioned div

Short story: my footer doesn't react to margin-top, i've tried many various way (well it actualy works on very big numbers, which shows that margin is led from previous element, the image container).Here's the code:
HTML (i've removed content obiviously, and didn't attach head section, which is before content):
<div id="content">
<h1 id="top">header</h1>
<div id="billboard">
<div id="buttony">
buttons
</div>
</div>
<div class="pasek">
</div>
<h2 class="naglowek">Najnowsze prace:</h2>
<div class="photo"><div class="heading"><span>text</span></div><img src="img/thumb1.jpg" alt="smu"/><div class="caption"><span>text</span></div></div>
<div class="photo"><div class="heading"><span>text</span></div><img src="img/thumb2.jpg" alt="smu"/><div class="caption"><span>text</span></div></div>
<div class="photo"><div class="heading"><span>text</span></div><img src="img/thumb3.jpg" alt="smu"/><div class="caption"><span>text</span></div></div>
</div>
<div id="footer">
<div id="footerwrap">
<div class="footerblock"><h3 id="nav">header</h3>
<ol>
<li>link</li>
<li>link</li>
<li>link</li>
<li>link</li>
</ol>
</div>
<div class="footerblock"><h3 id="info">header</h3><p>some content </p>
</div>
<div class="footerblock"><h3 id="plus">header</h3>
<p class="links"><a target="_blank" href="http://www.smashingmagazine.com">Smashing Magazine</a></p>
<p class="links"><a target="_blank" href="http://www.w3schools.com">W3 Schools</a></p>
<p class="links"><a target="_blank" href="http://www.w3.org">W3 Consortium</a></p>
</div>
</div>
</div>
Here's the CSS part:
div#content{
width: 960px;
margin: 0 auto;
}
div#content h1#top{
font-family: Arial, Helvetica, sans-serif;
font-weight: 900;
font-size: 56px;
text-align: center;
color: #333333;
padding: 0 0 10px;
margin: 20px auto;
border-bottom: 4px #d4d4d4 dashed;
}
div#content h1#top span{
color: #c24b4b;
}
div#content div.pasek{
width: 960px;
height: 30px;
background-image: url('img/pasek.jpg');
margin: 10px 0;
}
div#content div#billboard{
width: 960px;
height: 500px;
background-color: #ffffff;
background-image: url('img/bb.jpg');
background-repeat: no-repeat;
}
div#content div#billboard img{
max-width: 100%;
max-height: 100%;
}
div#content div#billboard a:first-of-type{
margin-right: 40px;
}
div#content div#billboard div#buttony{
width: 565px;
position: relative;
top: 380px;
left: 321px;
}
div#content h2.naglowek{
font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
font-size: 36px;
color: #191a1c;
padding: 5px 55px;
margin: 20px auto;
border-bottom: 2px #d4d4d4 dashed;
background: url('img/tools.jpg') no-repeat;
}
/* jQuery podpisy*/
div.photo{
margin: 0 7px 7px;
position: relative;
overflow: hidden;
float: left;
width: 292px;
height: 292px;
border: 4px #212226 solid;
}
div.photo div.heading, div.photo div.caption {
position: absolute;
background-color: #0e0e0f;
height: 30px;
width: 300px;
color: white;
text-align: center;
opacity:0.8;
filter:alpha(opacity=80);
-moz-opacity:0.8;
-khtml-opacity: 0.8;
}
div.photo div.heading{
padding-top: 10px;
top: -40px;
}
div.photo div.heading span{
font-size: 20px;
display: block;
margin-top: -2px;
}
div.photo div.caption{
padding-top: 10px;
bottom: -40px;
}
div.photo div.caption span{
color: #d3d3d3;
font-size: 11px;
display: block;
padding: 0 10px;
}
/* jQuery podpisy koniec*/
/* CONTENT END*/
/* FOOTER */
div#footer{
clear: both;
margin-top: 60px;
color: #636363;
font-size: 14px;
height: 300px;
background-color: #131415;
background-image: url('img/pasek2.jpg');
background-repeat: repeat-x;
}
div#footer div#footerwrap{
width: 960px;
margin: 0 auto;
}
div#footer div.footerblock{
float: left;
width: 320px;
margin-top: 40px;
}
div.footerblock h3{
font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
letter-spacing: 0.1em;
text-align: center;
font-size: 24px;
color: white;
padding-top: 15px;
height: 39px;
}
div.footerblock h3#nav{
background: url('img/world.jpg') no-repeat 25px;
}
div.footerblock h3#info{
background: url('img/info.jpg') no-repeat 25px;
}
div.footerblock h3#plus{
background: url('img/chat.jpg') no-repeat 25px;
}
div.footerblock li{
font-size: 18px;
padding: 15px 0 10px 40px;
margin: 0 20px;
background: url('img/flash.jpg') no-repeat 10px;
border-bottom: 1px white solid;
}
div.footerblock a:hover{
color: #808080;
}
div.footerblock p{
margin: 20px;
line-height: 20px;
}
div.footerblock p.links{
background: url('img/cloud.jpg') no-repeat 10px 0;
margin: 17px 20px;
}
div.footerblock p a{
font-size: 16px;
color: #636363;
padding-left: 45px;
padding-bottom: 6px;
display: block;
border-bottom: 1px #636363 solid;
}
Wasn't sure which parts of css to drop since as long as suspected parts changes didn't work for me it could be anything i guess. If it's too much please tell i'll drop unnecessary parts.
Here is what you need to do.
Put all the div.photo divs in a one display-block container with height specified. See here http://jsfiddle.net/pXRj3/