trouble fitting my css fit all sizes of computer screens - html

I made a website on my computer but then when I loaded it on my laptop I noticed the sizing was off on everything. However, it still looks fine on my computer. I know this may be a good lesson learned in css, but in the time being do you think any of you could take a look at my css file?
#cool_animate {
border-top: 10px solid gray;
border-bottom: 4px solid gray;
height: 195px;
background: url(images/scape.png) repeat-x;
-webkit-animation: move-city 15s infinite linear;
}
#-webkit-keyframes move-city {
0% { background-position: 0 0;}
100% { background-position: -256px 0;}
}
#boat {
height: 239px;
position: absolute;
top: -10px;
left: 200px;
-webkit-animation: wind 300s infinite linear;
}
#-webkit-keyframes wind {
from { left: 400px}
to { left: 1400px}
}
#-webkit-keyframes cloud {
from { left: 260px}
to { left: 280px}
}
#cloud {
height: 90px;
position: absolute;
top: 28px;
left: 300px;
-webkit-animation: cloud 9s infinite alternate linear;
}
#copter {
height: 90px;
position: absolute;
top: 28px;
left: 1700px;
-webkit-animation: copter 15s infinite alternate linear;
}
#-webkit-keyframes copter {
from { left: 1700px}
to { left: 1600px}
}
header {
font-size: 22px;
color: white;
background: linear-gradient(#C7E2EE, #0099CC);
font-family: 'Lobster', cursive;
box-shadow: 5px 5px 3px 4px gray;
border-radius: 10px; /* this makes it rounded */
padding: 40px 40px;
border: 1px black solid;
border-width: 1px 1px 1px 1px;
border-color: black;
margin: 50px 470px;
margin-bottom:0px;
height: 200px;
}
img.right {
position: relative;
top: -16px;
right: -200px;
}
#inside_p {
display:inline;
}
#cool_nav {
margin: 190px 160px 40px 140px;
font-family: 'Lobster', cursive;
color: black;
position: absolute;
z-index: 7;
left: 0;
width: 204px;
top: 72px;
font-size: 24px;
line-height: 1.2;
}
#facts_nav {
background-color: rgb(211, 211, 211);
margin: 700px 160px 40px 180px;
color: black;
position: absolute;
z-index: 7;
left: 0;
width: 204px;
top: 72px;
font-size: 17px;
line-height: 1.2;
border: 1px black solid;
border-width: 1px 1px 1px 1px;
border-color: black;
border-radius: 10px;
padding: 26px 20px;
}
body {
background: linear-gradient(#69D1FF, white);
}
#cool_nav p {
background-color: #30C722;
border-radius: 7px;
}
#cool_nav p:hover {
background-color: #3DB0E6;
color: #ffffff;
width: 160px;
border-radius: 30px;
}
ul {
list-style-type: none;
}
#example li:hover {
background-color: #82C0DB;
}
#toot li:hover {
background-color: #82C0DB;
}
#intro li:hover {
background-color: #82C0DB;
}
#main_content {
font-size: 0px;
color: black;
background-color: rgb(255, 209, 124);
font-family: 'Lobster', cursive;
border-radius: 10px; /* this makes it rounded */
padding: 1px 40px;
border: .5px black solid;
border-width: 1px 1px 1px 1px;
border-color: black;
margin: 50px 470px;
margin-top:.5px;
margin-bottom: 0;
height: 400px;
}
#cool_div {
font-size: 19px;
color: white;
background-color: rgb(255, 113, 255);
font-family: 'Lobster', cursive;
box-shadow: 5px 5px 3px 4px #999;
border-radius: 10px; /* this makes it rounded */
padding: 1px 40px;
border: .5px black solid;
border-width: 1px 1px 1px 1px;
border-color: black;
margin: 50px 470px;
margin-top: 0px;
height: 200px;
margin-bottom: 0
}
#fun_times:hover {
content: url('images/batman.jpg');
height: 140px;
width: 150px;
}
#cool_footer {
font-size: 22px;
color: white;
background-color: rgb(74, 255, 74);
font-family: 'Lobster', cursive;
box-shadow: 5px 5px 3px 4px #999;
border-radius: 10px; /* this makes it rounded */
padding: 1px 40px;
border: .5px black solid;
border-width: 1px 1px 1px 1px;
border-color: black;
margin: 50px 470px;
margin-top: 0px;
top-margin: 0px;
height: 200px;
}
a:link {
-webkit-transition: .2s;
transition: .2s;
}
a:hover {
color: hsl(209, 100%, 32%);
}
.btn {
-moz-box-shadow:inset 0px 1px 0px 0px #ffe0b5;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffe0b5;
box-shadow:inset 0px 1px 0px 0px #ffe0b5;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #fbb450), color-stop(1, #f89306));
background:-moz-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:-webkit-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:-o-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:-ms-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:linear-gradient(to bottom, #fbb450 5%, #f89306 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89306',GradientType=0);
background-color:#fbb450;
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
border:1px solid #c97e1c;
display:inline-block;
color:#ffffff;
font-family:Trebuchet MS;
font-size:17px;
font-weight:bold;
padding:6px 11px;
text-decoration:none;
text-shadow:0px 1px 0px #8f7f24;
}
.btn:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f89306), color-stop(1, #fbb450));
background:-moz-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:-webkit-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:-o-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:-ms-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:linear-gradient(to bottom, #f89306 5%, #fbb450 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f89306', endColorstr='#fbb450',GradientType=0);
background-color:#f89306;
}
.btn:active {
position:relative;
top:1px;
}
}
not sure if it matters really but here is my html file also
<!DOCTYPE html>
<html>
<!-- this is the start of my head -->
<head>
<title>Rails Tutorial</title>
<!-- js and css sheets -->
<script src="cool.js"></script>
<script src="jquery.js"></script>
<link href="cool.css" rel="stylesheet">
<link href="animate.css" rel="stylesheet">
<!-- my favicon for top of page -->
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon" title="A super fun rails tutorial">
<!--[if lt IE 9]>
<script src="dist/html5shiv.js"></script>
<![endif]-->
<!-- HEADER -->
<div>
<h1 id="cool_animate"></h1>
<img src="images/cool.png" id="boat">
<img src="images/cloud.png" id="cloud">
<img src="images/copter.png" id="copter">
</div>
</head>
<!-- this is the end of my head -->
<body>
<!-- this is the start of my header -->
<header class="animated swing">
<div <div style="width:200px; float:left;">
<img src="images/study.png " width="140" height="120" title="LEARNING IS FUN!">
</div>
<h1 id="cool_h1">Welcome aboard!</h1>
<p>This is a simple tutorial site to help you learn and get more confortable with programming in Rails. I made this for people who are just getting started and are considering learning how to program.</p>
</header>
<!-- this is the end of my header -->
<!-- this is the start of my link nav -->
<nav id="cool_nav" class="animated tada">
<ul>
<li id="toot">
<p>tutorial</p>
<ul>
<li>level one</li>
<li>level two</li>
<li>level three</li>
</ul>
</li>
<li id="intro">
<p>Introduction</p>
<ul>
<li>about Ruby</li>
<li>about Rails</li>
<li>about Erb</li>
</ul>
</li>
<li id="example">
<p>Examples</p>
<ul>
<li>example 1</li>
<li>example 2</li>
<li>example 3</li>
</ul>
</li>
</ul>
</nav>
<!-- this is the end of my nav -->
<!-- this is the start of fun facts nav -->
<nav id="facts_nav">
<code>
<p>what does MVC stand for?</p>
<p>many view controller</p>
<p>model view controller</p>
<p>method via controller</p>
<button>show answer</button>
<div style="display: none">
<p>model view controller</p>
</div>
</code>
</nav>
<script>
$( "button" ).click(function() {
$( "div" ).show( "slow" );
});
</script>
<!-- this is the end of my fun facts nav -->
<!-- this is the start of my main section -->
<section id="main_content" class="animated shake">
<button id="go" class="btn">Table of contents</button>
<div id="block">
<h1>1: Tutorial</h1>
<p>The rails tutorial that I made has 3 levels and each level has its own set of challenges.</p>
<h2>2: Introduction</h2>
<p>this introduction will tell you about ruby a programming language, rails the
platform that is build off of ruby, and about Embedded Ruby in our html.</p>
<h2>3: Examles</h2>
<p>Here I will give you three examples of working rails programs that I built.</p>
</div>
</section>
<!-- this is the end of my main section -->
<script>
$( "#go" ).click(function() {
$( "#block" ).animate({
// width: "70%",
// opacity: 0.4,
marginLeft: "30px",
fontSize: "17px",
borderWidth: "4px"
}, 1500 );
});
</script>
<!-- this is the start of cool div -->
<div id="cool_div">
<div>
<p></p>
</div>
<div <div style="width:200px; float:left;">
<a href="http://cheatermoves.github.io/" id="fun_times">
<img src="images/me.jpg" width="150" height="140">
</a>
</div>
<div style="width:400px; float:left;">
<p class="speech">Click on my photo to view my website or follow me on twitter. Always looking forward to sharing new tweets.</p>
</div>
<div style="width:150px; float:right;">
<a href="https://twitter.com/lanners_cool">
<img src="https://si0.twimg.com/profile_images/2284174758/v65oai7fxn47qv9nectx.png" width="140" height="120">
</a>
</div>
</div>
<!-- this is the end of cool div -->
<!-- this is the start of cool footer -->
<footer id="cool_footer">
<p>Here are some helpful links to help you learn rails</p>
<ul>
<li><small>Hartl tutorial</small</li>
<li><small>Getting started with rails</small></li>
<li><small>Rails Casts intro video</small></li>
</ul>
</footer>
<!-- this is the end of cool footer -->
</body>
</html>

The problem is related to your sizing of elements.
Set your widths and heights to percentages. As well as your "left" and "top". That way, your layout becomes responsive.
Set your font-sizes to ems. For example:
font: 1em helvetica, arial, sans-serif;

Related

How can I add an Image in Messenger Chat?

In my chat, I would like to have a text message displayed in the balloon for one button and an image from my gallery for the other button. The programming for the text works. How do I get this with the picture?
My HTML Code is this one:
<!DOCTYPE html>
<link rel="stylesheet" href="style.css">
<div class="Webview">
<div class="message_container" id="myForm" >
<div class="Chat_Bubble"></div>
</div>
<form class="send_container">
<input id="textField" type="text">
<img id="Bildverschicken" src="baseline_image_black_18dp.png">
<p>
<input type ="button" id="theButton" value="Nachricht absenden!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].textContent=document.getElementById('textField').value"/>
</p>
<input type="button" id="Button_Bilder" value="Bild verschicken!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].imageContent=document.getElementById('Bildverschicken').value"/>
<h3><div id="div"></div></h3>
</form>
</div>
Can someone help me? Thanks!
#charset "UTF-8";
.Webview{
height: 600px;
width: 380px;
}
.message_container{
height: 80%;
width: 100%;
border:5px solid green;
}
.Chat_Bubble{
box-sizing: border-box;
float: left;
width: auto;
max-width: 80%;
position: relative;
clear: both;
background: #95c2fd;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.15, #bee2ff), color-stop(1, #95c2fd));
background-image: -webkit-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -moz-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -ms-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -o-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
border: solid 1px rgba(0,0,0,0.5);
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
-moz-box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
margin-bottom: 20px;
padding: 6px 20px;
color: #000;
text-shadow: 0 1px 1px rgba(255,255,255,0.8);
word-wrap: break-word;
}
.bubble:before, .bubble:after {
border-radius: 20px / 5px;
content: '';
display: block;
position: absolute;
}
.bubble:before {
border: 10px solid transparent;
border-bottom-color: rgba(0,0,0,0.5);
bottom: 0px;
left: -7px;
z-index: -2;
}
.bubble:after {
border: 8px solid transparent;
border-bottom-color: #bee2ff; /* arrow color */
bottom: 1px;
left: -5px;
}
.bubble-alt {
float: right;
}
.bubble-alt:before {
left: auto;
right: -7px;
}
.bubble-alt:after {
left: auto;
right: -5px;
}
.bubble p {
font-size: 1.4em;
}
}
.send_container{
height: 20;
width: 100%;
}
.send_container input{
width: 70%;
height:20%
border:2px solid #1CE615;
}
.send_container button{
width: 30%;
height:20%;
}
.send_container Button_Bilder{
width: 10%;
height:10% ;
}
<!DOCTYPE html>
<link rel="stylesheet" href="style.css">
<div class="Webview">
<div class="message_container" id="myForm" >
<div class="Chat_Bubble"></div>
</div>
<form class="send_container">
<input id="textField" type="text">
<img id="Bildverschicken" src="baseline_image_black_18dp.png">
<p>
<input type ="button" id="theButton" value="Nachricht absenden!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].textContent=document.getElementById('textField').value"/>
</p>
<input type="button" id="Button_Bilder" value="Bild verschicken!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].imageContent=document.getElementById('Bildverschicken').value"/>
<h3><div id="div"></div></h3>
</form>
</div>

Use DIV Containers as Flat Buttons with images inside

I want to create a button bar on top of the page, with div containers that contain images to use them as flat button. My problem is that I cannot get the alignment correctly.
Is there an additional way to highlight the last clicked button, so that you can see which button on the buttonbar is active without using javascript?
Here is my first approach:
<html>
<head>
<title>
</title>
<style>
#top {
position: fixed;
background-color: #AAA;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(transparent));
background-image: -webkit-linear-gradient(top, #fff, transparent);
background-image: -moz-linear-gradient(top, #fff, transparent);
background-image: -o-linear-gradient(top, #fff, transparent);
background-image: linear-gradient(to bottom, #fff, transparent);
left: 0px;
top: 0px;
width: 100%;
height: 60px;
padding: 0px;
border: thin solid rgba(0,0,0,0.6);
color: #444444;
font-family: Droid sans, Arial, Helvetica, sans-serif;
font-size: 12px;
cursor: pointer;
-webkit-box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
-moz-box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
}
.flatBtn2 {
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.flatBtn2:hover {
background-color: #eee;
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.buttonBar {
float:left;
}
</style>
</head>
<body>
<div id="top">
<div id="selectReiter" style="display:inline" class="buttonBar">
<div id="firstButton" class="flatBtn2" />
<div id="secondButton" class="flatBtn2" />
<div id="thirdButton" class="flatBtn2" />
</div>
</div>
</body>
</html>
#top {
position: fixed;
background-color: #AAA;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(transparent));
background-image: -webkit-linear-gradient(top, #fff, transparent);
background-image: -moz-linear-gradient(top, #fff, transparent);
background-image: -o-linear-gradient(top, #fff, transparent);
background-image: linear-gradient(to bottom, #fff, transparent);
left: 0px;
top: 0px;
width: 100%;
height: 60px;
padding: 0px;
border: thin solid rgba(0, 0, 0, 0.6);
color: #444444;
font-family: Droid sans, Arial, Helvetica, sans-serif;
font-size: 12px;
cursor: pointer;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
}
.flatBtn2 {
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
background-color: transparent;
border: none;
}
.flatBtn2:hover {
background-color: #eee;
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.flatBtn2:focus {
background-color: #eee;
}
.buttonBar {
float: left;
}
<div id="top">
<div id="selectReiter" style="display:inline" class="buttonBar">
<button id="firstButton" class="flatBtn2" >Button 1</button>
<button id="secondButton" class="flatBtn2" >Button 2</button>
<a id="thirdButton" href="#" class="flatBtn2">A 3</a>
</div>
</div>
First of all if you want to use button, then you should you the <button> tag and add the background image through css. You can also manipulate the states in css, what you are seacrhing for is :focus and :active, so you have two rules for your buttons. The normal button rule with the main background-image and an other rule button:focus, button:active where you can load an other image or do something else.
See fiddle for a working example. I added the needed styles at the end of your css.
Hope this helps!

how to make css and html in gmail like this?

when i use css + html and sent email to gmail, the css not appear . When i run in local just /localhost/text.html the css appear. I stagnant with this.
The Question is:
How can the code below appear in Gmail?.
i have the code like this (HTML + CSS):
<!DOCTYPE HTML> <html>
<head>
<!-- <htm><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"></htm> -->
<title>Email notification</title>
<style> * {
box-sizing: border-box; } .btn {background: #ffb300; background-image: -webkit-linear-gradient(top, #ffb300, #2980b9); background-image: -moz-linear-gradient(top, #ffb300, #2980b9); background-image: -ms-linear-gradient(top, #ffb300, #2980b9); background-image: -o-linear-gradient(top, #ffb300, #2980b9); background-image: linear-gradient(to bottom, #ffb300, #2980b9); -webkit-border-radius: 7; -moz-border-radius: 7; border-radius: 7px; font-family: Georgia; color: #ffffff; font-size: 15px; background: #ffb300; padding: 10px 20px 10px 20px; text-decoration: none;} .btn:hover { background: #cf9204; background-image: -webkit-linear-gradient(top, #cf9204, #cf9204); background-image: -moz-linear-gradient(top, #cf9204, #cf9204); background-image: -ms-linear-gradient(top, #cf9204, #cf9204); background-image: -o-linear-gradient(top, #cf9204, #cf9204); background-image: linear-gradient(to bottom, #cf9204, #cf9204); text-decoration: none;} #header {
box-sizing: border-box;
width: 80%;
height: 80px;
margin: 0 auto;
padding: 0px;
color: #fff;
text-align: center;
background-color: #000;
font-family: Open Sans,Arial,sans-serif;
border-radius: 10px 10px 0px 0px;
}
#footer {
width: 80%;margin: 0 auto;clear: both;text-align: center;padding: 20px 0;font-family: Verdena;background-color: #000; color: #838779;
border-radius: 0px 0px 10px 10px;
line-height: 1.5em;
}
#outer {
box-sizing: border-box;
border-right-style: solid;
border-left-style: solid;
clear:both;
padding-top: 0px;
width: 80%;
margin: 0 auto;
margin-top: 0;
text-align: center;
overflow: auto;
}
#inner {
box-sizing: border-box;
width: 100%;
float: left;
padding: 0;
background-color: #fff;
font-family: Open Sans,Arial,sans-serif;
font-size: 14px;font-weight: normal;
line-height: 2.0em;
color: #323330;
margin-top: 0;
text-align: center;
}
/*a {
color: #FFBA08;
}*/
</style>
<title>Email notification</title>
</head>
<body>
<div id="header">
<img height="60" width="220" src="" alt="" title="">
</div>
<div id="outer">
<div id="inner">
<h1> Text 1 </h1>
<p> Text 2 </p>
<p> Text 3 </p>
<p> <a class="btn btn-warning" href="#"> Activation your account </a> <p>
<p> Tetxt 5 </p>
</div>
<div style="clear: both;"></div>
</div>
<div id="footer">
Text 5
</div>
</body>

Facebook like box margins do not center

I'd like to think that I an intermediate when it comes to HTML and CSS but this is a huge problem I haven't been able to resolve.
I am building a website for a business and I can't seem to center the facebook social media plugin "like Box"
here is my html:
<!doctype html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../c9c.css">
<!-- TemplateBeginEditable name="doctitle" -->
<title>Cloud 9 CrossFit - Home</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=141894429309879";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-40292409-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<nav>
<li>C9C</li>
<li>About Us</li>
<li>Schedule</li>
<li>Membership</li>
<li>WOD</li>
<li>Media</li>
<li>Links</li>
<li>Contact</li>
</nav>
<!-- TemplateBeginEditable name="EditRegion1" -->
<div id="container">
<div id="img"><img src="../img/image place holder.jpg" alt="" name="imgmain" width="983" height="435" id="imgmain"></div>
<div class="fb-like-box" data-href="https://www.facebook.com/Cloud9CrossFit" data-width="973" data-height="510" data-show-faces="true" data-stream="true" data-header="false"></div>
<div class="quickboxes">
<div id="box1"><img src="../img/Crossfit.png" width="960" id="img1" longdesc="http://www.navyreserve.navy.mil/Pages/default.aspx"></div>
<div id="box2"><img src="../img/Rogue logo" alt="rogue fitness" width="940" id="img2" ></div>
<div id="box3"><img src="../img/facebook logo.png" alt="facebook" width="73" id="img3"></div>
</div>
</div>
<!-- TemplateEndEditable -->
<footer>footer stuff | sitemap | etc | © 2013 Cloud 9 CrossFit</footer>
</body>
</html>
The CSS:
/* CSS Document */
body {
font: Calibri;
background-color: #EFEFEF;
width: 1120px;
height: auto;
margin: auto;
background-image:url(img/Name%20sideways.png);
background-position:0px 20px;
background-repeat:no-repeat;
background-attachment:fixed;
}
#fb-root {
display: none;
}
nav {
margin: 20px auto;
list-style: none;
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
font-weight:550;
letter-spacing: -0.5px;
font-size: 13px;
text-shadow: 0 -1px 3px ##E9E8E9;
width: 974px;
height: 30px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: 0px 3px 3px #cecece;
-webkit-box-shadow: 0px 3px 3px #cecece;
box-shadow: 0 3px 4px #8b8b8b;
text-align: center;
-webkit-animation: showMenu 1s;
position: relative;
color: white;
}
nav li {
display: block;
float: left;
border-right: 1px solid #999;
border-left: 1px solid #E9E8E9;
width: 120px;
height: 30px;
border-bottom: 1px solid #D5D5D5;
border-top: 1px solid ##F5F5F5;
background-image: linear-gradient(bottom, #999999 23%, #CFCDCF 57%, #F5F5F5 89%);
background-image: -o-linear-gradient(bottom, #999999 23%, #CFCDCF 57%, #F5F5F5 89%);
background-image: -moz-linear-gradient(bottom, #999999 23%, #CFCDCF 57%, #F5F5F5 89%);
background-image: -webkit-linear-gradient(bottom, #999999 23%, #CFCDCF 57%, #F5F5F5 89%);
background-image: -ms-linear-gradient(bottom, #999999 23%, #CFCDCF 57%, #F5F5F5 89%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.23, #999999),
color-stop(0.57, #CFCDCF),
color-stop(0.89, #F5F5F5)
);
background-color: #5f5f5f; /* Fallback */
margin:0 auto;
}
nav li:hover {
background-image: linear-gradient(bottom, #696869 23%, #8F8F8F 57%, #C7C7C7 89%);
background-image: -o-linear-gradient(bottom, #696869 23%, #8F8F8F 57%, #C7C7C7 89%);
background-image: -moz-linear-gradient(bottom, #696869 23%, #8F8F8F 57%, #C7C7C7 89%);
background-image: -webkit-linear-gradient(bottom, #696869 23%, #8F8F8F 57%, #C7C7C7 89%);
background-image: -ms-linear-gradient(bottom, #696869 23%, #8F8F8F 57%, #C7C7C7 89%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.23, #696869),
color-stop(0.57, #8F8F8F),
color-stop(0.89, #C7C7C7)
);
background-color: #383838; /* Fallback */
-moz-box-shadow: inset 0 1px 2px 2px #666;
-webkit-box-shadow: inset 0 1px 2px 2px #666;
box-shadow: inset 0 1px 2px 2px #666;
}
nav li:active {
background-image: linear-gradient(bottom, #262626 23%, #525052 57%, #C7C7C7 89%);
background-image: -o-linear-gradient(bottom, #262626 23%, #525052 57%, #C7C7C7 89%);
background-image: -moz-linear-gradient(bottom, #262626 23%, #525052 57%, #C7C7C7 89%);
background-image: -webkit-linear-gradient(bottom, #262626 23%, #525052 57%, #C7C7C7 89%);
background-image: -ms-linear-gradient(bottom, #262626 23%, #525052 57%, #C7C7C7 89%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.23, #262626),
color-stop(0.57, #525052),
color-stop(0.89, #C7C7C7)
);
background-color: #383838; /* Fallback */
-moz-box-shadow: inset 0px 0px 5px 5px #31304A;
-webkit-box-shadow: inset 0px 0px 5px 5px #31304A;
box-shadow: inset 0 0 5px 5px #31304A;
}
nav li a {
color: black;
text-decoration: none;
text-align: center;
display: block;
line-height: 30px;
outline: none;
}
nav li:first-child {
-moz-border-radius: 4px 0 0 4px;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
border-left: none;
}
nav li:first-child a img {
vertical-align: middle;
margin-top: -2px;
}
nav li:last-child {
-moz-border-radius: 0 4px 4px 0;
-webkit-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
border-right: none;
}
/* Fade in animation (Webkit only) */
#-webkit-keyframes showMenu {
from {
opacity: 0;
top:-20px;
}
to {
opacity: 1;
}
#container {
width: 980px;
height:auto;
margin:auto;
}
#img {
width: 980px;
margin: 0 auto;
}
#imgmain {
display: block;
border-radius: 8px;
opacity: 0.8;
-moz-box-shadow: 0px 0px 10px #999;
-webkit-box-shadow: 0px 0px 10px #999;
box-shadow: 0px 0px 10px #999;
}
.fb-like-box {
display: block;
width: 980px;
height: auto;
text-align: center;
margin: 15px auto;
}
.quickboxes {
width: 974px;
margin: 0 auto;
}
#box1, #box2, #box3 {
width: 33%;
display: inline-block;
overflow: hidden;
margin: 15px auto;
text-align: center;
}
#img1, #img2 {
width: 60%;
margin: 5px auto;
}
footer {
height:18px;
width: 974px;
margin: 5px auto;
padding: 5px 0px;
text-align: center;
border-top: thin #999 solid;
border-bottom: thin #999 solid;
}
The problem is that while the image and link boxes are centered, the Facebook like box will not center.
I don't want to absolute position because if the user changes the window size it get's distorted. I know this is a margin issue. But I'm not sure why.
This is simple CSS stuff so why does it fail to work properly?
I was able to fix it by adding
padding-left: 70px;
Hi a slight modification of Stefan's answer did the trick for me:
div.fb-like {
width: 100% !important;
position: relative;
text-align:center !important;
}
<div class="fb-like disp_fb_like" data-send="false" data-layout="box_count" data-width="90" data-show-faces="false" data-action="recommend"></div>
I cheated a little when I was encountering this issue.
I created a new container to surround the likebox and had to set a width (for the vertical configuration at 292px) with auto left/right margins.
All of the above did not work for me.
The following did:
.fb-like-box, .fb-like-box span, .fb-like-box.fb_iframe_widget span iframe {
width: 100% !important;
position: relative;
text-align:center !important;
}
Wrap another div around the Facebook code and add this to it:
#facebook-box {width: 278px; display: block; margin: 0 auto;}
Set the width to the same width as your facebook like box.

Z-Index in IE 10

If you check the following website with Internet Explorer 10 the sub menus for the navigation are hidden behind the images.
I tried adjusting the z-index values, helped with Firefox/Chrome but not with IE. The code can be found here.
<style>
body {
width: 100%;
height: 100%;
margin:0;
padding:0;
background-color: #393939;
}
/*micro-clearfix by Nicolas Gallagher http://nicolasgallagher.com/micro-clearfix-hack/*/
/* For modern browsers */
.cf:before, .cf:after {
content:"";
display:table;
}
.cf:after {
clear:both;
}
/* For IE 6/7 (trigger hasLayout) */
.cf {
zoom:1;
}
/*horizontal menu styles*/
nav {
background: #916A31;
height: 2.3em;
}
ul, li {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
ul {
background: #D5973C;
height: 2em;
width: 100%;
}
li {
position: relative;
}
li a {
display: block;
line-height: 2em;
padding: 0 1em;
color: white;
text-decoration: none;
}
li a:hover, .topmenu li:hover > a {
background: #916A31;
height: 2em;
padding-top: .3em;
position: relative;
top: -.3em;
border-radius: .3em .3em 0 0;
}
.current, a:hover.current, .topmenu li:hover a.current {
background: #AD9B7F;
color: #eee;
padding-top: .3em;
border-radius: .3em .3em 0 0;
position: relative;
top: -.3em;
border-bottom: .3em solid #917F63;
cursor: default;
}
/*dropdown menu styles*/
ul.submenu {
float: none;
background: #916A31;
width: auto;
height: auto;
position: absolute;
top: 2em;
left: -9000em;
/* -9000em */
z-index: 1000000;
}
ul.submenu li {
float: none;
}
.topmenu li:hover ul {
left: 0;
}
ul.submenu li a {
border-bottom: 1px solid white;
padding: .2em 1em;
white-space: nowrap;
}
ul.submenu li:last-child a {
border-bottom: none;
}
ul.submenu li a:hover {
background: #D5973C;
height: 2em;
padding-top: .2em;
top: 0;
border-radius: 0;
}
header {
width: 960px;
}
nav {
width: 960px;
clear: both;
height: 25px;
background: #0079c0;
background: -webkit-gradient(linear, left top, left bottom, from(#0584d3), to(#0666a3));
background: -moz-linear-gradient(top, #0584d3, #0666a3);
background: -ms-linear-gradient(top, #0584d3, #0666a3);
}
article {
width: 960px;
height: 600px;
background: white;
overflow: hidden;
text-align:center;
-moz-box-shadow: 0 0 20px #888;
-webkit-box-shadow: 0 0 20px#888;
box-shadow: 0 0 20px #888;
z-index:0;
}
.logo {
float: left;
width: 65%;
}
.search {
padding-top: 17px;
width: 35%;
float: right;
}
.darkbg {
width: 100%;
height: 100px;
padding-top: 20px;
background: black;
background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#393939));
background: -moz-linear-gradient(top, #000, #393939);
background: -ms-linear-gradient(top, #000000, #393939);
}
footer {
width: 100%;
height: 200px;
background: black;
background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#393939));
background: -moz-linear-gradient(top, #000, #393939);
background: -ms-linear-gradient(top, #000000, #393939);
}
.lightbg {
width: 100%;
background-color: #d9d9d9;
background-image:url('images/party-cartoon-wild-bunch-adventures.png');
}
input {
border: 3px solid white;
-webkit-box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1), 0 0 16px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1), 0 0 16px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1), 0 0 16px rgba(0, 0, 0, 0.1);
margin: 0 0 10px 0;
font-size:20px;
color: white;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: rgba(255, 255, 255, 0.5) url(http://patrickjamesgeorge.id.au/mb/images/magnify.png) no-repeat 3px 3px;
padding:9px 5px 5px 36px;
}
.smallBox1 {
border:0px solid;
border-radius:3px;
border-color: grey;
width: 293;
height: 260;
float: left;
margin-left:20;
background-image:url('images/a.jpg');
background-color:#cccccc;
}
.smallBox2 {
border:0px solid;
border-radius:3px;
border-color: grey;
width: 293;
height: 260;
float: left;
margin-left:20;
background-image:url('images/b.jpg');
background-color:#cccccc;
}
.smallBox3 {
border:0px solid;
border-radius:3px;
border-color: grey;
width: 293;
height: 260;
float: left;
margin-left:20;
background-image:url('images/c.jpg');
background-color:#cccccc;
}
.smallBoxText {
margin-top: 240;
background-color:white;
width: 293;
opacity:0.75;
}
</style>
<body>
<div align="center">
<div class="darkbg">
<header>
<div class="logo" align="left">
<img id="logo" src="http://patrickjamesgeorge.id.au/mb/images/MB_Logo.png" width="600" height="78" alt="Logo" />
</div>
<div class="search" align="right">
<input type="text" onBlur="if(this.value == '') { this.value = 'Search Site'; }" onFocus="if(this.value == 'Search Site') { this.value = ''; }" value="Search Site" size="20">
</div>
</header>
</div>
<div class="lightbg">
<nav class="cf">
<nav class="cf">
<ul class="topmenu">
<li>Home
</li>
<li>Offers
<ul class="submenu">
<li>Adult entertainment
</li>
<li>Pubs, Clubs & Bars
</li>
<li>Outdoor activities
</li>
<li>Tours & cruises
</li>
<li>Transport
</li>
<li>Stay at home
</li>
<li>Sport events
</li>
<li>Dude food
</li>
</ul>
</li>
<li>Register
</li>
<li>About
</li>
<li>Contact
<ul class="submenu">
<li>Customer service
</li>
<li>Register
</li>
<li>Technical support
</li>
</ul>
</li>
<li>Admin
<ul class="submenu">
<li>Edit image fader images
</li>
</ul>
</li>
</ul>
</nav>
</nav>
<article>
<div class="images">
<img src="http://patrickjamesgeorge.id.au/mb/images/1.jpg" width="960" height="300" alt="1" id="mainImage1" style="z-index:0" />
<img src="http://patrickjamesgeorge.id.au/mb/images/2.jpg" width="960" height="300" alt="2" id="mainImage2" style="z-index:0" />
<img src="http://patrickjamesgeorge.id.au/mb/images/3.jpg" width="960" height="300" alt="3" id="mainImage3" style="z-index:0" />
<img src="http://patrickjamesgeorge.id.au/mb/images/4.jpg" width="960" height="300" alt="4" id="mainImage4" style="z-index:0" />
<img src="http://patrickjamesgeorge.id.au/mb/images/5.jpg" width="960" height="300" alt="5" id="mainImage5" style="z-index:0" />
</div>
<div class="smallBox1">
<div class="smallBoxText">
<p>By nature, the background color...</p>
</div>
</div>
<div class="smallBox2">
<div class="smallBoxText">
<p>This is just some test text.</p>
</div>
</div>
<div class="smallBox3">
<div class="smallBoxText">
<p>Because all the columns are floated.</p>
</div>
</div>
</article>
</div>
</div>
<footer></footer>
</body>
Add this in your html:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
The page in IE is rendering in Quirk mode.
While using z-inde, parent div must have position:relative and child div to b position:absolute. So change your code accordingly.