Solved

Removing A Space

Posted on 2015-02-17
2
63 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 11

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 43

Accepted Solution

by:
Chris Stanyon earned 500 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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 …

623 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