How do you centre two icons (images) side by side in footer?
Tags: html,css
Problem :
I'm close to completing the last section of my main page... the footer.
I'm wondering how I can float two icons (images) next to each other? Referring to the two icon side by side. I understand the hover I just need to know how to position them accordingly.
Thankyou!
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Aesthetic Media</title>
<link href="styles.css" rel="stylesheet" type="text/css"/>
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700,500' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="styles.js"></script>
</head>
<body>
<header>
<a class="logo" href="main.html">Aesthetic</a>
<nav>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Contact</a></li>
</nav>
<div class="clears"></div>
<div class="maintext">
<h1>We're Aesthetic</h1>
<h2>A Visual Agency from Niagara</h2>
</div>
</header>
<main>
<h2 class="whatwedo">Expertise</h2>
<div class="whatwedobox one"><div class="branding"><img src="images/branding.png" class="branding"><h3>Branding</h3></br><p>Are you looking for the competitive edge that will boost your business ahead of others? Look no further then Aesthetic... We're here to help.</p></div></div>
<div class="whatwedobox two"><div class="motion"><img src="images/motion.png" class="motion"><h3>Motion</h3></br><p>No matter the message you're trying to convey, we at Aesthetic will transform your idea, creating an incredible and memorable audio visual experience.</p></div></div>
<div class="whatwedobox three"><div class="design"><img src="images/design.png" class="branding"><h3>Design</h3></br><p>Our talented team, here at Aesthetic is ready to help take your business to the sky! If you're looking for a professional, user friendly and beautifully designed website, just let us know!</p></div></div>
</main>
<div class="secondary">
<h2>We bring out the beauty in anything and everything.</h2>
<h3>Aesthetic Media</h3>
</div>
<footer>
<a class="logotwo" href="main.html">Aes</a>
<nav>
<li><a href="#" class="facebook" title="Facebook Page"></a></li>
<li><a href="#" class="Mail" title="Contact Us!"></a></li>
</nav>
</footer>
<script src="https://ajax.googleapis.com/ajax/libsLorem/jquery/1.11.2/jquery.min.js"> </script>
</body>
</html>
CSS
* {
box-sizing: border-box;
margin: 0px;
padding: 0px;
}
body {
background: white;
}
header {
width: 100%;
height: 550px;
background: white;
background: url('images/main.jpg') center center;
background-size: cover;
padding: 30px 30px 30px 30px;
position: relative;
}
.logo {
top: 33px;
left: 30px;
width: 200px;
height: 80px;
display: block;
float: left;
z-index: 30;
font-size: 1.8em;
font-weight: 800;
text-decoration: none;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 5px;
position: absolute;
}
.logo a {
font-size: 1.8em;
font-weight: 800;
text-decoration: none;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 5px;
}
nav {
top: 22px;
right: 30px;
float: right;
z-index: 30;
letter-spacing: .2em;
position: absolute;
}
nav li {
float: left;
list-style: none;
padding: 10px 15px 10px 15px;
}
nav li:last-child {
border-right: none;
}
nav li a {
padding: 5px 10px 5px 10px;
color: white;
display: block;
font-weight: 400;
text-decoration: none;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
text-transform: uppercase;
-webkit-font-smoothing: antialiased;
}
nav li a:hover {
background-color: rgba(0, 0, 0, 0.5);
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
-ms-transition: all .3s ease;
-transition: all .3s ease;
-webkit-transition: all .3s ease;
-webkit-font-smoothing: antialiased;
}
.clears {
clear: both;
}
.maintext {
margin: auto;
width: 600px;
text-align: center;
margin-top: 185px;
color: white;
z-index: 30;
position: relative;
}
.maintext h1 {
font-weight: 600;
font-size: 1.8em;
line-height: 1.2em;
text-transform: uppercase;
letter-spacing: .1em;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
padding-bottom: 15px;
}
.maintext h2 {
font-weight: 400;
font-size: 1.7em;
line-height: 1.2em;
text-transform: uppercase;
letter-spacing: .1em;
text-align: center;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
padding-bottom: 15px;
}
main {
max-width: 1180px;
margin: auto;
margin-top: 50px;
overflow: hidden;
}
h2.whatwedo {
text-align: center;
font-weight: 400;
font-size: 1.7em;
line-height: 1.2em;
text-transform: uppercase;
letter-spacing: .1em;
text-align: center;
color: #000000;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
-webkit-font-smoothing: antialiased;
}
.motion img {
max-width: 45%;
min-width: 45%;
height: 150px;
margin-left: 89px;
}
.branding img {
maxwidth: 50%;
height: 150px;
margin-left: 100px;
}
.design img {
width: 42%;
height: 138px;
margin-left: 85px;
margin-top: 13px;
}
.whatwedobox {
width: 30%;
height: 350px;
border: none;
float: left;
margin-right: 5%;
padding: 15px;
margin-top: 20px;
margin-bottom: 15px;
}
.whatwedobox:last-child {
margin-right: 0%;
}
main h3 {
text-align: center;
padding-top: 20px;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
-webkit-font-smoothing: antialiased;
}
main p {
text-align: center;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
-webkit-font-smoothing: antialiased;
}
.secondary {
width: 100%;
height: 200px;
margin-top: 20px;
background: white;
background: url('images/sky.jpg') center center;
background-size: cover;
padding: 30px 30px 30px 30px;
position: relative;
}
.secondary h2 {
margin: 0 200px;
margin-top: 3px;
margin-bottom: 17px;
height: 90px;
width: 500px;
font-weight: 600;
font-size: 1.8em;
line-height: 1.2em;
text-transform: uppercase;
letter-spacing: .1em;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
padding-bottom: 15px;
}
.secondary h3 {
margin: 0 auto;
height: 50px;
width: 320px;
font-weight: 400;
font-size: 1.7em;
line-height: 1.2em;
background: rgba(0, 0, 0, 0.3);
padding: 10px;
text-transform: uppercase;
letter-spacing: .1em;
text-align: center;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
}
footer {
width: 100%;
height: 150px;
margin-top: 75px;
background: rgba(0, 0, 0, 0.8);
position: relative;
}
.logotwo {
top: 60px;
left: 150px;
width: 100px;
height: 40px;
display: block;
float: left;
z-index: 30;
font-size: 2em;
font-weight: 800;
text-decoration: none;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 9px;
position: absolute;
}
.logotwo a {
font-size: 1.8em;
font-weight: 800;
text-decoration: none;
color: #FFFFFF;
font-family: 'Raleway' , sans-serif, Helvetica, Verdana;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 5px;
margin: 10px 10px 10px 10px;
-webkit-font-smoothing: antialiased;
background: rgba(0, 0, 0, 0.3);
padding: 10px;
}
.facebook {
top: 22px;
right: 70px;
width: 64px;
height: 64px;
float: right;
z-index: 30;
display: block;
background: url('images/fb.png') center top no-repeat;
letter-spacing: .2em;
position: absolute;
}
.facebook:hover {
background-image: url('#');
}
.mail {
top: 22px;
right: 30px;
width: 64px;
height: 64px;
float: left;
z-index: 30;
display: inline-block;
background: url('images/email.png') center top no-repeat;
letter-spacing: .2em;
position: absolute;
}
.mail:hover {
background-image: url('#');
}
Solution :
Can you create 2 div of 49% width each, and then center one image in each div ?
<div id=footer style="width:80%; margin:auto; background-color:rgb(50,50,50);">
<div style="display:inline-block; width:49%">
<p style="text-align:center">
<img src="facebook.png">
</p>
</div>
<div style="display:inline-block; width:49%">
<p style="text-align:center">
<img src="youtube.png">
</p>
</div>
</div>
CSS Howto..
Your SCSS produces the following CSS: ul li:before { content: attr(data-views); } [data-views='$aaa'] { font-size: 40px; } ul li { width: attr(data-views); } That is perfectly valid CSS, but has...
.subMenu li a { background: none; } if it is not sticking, you can add the !important flag .subMenu li a { background: none !important; } ...
I'm not sure if you have more CSS in your document but you're missing a bit of CSS to actually make your menu horizontal. You can make it horizontal by...
:last-of-type selector will help: #eaebec is the table background. You have two solutions, Solution 1: remove the background from table and do: td{ background: #eaebec; } td:last-of-type{ background: none; }...
As I can see with Chrome inspector, they are first separated in two columns, with position:absolute. The one on the left with a "left" css property set, and the one...
You could use the CSS rules display: table on the <ul> and display: table-cell on the <li>. This will cause the menu to fit perfectly into the horizontal space. I...
You need to center align the image. I see you tryed to do it with margin 0 auto, but you need a fixed size for that. And we dont know...
You can do this just using media queries. But still if you're looking for a solution in jquery then you can use toggleClass method like this: $(window).on('resize',function(){ var size =...
How can I add the 32px when applying this style in jQuery. Is there a way I can do mathematical operations in jQuery? Try this:- Demo $('#search').css("top","3rem").css("top", "+=32px") Calc...
The below answer is not an actual 3D shape. It only gives a slight illusion of being 3D, however, depending on your use case, you may be able to 'fake'...
Look into this css : <!-- Custom styles for this template --> <link href="cover.css" rel="stylesheet"> In this .css you have this part : /* * Affix and center */ @media...
try something like ul.columns li img, ul.columns li { position: relative; /* so the close image is relatively positioned inside <li> */ z-index : 1; } ul.columns li img +...
Add vertical-align:top to your img CSS rules. Inline elements reserve room for descender text elements like g, j, and y and this will give you the result you're after: .leftpart...
<style type="text/css"> @font-face { font-family: "My Custom Font"; src: url(http://www.example.org/mycustomfont.ttf) format("truetype"); } p.customfont { font-family: "My Custom Font", Verdana, Tahoma; } </style> <p class="customfont">Hello world!</p> use this url . i...
Vishal provided the reason for the hover effect not working - this is my addition to it: - focus only fires on the textarea, but you want to change the...
You could set the font size of an ancestor to 0... .parent { font-size: 0; } div { width: 100px; height: 100px; background-color: red; border: 1px solid black; display: inline-block;...
Hey StormShadow. To edit the style of Sencha components you shuld learn SASS, in fact, Sencha Touch, exactlly like the new Ext 4 framework, uses SASS and COMPASS to create...
Frankly, you can add/remove links to external css files, so in reality, you can toggle, well, everything. If you wanted to. Edited to add example: Given a link such as...
set width on #nav-primary .wrapper css class to 980px(which is the width of your image)
You can filter a selection: var myLink = d3.selectAll(".link") .filter(function(d) { return d === linkData[3]; }) .attr('stroke', 'red'); Or, better still, as LeartS suggested, you can directly filter the link...
You can't assign two id's like that, but you can use two classes: <div class="span google"></div> Also, you can't start the element as a div and close it as a...
You could create a custom CSS file and add it as a reference to the master page used to format your site. Erik Swenson has a good overview of the...
To specifically target the list items in Specials widget, use this: .specials-home ul.post-list li { background: #000; } ...
Set position of your main container as relative and of each image containers as absolute. http://jsfiddle.net/ehu5j/...
I figured it out myself. This is what I was looking for: :host /deep/ .alert { background-color: green; } The above code will produce the following: [_nghost-wjn-3] .alert { background-color:...
It's not possible to do this in CSS if the font doesn't contain a solid cloud image. It is possible to do this with an SVG image. Fortunately, the font...
Your bar has an Id = file1_progress so you can style that. Have a look at my example below, I set mine to 100px rm(list = ls()) library(shiny) ui <-...
The answer is: You can't. You can not flip a background image using just CSS. Possible Solutions for you : Looking at your problem, if you do not want to...
Here is a basic example: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <style media="all"> h1, ul, li {margin: 0; padding: 0;} h1 {float: left; color: #FF9933;} #user {float: right;} ul...
The Style property never shows on intellisense when using the asp server controls. The intellisense will show for the attributes after you type Style=" The server control inherits System.Web.UI.Control, which...