float right won't work - css

I have been trying to float the social icons to the right of the page, but for some reason it won't work.
But the text at the top of the page floats perfectly.
Here is a fiddle:
check it out here
<div class="social">
<img src="img/twitter.png" width="32" height="32" alt="Twitter" />
<img src="img/google_plus.png" width="32" height="32" alt="Google" />
<img src="img/linkedin.png" width="32" height="32" alt="LinkedIn" />
<img src="img/facebook.png" width="32" height="32" alt="Facebook" />
</div>

clear:both
add the above css in social css

try this css
#wrapper {
margin: 0px auto;
width: 940px;
padding: 15px 0px 0px;
position: relative;
text-align: left;
}
#header {
width: 940px;
margin: 0px;
padding: 0px;
background: none repeat scroll 0% 0% rgb(255, 255, 255);
overflow: hidden;
}
#mast-head {
width: 940px;
float: left;
margin: 0px;
padding: 0px 0px 10px;
background: none repeat scroll 0% 0% transparent !important;
position: relative;
}
a.logo-txt {
text-decoration: none;
padding: 0px;
display: block;
float: left;
margin: 0px;
}
a.logo-txt #logo {
margin: 0px;
padding: 0px;
}
.personalisation {
margin: 0px auto;
float: right;
}
.welcome {
font-size: 12px;
font-weight: bold;
}
.social {
margin: 100px 0px auto;
float: right;
width:100%
}
.social a{
float:right;
}
​
#nav{
border:1px solid #ccc;
border-width:1px 0;
list-style:none;
margin-top: 160px;
padding:0;
text-align:center;
}
#nav li{
display:inline;
}
#nav a{
display:inline-block;
padding:10px;
}
#nav ul{
position:absolute;
left:-9999px;
margin:0;
padding:0;
text-align:left;
}
#nav ul li{
display:block;
}

Related

Why are the margins not working correctly?

I want to achieve this:
I have achieved this:
Why are the margins set on #members-content-box not working correctly? The page is live at http://goo.gl/e7yiAf
<section id="members-content">
<div id="members-menu">
<ul>
<li>My Items</li>
<li>Submit Items</li>
<li>Account Settings</li>
</ul>
<div id="menu-line">
</div>
</div>
<div id="members-content-box">
hello
<br /><br /><br />
</div>
</section>
My CSS:
/* members menu*/
#members-content { width: 100%; margin: 0 auto;}
#members-menu { width: 100%; text-align: left; margin-bottom: 30px;}
#members-menu ul { list-style: none;}
#members-menu li { background-color: #FFF; width: 127px; height: 25px; text-align: center; float: left; margin-right: 7px; padding-top: 8px}
#members-menu li a { font-family: Verdana, Geneva, sans-serif; font-size: 12px; font-weight: normal; color: #2e2e2e; text-decoration: none;}
#members-menu li a:hover { color: #ffbe00;}
#members-menu li a:active { color: #ffbe00;}
#menu-line { height: 5px; background-color: #FFF; float:left; min-width: 100%; margin-left:0 40px 0 40px;}
/* members-content-box */
#members-content-box { background-color:#FFF; padding: 35px; float: left; width:100%; border: 1px solid grey;}
Use margin instead of padding - padding will just enlarge the div from inside including its background
#members-content-box { background-color:#FFF; margin: 35px; float: left; width:100%; border: 1px solid grey;}
To Achieve the above one put the padding-bottom for members-menu ul
#members-menu{
padding-bottom:30px;
}
And change members-content-box css like this
#members-content-box {
background-color: #FFF;
padding: 35px;
float: left;
width: 90%;
border: 1px solid grey;
margin-left:30px;
}
I think this one helpful to you.

Css Issues with alignin text and images in footer

I have some kind of an issue:
I have a footer, with text and a Facebook image in it.
For some reason I can't get the facebook icon directly to the right of the text.
Can someone please help me?
here is a link to jsfiddle
<div id="footerwrap">
<div id="footer">
<div class="copyright">2014 - 2015 <span class="bar">|</span>www.website.com<span class="bar">|</span>Created by website<span class="bar">|</span>
<ul>
<li><img src="http://www.commuwise.nl/wp-content/uploads/facebook.png" />
</li>
</ul>Like us on Facebook!</div>
</div>
</div>
And the css:
#footerwrap {
width: 1000px;
float: left;
margin: 0 auto;
clear: both;
}
#footer {
height: 30px;
background: #33FF66;
border-radius: 10px;
border: 1px solid #1feb52;
margin: 0px auto;
text-align: center;
color:#FFF;
}
#footer a {
color:#FFF;
text-decoration:none;
}
#footer a:hover {
color:#FFF;
text-decoration:underline;
}
#footer a:visited {
color:#FFF;
text-decoration:underline;
}
.bar {
font-size: 15px;
}
#footer .copyright ul {
list-style: none;
margin: 0px 0px 0px;
padding: 3px;
float:right;
margin-left:5px;
}
#footer .copyright img {
border: 0px;
}
#footer .copyright {
color: #fff;
line-height: 32px;
margin-left: 5px;
margin-top: 0px;
text-align: center;
}
Thanks!!
Best regards
Here is a js.fiddle: http://jsfiddle.net/DSrn4/1/
In your css code,
#footer .copyright ul {
list-style: none;
margin: 0px 0px 0px;
padding: 3px;
display:inline-block;
margin-left:5px;
}
removed: float:right;
added: display:inline-block;
Try this jsfiddle
<div id="footerwrap">
<div id="footer">
<div class="copyright">
2014 - 2015 <span class="bar">|</span>www.website.com<span class="bar">|</span>Created by website<span class="bar">|</span>Like us on Facebook!<img src="http://www.commuwise.nl/wp-content/uploads/facebook.png" />
</div>
</div>
</div>
Is this how you are wanting it to be? Working Fiddle
#footer .copyright ul {
list-style: none;
margin: 0px 5px;
padding:0 3px;
float:right;
}
#footer .copyright ul li a{
display:block;
margin:0;
padding:0;
}
#footer .copyright ul li a img{
display:inline-block;
vertical-align:top;
padding-top:3px;
}

My CSS layout is not working the way it should

Ok so I have my web page (http://jsfiddle.net/HVGBf/) but it's not working the way I would like it to be working.
As you see on a small browser the Logos text is jumping down because of the line-height.
I'd like the Project Name to be abreast if possible, else i'd like it to be among each other but how can I accomplish that?
Html:
<body class="home">
<div id="wrapper">
<div id="logo">
<span>Project name</span>
</div><!-- endLogo -->
<div id="menu">
<ul>
<li>Home</li>
<li>Over ons</li>
<li>Projecten</li>
<li>Vrienden</li>
<li>Doneren</li>
<li>Contact</li>
</ul>
</div><!-- endMenu -->
</div>
</body>
</html>​
Css:
/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
html,body,div,span,applet,object,iframe,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
html, body { font-family: "helvetica", arial; margin: 0; padding: 0; height:100%;}
#wrapper {
min-width: 800px;
}
.home #logo {
background: #00B65F;
width: 22%;
float: left;
padding: 0 1% 0 2%;
text-align: right;
-webkit-border-top-right-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
-moz-border-radius-topright: 15px;
-moz-border-radius-bottomright: 15px;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
line-height: 180px;
height: 180px;
font-size: 220%;
}
.home #logo span {
font-color: #000;
}
.home #menu {
background-color: #000;
float: right;
background-repeat: repeat;
padding: 56px 5% 56px 1%;
-webkit-border-top-left-radius: 15px ;
-webkit-border-bottom-left-radius: 15px;
-moz-border-radius-topleft: 15px;
-moz-border-radius-bottomleft: 15px;
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
margin-left: 6%;
width: 63%;
height: 70px;
}
#menu ul {
float: left;
margin: 0;
padding: 0;
width: 100%;
}
#menu li {
float: left;
list-style-type: none;
}
#menu a {
float: left;
text-decoration: none;
font-size: 150%;
color: #fff;
padding: 0.4em 0.7em 0.4em 0.7em;
-webkit-border-radius: 10px;
border-radius: 10px;
display: block;
}
#menu a:hover, #menu .active { background-color: #00B65F; }
​
If you just want the words "Project" and "Name" to be on one line, then this should do the trick:
#logo span { white-space: nowrap; }
The text might extend outside of #logo due to how you've sized it (by percentage), so to fix that you could also add a minimum width like so:
#logo { min-width: 200px; }
Edit: I noticed you also have margin-left set to 6%. I would recommend using a constant value like 20px. Also, here is a jsFiddle with the recommendations I've mentioned.

Wrapper not to go from top to bottom

Ok, I give up - I can't work it out; the wrapper seems to go from the top to the bottom while I want it to leave a gap at the top and bottom so the background appears through. I can't seem to work it out. I am very novice to this. Any help & ideas very welcome.
Code
body {
background: #ffffff url(bgfin.jpg) repeat;
font-family: Tahoma,arial, sans-serif;
font-size:12px;
color:#666666;
height: 100%;
margin:0;
padding:0;
}
#wrapper {
background: url(body-line.png) center repeat-y;
padding-top: 65px;
padding-bottom: 65px;
}
#wrappertop{
background: url(header.png) top center no-repeat;
}
#wrappertbtm{
background: url(footer-new.png) bottom center no-repeat;
padding-bottom: 65px;
}
#container{
width: 959px;
margin: 0 auto;
}
.title{
width: 959px;
height: 56px;
padding: 15px 0px 10px 0px;
font-size: 30px;
color: #bd7821;
}
#navigation{
position: relative;
width: 959px;
height: 40px;
z-index: 2;
}
#navigation li{
float: left;
z-index: 2;
padding: 0px 34px 0px 0px;
}
#navigation li a{
display: inline-block;
position: relative;
outline: none;
height: 28px;
color: #e3e3e3;
z-index: 2;
font-size: 12px;
padding: 15px 0px 0px 0px;
text-decoration: none;
}
#navigation li a:hover, #navigation li#active a{
color: #bd7821;
text-decoration: none;
}
#header{
position: relative;
width: 959px;
height: 196px;
z-index: 1;
margin: 20px 0px 0px 0px;
}
Try:
body { padding:20px 0; }
Or:
#wrapper { margin:20px 0; }
That is shorthand for:
#wrapper {
margin-top:20px;
margin-right:0;
margin-bottom:20px;
margin-left:0;
}
Remember:
Padding is rendered inside of the element
Margin is on the outside
This might help as a reminder:
How to remember in CSS that margin is outside the border, and padding inside

FooterWrap breaking box

What's up with my Footer CSS ?
Using the Web Dev toolbar in Firefox I can see that it's got a box and it seems to be pushing it all down to the next line - no padding or margins that I can see..
I'm sure it's an easy fix - if someone could point out what's up that would be ace!
Thanks guys!
Website is here for Love Jungle Clothing Brand
Here is the code:
/****** Footer *****/
/*new div Neil */
#footerwrap
{width: 100%;
margin: 0 auto;
text-align:left;
height:40px;
background-color:#000;
clear:both;
margin-top:10px;
overflow:hidden;
z-index:1000;
}
/*new div container Neil */
#footer {
width: 990px;
height:60px;
margin: 0 auto;
padding-top:10px;
background-color:#000;
clear:both;
text-align:center;
z-index:1000;
}
#footer ul {
padding: 0px 0 0 0;
margin: 0 0 0 0px;
list-style-type: none;
}
#footer li {
float: right;
padding: 0;
margin: 0 auto;
display: inline;
}
#footerLeft ul {
padding: 0px 0 0 0;
margin: 0 0 0 0px;
list-style-type: none;
}
#footerLeft li {
float: left;
}
#footer a {
display: block;
height: 40px;
background-repeat: no-repeat;
display: inline;
text-decoration:none;
text-align:center;
font-family: Arial, Helvetica, sans-serif;
font-size: 90%;
white-space:nowrap;
margin:0 auto;
z-index:1000;
}
#footerwrap a {
display: block;
color:#fff;
height: 20px;
background-repeat: no-repeat;
padding-right:40px;
margin:0 auto;
z-index:1000;
}
/****** Footer *****/
/*new div Neil */
#footerwrap
{width: 100%;
margin: 0 auto;
text-align:left;
height:40px;
background-color:#000;
clear:both;
margin-top:10px;
overflow:hidden;
z-index:1000;
}
/*new div container Neil */
#footer {
width: 990px;
height:60px;
margin: 0 auto;
padding-top:10px;
background-color:#000;
clear:both;
text-align:center;
z-index:1000;
}
#footer ul {
padding: 0px 0 0 0;
margin: 0 0 0 0px;
list-style-type: none;
}
#footer li {
float: right;
padding: 0;
margin: 0 auto;
display: inline;
}
#footerLeft ul {
padding: 0px 0 0 0;
margin: 0 0 0 0px;
list-style-type: none;
}
#footerLeft li {
float: left;
}
#footer a {
display: block;
height: 40px;
background-repeat: no-repeat;
display: inline;
text-decoration:none;
text-align:center;
font-family: Arial, Helvetica, sans-serif;
font-size: 90%;
white-space:nowrap;
margin:0 auto;
z-index:1000;
}
#footerwrap a {
display: block;
color:#fff;
height: 20px;
background-repeat: no-repeat;
padding-right:40px;
margin:0 auto;
z-index:1000;
}
Are you trying to use the "footer stick" method? Or do you just want to have the text content sort of vertically centered. If the latter, try this:
Look in your footer file, you have the following html:
<div id="footerwrap">
<div id="footer">
<div id="footerLeft">
<li>Made in Australia</li>
</div>
<ul>
<span>
<center>
<li>Store</li>
<li>About</li>
<li>Press</li>
<li>Stockists</li>
<li><span>Contact</span></li>
</center>
</span>
</ul>
</div>
</div>
This line: <li>Made in Australia</li> needs to be removed.
If you want more info on the footer-stick method check out http://bonrouge.com/~home

Resources