1

I put Font Awesome icons (FB, Twitter, Steam) that look like images but are actually text in my footer, and I added some other linked text. Now my footer shows the icons next to the text, but I want my icons to be on top of the text and centered just like this site: see footer here. This website also has hover, and I know the command for that, but I don't know where to include it.

My code:

.Site {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.Site-content {
  flex: 1;
}
header {
    position: fixed;
    z-index: 10;
    width: 100%;
    height: 87px;
    background-color: #212022;
    border-bottom:2px groove #cc9900;
}
main {
  background-color: #181719;
}

.centered {
    margin: 160px auto;
    padding:30px 50px;
    width: 800px;
    color: #efefef;
    background: #1c1b1d;
    border: 1px groove #cc9900;
}
.centered h2 {
    text-align:center;
}
footer {
  width: 100%;
  height: 164px;
  background-color : #212022;
  border-top: 1px groove #cc9900;
}
p{
  color: white
}
@font-face {
 font-family: "csgofontlight"
 src: url('../fonts/csgofontlight.tff') format('truetype');
 }
#logo{
 width: 520px;
 height: 80px;
 background: url<'/StaffPage/img/logo.png'> no-repeat scroll center;
 margin-top:3px;
        left: 108px;
        float: left;
 position: absolute;
        text-indent:-9999px;
}
#steamlogin{
 width: 154px;
 height: 23px;
 background: url('/StaffPage/img/steamlogin.png');
 margin-top: 34px;
        right: 108px; 
        float: right;
 position: absolute;
        text-indent:-9999px;
}
body {
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
 margin-left: 0px
} 
header ul {
   list-style:none;
  margin:33px auto;
  width:600px;
  text-align:center;
}
header ul li{
  display:inline-block;
  margin:10px;
}
header ul li a {
  color: #949494;
  text-decoration : none;
  font-size : 100%;
  position: absolute; top: 34px; right: 300px;
  font : 17px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
}
header ul li a:hover {
  color: #E6E6E6;
-o-transition: color 0.25s linear;
-moz-transition: color 0.25s linear;
-khtml-transition: color 0.25s linear;
-webkit-transition: color 0.25s linear;
-ms-transition: color 0.25s linear;
transition: color 0.25s linear;
}
#howto {
  position: absolute; top: 34px; right: 400px;
}

footer ul {
  list-style:none;
  margin:50px auto;
  width:1000px;
  position: absolute; top: 620px; right: 310px;
}
footer ul li {
  display:inline-block;
  margin:10px;
}
footer ul li a {
  color: #717171;
  text-decoration : none;
  font-size : 100%;
  font : 17px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
}
footer ul li a:hover {

  color: #DADADB;
-o-transition: color 0.25s linear;
-moz-transition: color 0.25s linear;
-khtml-transition: color 0.25s linear;
-webkit-transition: color 0.25s linear;
-ms-transition: color 0.25s linear;
transition: color 0.25s linear;
}
h2 {
  font : 20px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
  color: #DDDDDD;
}
main ul li {
  font : 15px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
  color: #949494;
  margin: 0 0 10px 0;
 }
<!DOCTYPE html>
<html>
<head>
<title>CSGOShuffle Staff Team</title>
<link rel="stylesheet" type="text/css" href="/StaffPage/css/style.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</head>
<link rel="shortcut icon" href="/StaffPage/icon.ico" />
<body class="Site">
  <header>
    <div class="wrapper">
     <div id="logo"></div>
         <a href="//csgoshuffle.com" id="logo">Range Web Development</a>
     <div id="steamlogin"></div>
        <a href="//csgoshuffle.com/login" id="steamlogin">Range Web</a>
   </div>
    <ul>
        <li><a href ="//support.csgoshuffle.com" target="_blank">Support</a></li>
        <li><a id="howto" href ="//csgoshuffle.com/howto" target="_blank">How to Play</a></li>
    </ul>
  </header>
  <main class="Site-content">
    <div class="centered">
        <h2>STAFF TEAM</h2>
     <ul>
        <li>Our mod chimbobway can deal with all missing skins deals , his account link is </li>
        <h2>Missing Value , here is fix</h2>
            <ul>
            <li>Our Mod Chimbobway will add you </li>
            <li>You will recive a case ID from the mod</li>
            <li>You Have to provide the mod with screen shots of all the info that he needs</li>
            <li>All Trades must has Code that the mod gonna give it to you</li>            
     </ul>
    </div>
  </main>
  <footer>
     <ul>
       <div class="navbar-text pull-right">
      <li><a  href="//facebook.com/csgoshuffle">  <i class="fa fa-facebook fa-2x" style ='color: #CCCCCC'></i></li>
      <li><a  href="//twitter.com/csgoshuffle">  <i class="fa fa-twitter fa-2x" style ='color: #CCCCCC;'></i></li>
      <li><a  href="//steamcommunity.com/groups/">  <i class="fa fa-steam fa-2x" style ='color: #CCCCCC;'></i></li>
      
      <li><a href ="//csgoshuffle.com/status">Status</a></li>
      <li><a href ="//csgoshuffle.com/provably-fair">Provably Fair</a></li>
      <li><a href ="//csgoshuffle.com/contact">Contact</a></li>
      <li><a href ="//support.csgoshuffle.com/kb">FAQ</a></li>
      <li><a href ="//csgoshuffle.com/tos">Terms of Service</a></li>
      <li><a href ="//store.steampowered.com/">Powered by Steam</a></li>
      
      
    </ul>
</footer>
</body>

http://codepen.io/anon/pen/xGNYGK

gunr2171
  • 16,104
  • 25
  • 61
  • 88
MDub
  • 19
  • 5

4 Answers4

1

Well, it was a bit unresponsive but we will only undress the problem you have. Let's see.

For starters you have to close your elements, just for good practice. Your <footer> could be like this.

<footer>

    <ul>
        <li>
          <a href="//facebook.com/csgoshuffle"> <i class="fa fa-facebook fa-2x" style='color: #CCCCCC'></i></a></li>
        <li>
          <a href="//twitter.com/csgoshuffle"> <i class="fa fa-twitter fa-2x" style='color: #CCCCCC;'></i></a></li>
        <li>
          <a href="//steamcommunity.com/groups/"> <i class="fa fa-steam fa-2x" style='color: #CCCCCC;'></i></a></li>
    </ul>



    <ul>
        <li><a href="//csgoshuffle.com/status">Status</a></li>
        <li><a href="//csgoshuffle.com/provably-fair">Provably Fair</a></li>
        <li><a href="//csgoshuffle.com/contact">Contact</a></li>
        <li><a href="//support.csgoshuffle.com/kb">FAQ</a></li>
        <li><a href="//csgoshuffle.com/tos">Terms of Service</a></li>
        <li><a href="//store.steampowered.com/">Powered by Steam</a></li>
    </ul>
</footer>

I removed the unnecessary div and i split the <ul> in 2 <ul>s, the icons and the text.

Now for the css

Remove the fixed height from <footer>

footer {
  width: 100%;
  background-color : #212022;
  border-top: 1px groove #cc9900;
}

Also, remove floats, and absolute positioning from your icons

#logo{
    width: 520px;
    height: 80px;
    background: url<'/StaffPage/img/logo.png'> no-repeat scroll center;
    margin-top:3px;
}
#steamlogin{
    width: 154px;
    height: 23px;
    background: url('/StaffPage/img/steamlogin.png');
    margin-top: 34px;
}

Finally, I made your <ul> displaying as block and removed fixed width

footer ul {
  display: block;
  list-style:none;
  margin:50px auto;
  text-align:center;
}

That should auto-align eveything according to your needs, without the need of explicitly position everything for every different display width.

Update you could change margin:50px auto; to margin:0px auto; to get a closer look in what you want

Update 2 as for the hover effect

You should remove the style from your <li> <a>s e.g.

<li><a href="//facebook.com/csgoshuffle"> <i class="fa fa-facebook fa-2x"></i></a></li>

and add it in your css like this

footer ul li a i{
    color: #CCCCCC
}

then you just have to change this rule

header ul li a:hover

to this

footer ul li a:hover i

e.g.

header ul li a:hover i{
    color: #E6E6E6;
    -o-transition: color 0.25s linear;
    -moz-transition: color 0.25s linear;
    -khtml-transition: color 0.25s linear;
    -webkit-transition: color 0.25s linear;
    -ms-transition: color 0.25s linear;
    transition: color 0.25s linear;
}

here is the working snippet

.Site {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.Site-content {
  flex: 1;
}
header {
    position: fixed;
    z-index: 10;
    width: 100%;
    height: 87px;
    background-color: #212022;
    border-bottom:2px groove #cc9900;
}
main {
  background-color: #181719;
}

.centered {
    margin: 160px auto;
    padding:30px 50px;
    width: 800px;
    color: #efefef;
    background: #1c1b1d;
    border: 1px groove #cc9900;
}
.centered h2 {
    text-align:center;
}
footer {
  width: 100%;
  background-color : #212022;
  border-top: 1px groove #cc9900;
}
p{
  color: white
}
@font-face {
 font-family: "csgofontlight"
 src: url('../fonts/csgofontlight.tff') format('truetype');
 }
#logo{
 width: 520px;
 height: 80px;
 background: url<'/StaffPage/img/logo.png'> no-repeat scroll center;
 margin-top:3px;
}
#steamlogin{
 width: 154px;
 height: 23px;
 background: url('/StaffPage/img/steamlogin.png');
 margin-top: 34px;
}
body {
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
 margin-left: 0px
} 
header ul {
   list-style:none;
  margin:33px auto;
  width:600px;
  text-align:center;
}
header ul li{
  display:inline-block;
  margin:10px;
}
header ul li a {
  color: #949494;
  text-decoration : none;
  font-size : 100%;
  position: absolute; top: 34px; right: 300px;
  font : 17px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
}
header ul li a:hover {
  color: #E6E6E6;
-o-transition: color 0.25s linear;
-moz-transition: color 0.25s linear;
-khtml-transition: color 0.25s linear;
-webkit-transition: color 0.25s linear;
-ms-transition: color 0.25s linear;
transition: color 0.25s linear;
}
#howto {
  position: absolute; top: 34px; right: 400px;
}

footer ul {
  display: block;
  list-style:none;
  margin:0px auto;
  text-align: center;
}
footer ul li {
  display:inline-block;
  margin:10px;
}
footer ul li a {
  color: #717171;
  text-decoration : none;
  font-size : 100%;
  font : 17px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
}

footer ul li a i{
  color: #CCCCCC;
}

footer ul li a:hover i{

  color: yellow;
-o-transition: color 0.25s linear;
-moz-transition: color 0.25s linear;
-khtml-transition: color 0.25s linear;
-webkit-transition: color 0.25s linear;
-ms-transition: color 0.25s linear;
transition: color 0.25s linear;
}
h2 {
  font : 20px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
  color: #DDDDDD;
}
main ul li {
  font : 15px "csgofontlight" , Arial, Helvetica, Geneva, sans-serif;
  color: #949494;
  margin: 0 0 10px 0;
 }
<!DOCTYPE html>
<html>
<head>
<title>CSGOShuffle Staff Team</title>
<link rel="stylesheet" type="text/css" href="/StaffPage/css/style.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</head>
<link rel="shortcut icon" href="/StaffPage/icon.ico" />
<body class="Site">
  <header>
    <div class="wrapper">
     <div id="logo"></div>
         <a href="//csgoshuffle.com" id="logo">Range Web Development</a>
     <div id="steamlogin"></div>
        <a href="//csgoshuffle.com/login" id="steamlogin">Range Web</a>
   </div>
    <ul>
        <li><a href ="//support.csgoshuffle.com" target="_blank">Support</a></li>
        <li><a id="howto" href ="//csgoshuffle.com/howto" target="_blank">How to Play</a></li>
    </ul>
  </header>
  <main class="Site-content">
    <div class="centered">
        <h2>STAFF TEAM</h2>
     <ul>
        <li>Our mod chimbobway can deal with all missing skins deals , his account link is </li>
        <h2>Missing Value , here is fix</h2>
            <ul>
            <li>Our Mod Chimbobway will add you </li>
            <li>You will recive a case ID from the mod</li>
            <li>You Have to provide the mod with screen shots of all the info that he needs</li>
            <li>All Trades must has Code that the mod gonna give it to you</li>            
     </ul>
    </div>
  </main>
  <footer>

    <ul>
        <li>
          <a href="//facebook.com/csgoshuffle"> <i class="fa fa-facebook fa-2x"></i></a></li>
        <li>
          <a href="//twitter.com/csgoshuffle"> <i class="fa fa-twitter fa-2x"></i></a></li>
        <li>
          <a href="//steamcommunity.com/groups/"> <i class="fa fa-steam fa-2x"></i></a></li>
    </ul>



    <ul>
        <li><a href="//csgoshuffle.com/status">Status</a></li>
        <li><a href="//csgoshuffle.com/provably-fair">Provably Fair</a></li>
        <li><a href="//csgoshuffle.com/contact">Contact</a></li>
        <li><a href="//support.csgoshuffle.com/kb">FAQ</a></li>
        <li><a href="//csgoshuffle.com/tos">Terms of Service</a></li>
        <li><a href="//store.steampowered.com/">Powered by Steam</a></li>
    </ul>
</footer>
</body>
Jonathan La'Fey
  • 542
  • 5
  • 13
  • Cool bro thx i will test that , sorry if i asked something stupid but iam kinda new , i used w3school to learn codes , and i didnt find every thing iam looking for in there . but thx god i found this site – MDub Aug 18 '15 at 17:01
  • No it's fine! Sorry for yhe late answers – Jonathan La'Fey Aug 18 '15 at 17:06
  • so i reached this code , and i had 2 pic's in the header , now only the one on the right appears and the one on the left doesnt , do you have any idea why this thing happening ? this is how the code looks like so far http://codepen.io/anon/pen/xGNYGK and this is pic from the header on my site shows that i have the right pic but the left 1 missing http://prntscr.com/864240 – MDub Aug 18 '15 at 17:34
  • 1
    oh never mind i had <> around my link and it must be () i fixed it ! thx – MDub Aug 18 '15 at 17:35
  • 1 more question please its just about placing this text you see "How to play" between the center box and the header on this site https://csgoshuffle.com/howto i want to put that but i dont know where i type the html code for it i tried to put it in the header , but i fail cuz the text start going over the box when i scroll down :( and i tried to put it inside the box then push it up with some px commands and position but it stays inside the box any idea please ? – MDub Aug 18 '15 at 22:45
  • Again, it's not gonna be very responsive, but you could do something like that: in your class `.centered` add **in the end** a style `margin-top: 30px;` then, **right after** `main` element **and before** `div` with class `.centered` add this: `` by now you should now how to move the inline styles to the css file :) – Jonathan La'Fey Aug 19 '15 at 06:04
  • Bear in mind, that this could be way more easier if you could separate each _part_ of your html in a different _container_. Meaning that `
    `, for example, should not _contain_ or _overlay_ the `header` etc.
    – Jonathan La'Fey Aug 19 '15 at 06:12
  • bro thx for help i know i asked you alot of questions , cuz i have low skills with codes , but believe me iam searching for fix before i ask you . and you really helping me to improve my coding skill , what i reached so far is this http://codepen.io/anon/pen/ZGdYNM and what iam trying to make is this http://prntscr.com/86i5hy i tried to make it but i failed what i failed in is making owner on left and Co-Owner on right then have text under them and the click here image i tried to make it but "Owner" was going out side the text and the text wasnt going under Co-Owner @Jonathan :D help bro – MDub Aug 19 '15 at 17:09
  • @MDub I can't provide so much of a code, especially in comment section. It's too specialized. You should try to develop what you can and open a new question. I am sure more people would be happy to help you. – Jonathan La'Fey Aug 19 '15 at 18:09