What is the best way to align two icons (images) next to each other in a footer section?

I'm almost done with the final section of my homepage... the footer.

Any tips on how to float two icons (images) side by side? I'm familiar with hover effects, just need help with positioning them correctly.

Thank you!

HTML

<!DOCTYPE html>

<html lang="en">
<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;
}
...

Answer №1

Is it possible to create two divs, each with a width of 49%, and then center an image in each one?

<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>

Answer №2

To align elements without using <li>, simply add the inline-block property to the elements such as divs or images that need alignment:

<div style="display:inline-block;">
    <a href="#" class="facebook" title="Facebook Page">Facebook</a>
</div>
<div style="display:inline-block;">
    <a href="#" class="Mail" title="Contact Us!">Mail</a>
</div>

If you require additional styling for more than just the two links/images to be aligned, you may need to provide further explanation :)

For more information on the differences between display: inline and display: inline-block, refer to this question: differences between inline and inline-block.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When attempting to submit, the jQuery validations fail to function accordingly

I have created an HTML form along with jQuery for validation purposes. However, upon clicking the submit button, nothing seems to be happening. I am unsure if my form is properly connecting with the jQuery file or not. Can someone please review my code and ...

When triggered by a click, the function gradually fades in and out. It superimposes one image on top of another, but unfortunately, the sizes

Due to different screen sizes, the image does not appear on top of another image exactly. It seems like a new function is needed. One that does not overlap with another image (by clicking the function for a few seconds), but rather replaces it for those fe ...

Displaying Hierarchical Data with AngularJS and ng-repeat

Recently, I've been working on finding an elegant solution to represent hierarchical data in my application. Specifically, I have implemented a slide effect for bootstrap badges that showcase sub-categories using AngularJS. With some guidance from th ...

Tips for sending multiple values to the next page using AngularJS

Hey there, I'm new to AngularJS and currently using Onsen UI in my demo application. I have two pages in my app and I'm trying to pass two values to the next page. I managed to pass one value successfully, but when I attempt to send the second on ...

Tips for styling a PHP file using CSS and styling more than one element:1. Begin by creating a

I am currently attempting to style a php file using a linked stylesheet, but I am encountering some difficulties. At the moment, I have the , it will affect either the font or the border.</p> Is there a way to apply multiple styles to elements on a ...

Exploring the art of manipulating HTML code using JavaScript

I am looking to implement a specific change using JavaScript: <input id="innn" value="" /> to: <input id="innn" value="SOME_VALUE" /> I attempted the following methods: document.getElementById("innn").setAttribute("value", "189"); and als ...

Guide to displaying nine images in a table format with three images in each row using PHP

How can I display nine images in a table with three images in each row using PHP? ...

Using jQuery to Hide and Show 3 Divs with Clicked Buttons

My goal is to have three divs, each with different content that will be displayed when a user clicks a corresponding button. I would like the first div to be displayed by default when the page loads. I attempted to achieve this using the code below, but ...

Sometimes, JQuery struggles to set input values accurately

Exploring the single page app sample provided here, I have encountered some anomalies when attempting to manipulate input controls with JQuery under certain conditions. Below is the consistent HTML structure followed by the JavaScript snippets in question. ...

Guide on converting a date input to a timestamp

I am trying to convert the date retrieved from an HTML5 date input into a timestamp and store it as a variable. HTML: <form> <section class="input"> <input type="date" id="date" name="maintenanace_date"/> </section> <sectio ...

Arranging two <ul> elements within an angular template

I need assistance with aligning two ul blocks. Currently, they are displaying next to each other, but their alignment is starting from the bottom instead of the top: <div class="ingredients-container"> <div style="display: inline-block; width: ...

I need assistance in making my Gradient design compatible with different browsers

Currently, I am using this Gradient style: background: -moz-linear-gradient(center top , #FFFFFF 0px, #DDDDDD 100%) repeat scroll 0 0 transparent; However, I need a multi-browser compatible version of it. Can anyone help me with that? ...

Ajax fails to function within a loop

I'm looking to implement Ajax in a loop to retrieve data sequentially. This is what I have in my JavaScript function: var resultType = $("input[name='resultType']:checked").val(); var finalResult = ""; var loadingMessage = "<img src=&ap ...

How can we incorporate tab stops using jQuery?

Is there a way to stop the tab navigation when it reaches a button, rather than skipping fields using tabindex="-1"? For example, if my focus moves from input field A to Email and then to the button labeled "sdfsdf", I want to prevent moving to the test i ...

Remove a div element with Javascript when a button is clicked

I am working on a project where I need to dynamically add and remove divs from a webpage. These divs contain inner divs, and while the functionality to add new divs is working fine for me, I'm facing some issues with removing them. The code snippet b ...

Revamp Your Navbar Links with Bootstrap Color Customization

Even though this topic has been discussed extensively, I still haven't found a solution that works for me. My goal is simple - to change the color of the links in my bootstrap navbar to white. I know that the CSS is correctly applied because I can adj ...

Trouble with the visibility of the Bootstrap navigation bar menu icon

I am currently utilizing Bootstrap's navigation bar, and I have configured a menu icon. However, when I resize the browser window to a smaller size, the navigation bar functions properly but the icon does not appear. HTML: <nav id="navigation ...

"Utilize PHP to link to the same page, pass data through $_POST method, and

I have a database table containing (NumSection (id) and NomSection) In my webpage, I want to display all the data from 'NomSection' as a link. When clicked, I want to open the current page with $_POST['nomSection'] and show the data fo ...

What is the purpose of the video-js endcard plugin incorporating native controls into the player?

Endcard is a unique plugin designed for the video-js html5 video player that adds clickable links to the end of a video. (More information on endcards can be found here: https://github.com/theonion/videojs-endcard). To implement an endcard, simply include ...

Icon for local system displayed on browser tab

I am currently trying to set a Browser Tab icon for the local system, but it is not working. However, when using an HTTP static icon, it works perfectly. Can someone please help me understand what the issue might be? PAGE 1 : Icon Not Showing <link re ...