Solved

Right aligning icons

Posted on 2012-12-20
9
219 Views
Last Modified: 2012-12-20
Can anyone see why the two icons (top left) here http://bit.ly/VdKeva are not right aligned?

They are enclosed in div id="horizontalAlign" but have jump out of that container div.
0
Comment
Question by:brettr
  • 5
  • 3
9 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712022
They look right aligned.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712024
Ooops, I meant they look left aligned.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712036
Find where you have this line in your css, ".social-sprite .spriteleft, .social-sprite .spriteright"

and change it to below.  

.social-sprite .spriteleft, .social-sprite .spriteright {
      margin: 0;
      padding: 0;
      float: right;
}

I would probably even go further and split left and right

.social-sprite .spriteright {
      margin: 0;
      padding: 0;
      float: right;
}
.social-sprite .spriteleft{
      margin: 0;
      padding: 0;
      float: left;
}
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:brettr
ID: 38712056
Perfect.  Thanks.  

One more thing, is it possible to add padding or margin top so there is a small buffer under the horizontal line.

I did add

margin: 10 0 0 0;

But it looks like...

* {
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
}

Open in new window

...is overriding it.
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 38712067
try

margin: 10px 0px 0px 0px;

Or 4 different

margin-top:100px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;

refer
http://www.w3schools.com/css/css_margin.asp
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 38712068
If you attach it to a class or id it should work.  


.social-sprite .spriteright {
      margin-top: 20px;
      padding: 10px;
      float: right;
}
0
 

Author Closing Comment

by:brettr
ID: 38712077
Nice.  I went with this:

.social-sprite .spriteright {
      margin-top: 10px;
      padding: 0;
      float: right;
}

For the margins, why wasn't it necessary to set left, right, and bottom?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712092
Leaving something blank is the same as setting it to the default property.  http://www.w3.org/TR/CSS21/propidx.html or a previously set property.   The object is to have the least amount of code possible not the more.
0
 

Author Comment

by:brettr
ID: 38712097
Super.  Thanks again.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question