Dani Springer Dani Springer - 5 months ago 7
CSS Question

Apply CSS To Div In Footer

I want to apply

css
to my footer's
div
.

I don't know how to apply a
class
to a footer's
div
.

I added this
css
to my page's
<head>
:

<style>
.flex-item {
justify-content: center;
}
</style>


And this
div
to my footer:

<div class="flex-item">
<div>
<a href="example.com">
<img src="img.png" />
</a>
</div>
<div>
<a href="example.com">
<img src="img.png" />
</a>
</div>
<div>
<a href="example.com">
<img src="img.png" />
</a>
</div>
</div>‚Äč


What am I doing wrong?

NOTE: I am using Blogger, so I can't customize all the way.
Hacks are welcome though.

Post-Answer-Note: the
css
needs to be added to each page's head where the
css
effect is desired (or be called upon from a style sheet), separately.

Answer

The justify-content property aligns the flexible container's items which the container div is supposed to be, I guess. You just need to add to your CSS line: display: flex; . I'm pasting the full CSS code that can be added in the head section below:

<style type="text/css">
    .flex-item {
        display: flex;
        justify-content:center; 
    }
</style>

Source: http://www.w3schools.com/cssref/css3_pr_justify-content.asp

Example: http://www.w3schools.com/cssref/playit.asp?filename=playcss_justify-content&preval=center

Fidde example: https://jsfiddle.net/L4tmgs18/1/