Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Align content to the right of container

Hi,

My brain at this moment is complete juice. Its proboally a rookie mistake or something, but I can't seem to find a good way to solve this.

I would like these social media icons to be aligned vertically at the right side of the container.

Here is a picture https://gyazo.com/9dc638328448c1e34b3fc199e82fe693 (I want the social-icons to be in the spot of the RED-X's)

Codepen; http://codepen.io/fishingjoker/pen/ZWoWRp (As of right now it is kinda shitty, will probably clean it up a bit tomorrow morning)

Everything helps!

2 Answers

@import url(https://fonts.googleapis.com/css?family=Raleway:400,500);

body, html {
 height: 100%;
}

body {
 background-color: rgba(80, 64, 64, 0.93);
 margin: 0;
 padding: 0px;
}

#wrapper !important{
 max-width: 940px;
}

/*******
LOGO
*******/

.outer {
 padding-top: 400px;
}


.headline {
 font-family: 'Armata';
 margin: 0 auto;
 clear: both;
 max-width: 50%;
 min-width: 540px;
 border: 3px solid black;
 padding-bottom: 5px;
 background-image: url(triangulated-pizza.png)
}

.headline a {
 color: #FFFFFF;
 text-decoration: none;
}

#head-row1 {
 text-align: center;
 font-size: 5.5em;
 font-style: italic;
 font-weight: 770;
 min-width: 540px;
}

#head-row2 {
 margin: 0 auto;
 text-align: center;
 font-size: 3em;
 color: black;
 clear: both;
 width: 173px;
 transition-duration: 0.2s;
}

#head-row2:hover {
 transform: translateY(-4.5px);
}

/********
MENU
********/

#menuh3 {
 color: #ffffff;
}

.menu-section {
  font-family: 'Raleway', Arial, sans-serif;
  text-align: center;
  text-transform: uppercase;
  font-weight: 500;
}
.menu-section * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.55s ease;
  transition: all 0.55s ease;
}
.menu-section h3 {
  display: inline-block;
  list-style: outside none none;
  margin: 0 0.8em;
  padding: 0;
}
.menu-section h3 {
  display: inline-block;
  padding: 0.5em 17px;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  letter-spacing: 1px;
  text-decoration: none;
}
.menu-section h3:before {
  left: 20%;
  right: 20%;
  top: 50%;
  content: '';
  border-left: 12px solid #9b59b6;
  border-right: 12px solid #9b59b6;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  height: 3px;
  opacity: 0;
  position: absolute;
  -webkit-transition: all 0.55s ease;
  transition: all 0.55s ease;
}
.menu-section h3:hover,
.snip1155 .current a {
  color: #ffffff;
}
.menu-section h3:hover:before,
.snip1155 .current a:before {
  left: 0;
  right: 0;
  opacity: 1;
}

/**********
SOCIAL ICONS
************/

.social-icons {
 max-width: 60px;
 position: absolute;
  display: block;
  margin: -10% 50%;
}

.social-icon {
    width: 40px;
    height: 40px;
    margin: 0 7px;
    margin-top: 20px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    text-align: center;
    transition: transform 0.2s linear;        
}

.social-icon:hover{
 transform: translateY(-10px)
}

I changed your css a bit as far as your social icons were.

Yeah, I figured that would the way to do it. I was completely toast last night.

Cheers man! Appreciate it.

and here's the HTML, I put the icon div inside the headline div.

  <html>
        <head>
            <meta charset="utf-8">
            <title>Gastronomia Lillestrøm</title>
            <meta name="Send A dickpic" content="">
          <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" 
            <link href="css/design.css" rel="stylesheet" type="text/css">
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
            <script src="js/app.js" type="text/javascript" charset="utf-8"></script>
            <link href='https://fonts.googleapis.com/css?family=Archivo+Black|Armata|Open+Sans|Droid+Sans|Alegreya+Sans|Oxygen' rel='stylesheet' type='text/css'>
            <link href="css/design.css" rel="stylesheet" type="text/css">
            <meta name="viewport" content="width=device-width, intial-scale=1.0">
        </head>
      <body>
<div id="wrapper">



<div class="outer">
<div class="headline">
      <a href="index.html">
        <h2 id="head-row1">Gastronomia</h2>
        <h3 id="head-row2">Pizzeria</h3>
      </a>


        <div class="social-icons">
<a href="https://twitter.com/NordNamedPreben"><img src="img/twitter.png" id="twitter" class="social-icon"></a>
<a href="https://instagram.com/preben_olafsen/"><img src="img/instagram.png" id="instagram" class="social-icon"></a>   
     </div>
 </div>
 </div>



       <br>
       <br>
       <br>
       <br>
      <a href="">
       <div class="menu-section">
       <h3 id="menuh3">THE MENU</h3>
      </a>
       </div>
    </div>
   </body>
</html>