user3527763
user3527763

Reputation: 3

Whitespace appearing inside the DIV

I am very new to CSS. I am creating a DIV and somehow the text is being displayed in middle of the DIV. There is a white-space appearing above the first line of the text. I am also providing the CSS that I wrote for this DIV.

CSS Code

#CONTAINER {

   float: left;
   height: auto;
   padding-top: 0;
   border: 1px solid black;
  vertical-align: top;

 }

#CONTAINER  p {
padding: 0;
margin: 0;
vertical-align: top;


 }

Here is the Link to the page. Please refer to the last Div which says Latest News [enter link description here][1]

Upvotes: 0

Views: 263

Answers (3)

Ben
Ben

Reputation: 2209

It is possible, that outside the div, you have set the "text-align" property to the value "center". Out of interest, does this occur in any other browsers?

Upvotes: 0

Liftoff
Liftoff

Reputation: 25432

In your "Latest news block," there is an h2 element outside of the div that your text is in that is pushing everything down.

<div id="block-nodeblock-21" class="block block-nodeblock">

    <h2>Latest News Block</h2> <!----this guy-->
    <div class="content">

The element is invisible because you set visibility:hidden, however this does not remove it from the page, so it still affects the position of everything around it. To make it truly hidden, you can

  • Remove it OR
  • Set display: none;

Upvotes: 2

bensonsearch
bensonsearch

Reputation: 312

First off we need your HTML that goes with it, however also remember that the P tag has got its own whitespace added by default, try - values for your padding under

#CONTAINER p

Upvotes: 0

Related Questions