Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Removing A Space

Posted on 2015-02-17
2
Medium Priority
?
65 Views
Last Modified: 2015-02-18
I have a space above "Social Media Woes" that I can't remove.
www.mediascrubber.com
I am attaching the file so that you can see.  It's in a div with a class off "hometext" here is the css.
.hometext  {
	margin-left: auto;
    margin-right: auto;
    width: 80%;
    }

Open in new window

Not sure why it won't line up to the top of the div.
index.php
0
Comment
Question by:DS928
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Expert Comment

by:Nathan Riley
ID: 40614964
.hometext {
margin-left: auto;
margin-right: auto;
width: 80%;
margin-top: -40px;

Open in new window

0
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 40615468
It does line up with the top of the DIV already. The DIV above it (the one with the banner image) will expand to fit the entire image, which includes the 'star' on the right.

You do have a top margin on your H2 which pushes it down slightly. Remove that and it'll move the text up slightly:

h2 { margin-top: 0px; }

Negative margins, as Nathan suggested can work, but are often a sign of a 'hack' and can have some odd side-effects - you're basically moving your text DIV up so that it overlaps the image DIV. That may work on this page, but as soon as you don't have header text (or it fills the full width of the line), the text will sit on top of your image, and probably look wrong.

I would always recommend that if you find yourself needing to set negative margins - re-think your design!! There's often a better way to acheive what you want.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

722 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