Solved

Removing A Space

Posted on 2015-02-17
2
61 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
2 Comments
 
LVL 11

Expert Comment

by:N R
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
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 …

830 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