Solved

Space - Needs decreasing

Posted on 2012-12-24
13
232 Views
Last Modified: 2012-12-26
As per attached screenshot, I cant find where in my CSS this space is being set (the red arrow) I want to drop that distance so it matches the distance shown at the blue arrow?

here's a live example http://www.petenetlive.com/KB/Article/0000738.htm

Pete
SPACE.jpg
0
Comment
Question by:Pete Long
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 9

Assisted Solution

by:BlueYonder
BlueYonder earned 20 total points
ID: 38718582
There are many ways the spacing can be set.  The spacing is most likely set in the in the border or padding for the div containing the red arrow.  It is most likely a combination of the div showing the menu above and the image below.  Use relative positioning to override the position.  Try the example, http://www.barelyfitz.com/screencast/html-training/css/positioning/
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38718645
In PNL-CSS-2-Column.css  change:

.PNLBody #sidebar1 {
      float: left; /* since this element is floated, a width must be given */
      width: 150px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
      background: #993300; /* the background color will be displayed for the length of the content in the column, but no further */
      padding: 15px 10px 15px 20px;
}

to reduce the top padding. that is where the extra height is coming from.

Cd&
0
 
LVL 30

Assisted Solution

by:IanTh
IanTh earned 20 total points
ID: 38718653
you have a container div thats meant to go around the whole screen

you need to start using divs if you want instead of tables

<div id=container>


<div id=menu>
..buttons
</div>       'end menu

</div>       'end container
0
 
LVL 57

Author Comment

by:Pete Long
ID: 38718792
Cd&

Thanks that raises the Sidebar and makes things neater but, there is no padding on the #AdSpaceTOP (apart for the px on the inside of it) How do I do the same with that?

IanTh
>>you have a container div thats meant to go around the whole screen
>>you need to start using divs if you want instead of tables

Agreed I'm getting there slowly :)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38718824
Pete,

You can try a negative margin, but be careful with that because it might create issues for old IE versions.

I didn't even realize there was an ad there.  My adblocker is very effective.

Cd&
0
 
LVL 57

Author Comment

by:Pete Long
ID: 38718845
>> My adblocker is very effective.
Ah I See

I've looked at both those elements see att screenshots - There seems to be no reason for that spacing at all between the headerDiv and the AdSpaceTOP Div - the problem repeats itself below, with the same amount of space above the mainContent Div and below the AdSpaceTOP Div.

(I'm very weak on this subject - so its probably something obvious).

Pete
Ad-Div.jpg
Header-Div.jpg
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 3

Expert Comment

by:wadehults
ID: 38719226
I am not seeing anything out of order with your CSS coding here. Your margins and padding attributes are properly set for what you are attempting to do. However, while examining your live code I noticed that the #header section is also entirely enclosed within an <h1> tag with no related textual content. This could be causing a spacing issue due to a default linespace attribute.

The code looks like this when collapsed:
<div id="header">
  <h1>
..... <!-- Header content -->
  </h1>
</div>
0
 
LVL 57

Author Comment

by:Pete Long
ID: 38719262
wadehults

Hi Thanks, that's because the CSS was originally fromone of Dreamweaver's built in templates, I'm guessing it assumes that content in that div would be <h1>

Anyway, I agree its not needed and I've removed it, and still the gap remains!
0
 
LVL 3

Assisted Solution

by:wadehults
wadehults earned 50 total points
ID: 38719275
Since that wasn't the source of the problem, perhaps you could try moving your menus into a <div> of their own and further defining margin and padding. I have had a similar problem using Dreamweaver Spry navigation.

While it would take a lot more work, you could also remove the #content <div> entirely and use absolute positioning of your other <div>'s. This could be problematic if you have dynamic content of varying sizes however. You would have to ensure that your <div>'s were large enough to contain all possible content.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 410 total points
ID: 38719460
The add has an extra linefeed being applied.  it is inside a paragraph which generates a line feed, and then the paragraph is inside a div which generates another one. Try display:inline on the p tag.

Dreamweaver dynamic code can overwrite styling and puts it in line.  At that point the code in the stylesheet no long applies, and with spry I have seen pages where you practically have to re-write the scripting to eliminate some thematic bit it has applied.  

Cd&
0
 
LVL 57

Author Comment

by:Pete Long
ID: 38720992
Hi CD&

Sorry Dropped of the net for a couple of days, I wasn't sure what you meant, but did some searching and came to the conclusion that you meant add...

p.inline
{
display:inline;
}

to my CSS? (please confirm). I've done so, nothing has moved, so I've probably not understood?

Pete
0
 
LVL 57

Author Comment

by:Pete Long
ID: 38721007
-----Ah, I removed the <p> Tag completely form the AdspaceTOP div, (It was only there to center the ad in the Div), I added the allign="center" to the Div instead. And everything jumped to where it should be! ( I need to add a few padding pixels to line things up but that wont take me long).

Thanks to everyone who helped me out, especially Cd&, who hit the nail on the head!


Pete
0
 
LVL 30

Expert Comment

by:IanTh
ID: 38721066
you dont need to worry about old ie versions as its now being automatically updated to the latest so just make sure your code works on the latest version
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Force inline or simulate using css on a pdf 7 44
Centering a div in html5 5 47
css question 1 33
Safari SVG Image Problem 1 20
Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

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

20 Experts available now in Live!

Get 1:1 Help Now