I battled trying to get the result i wanted. Principally i thouth if i float the Terms and conditions hyperlink I’d be able to centrally align the icons within the div but I just cant do it.
If anyone has the patience to offer a fix and a reason why my css doesnt do what I’d like it to do I’d be v gratefull
They are centred, but in the space left over after floating the Ts&Cs on the right.
Taking out that float will let them centre properly.
If you still need the Ts&Cs on the right, in line with them, you may have to give them an absolute position with top and right. That would also require the parent container #social to have relative positioning.
One last question on this… OPn a quest to understand more about CSS I just wanted to understand why in terms of getting the 3 icons in the footer to center worked with:
The <a> and <img> elements are inline elements, think of inline elements as being like characters or words of text on a line, they align and wrap in the same way. That’s why text-align works on them.
'margin: auto` should only be used on block elements.
You may of course change the default display type to block, but that would not work in this case, because they are 3 separate elements in a row, though it could be done with flex box instead.
#social is a block container, as @SamA74 described. By default, block containers extend to the full width of the available space. You can temporarily assign a border to #social and see that it fills the full width of its parent, so there is nothing for the margin to do (the margin is not assigned to the inline objects where it would have no affect, anyway). In short, the margin would act on the current container, #social. {text-align:center} would act on the contents of #social, its inline children.