Solved

Removing A Space

Posted on 2015-02-17
2
58 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 42

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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 …

760 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

18 Experts available now in Live!

Get 1:1 Help Now