Solved

Right aligning icons

Posted on 2012-12-20
9
213 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now