Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Special Interests > Web Design and Development
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 16, 2005, 06:36 AM   #1
cooknwitha
macrumors 6502a
 
cooknwitha's Avatar
 
Join Date: May 2005
Location: London
CSS line spacing between h2 and p

I'll try and make this logical as I can manage. Is it possible in CSS code to make the spacing between an h2 and a p field to appear like it's only being separated by a <br>?

Hello, I'm an H2 Heading

And I'm a P field. See how I have a gap??

- - - -

I would like this to be the H2 heading
And for this to be the p field.

Am I making any sense? Obviously I can make the h2 lines p and manipulate them with the <span> command that but I'm trying to keep my code as simple as possible and trying to control appearance from one CSS file.

I hope I'm making sense. I'm a little muddled in the head at the moment.
__________________
White Macbook 2.16GHz C2D, Superdrive, 2GB RAM, 160GB HD
5G 60GB Black Video iPod + 1GB Shuffle
cooknwitha is offline   Reply With Quote
Old Dec 16, 2005, 06:49 AM   #2
Mitthrawnuruodo
Demi-God (Moderator)
 
Mitthrawnuruodo's Avatar
 
Join Date: Mar 2004
Location: Bergen, Norway
In your css (or just in a style tag) set margin and padding to 0px for both h2 and p and they should get considerably closer...
__________________
Those who fail to learn history are doomed to repeat it;
those who fail to learn history correctly...
why, they are simply doomed.
Mitthrawnuruodo is offline   Reply With Quote
Old Dec 16, 2005, 06:57 AM   #3
cooknwitha
Thread Starter
macrumors 6502a
 
cooknwitha's Avatar
 
Join Date: May 2005
Location: London
You, Mitthrawnuruodo, are a champion!! I think I tried almost every combination with padding and margin except that! I wanted it to go

HEADING
Para Para Para Para Para Para Para
Para Para Para Para Para Para Para
Para Para Para Para Para Para Para

HEADING
Para Para Para Para Para Para Para
Para Para Para Para Para Para Para
Para Para Para Para Para Para Para

And I've now achieved that with:
Code:
h2 {
	padding:0px;
	margin:0px;
	}
p {
	padding:0px;
	margin-top:0px;
	}
Thank you so so much! That's going to save me a lot of trouble.
__________________
White Macbook 2.16GHz C2D, Superdrive, 2GB RAM, 160GB HD
5G 60GB Black Video iPod + 1GB Shuffle
cooknwitha is offline   Reply With Quote
Old Dec 16, 2005, 07:06 AM   #4
Mitthrawnuruodo
Demi-God (Moderator)
 
Mitthrawnuruodo's Avatar
 
Join Date: Mar 2004
Location: Bergen, Norway
No problem... just glad to help...

I've never understood why the h-tags and p-tag has all that margin by default... that's just <mumble /> stupid...
__________________
Those who fail to learn history are doomed to repeat it;
those who fail to learn history correctly...
why, they are simply doomed.
Mitthrawnuruodo is offline   Reply With Quote
Old Dec 16, 2005, 07:23 AM   #5
cooknwitha
Thread Starter
macrumors 6502a
 
cooknwitha's Avatar
 
Join Date: May 2005
Location: London
I agree. I'm in the process of changing my old Flash-based website into HTML with CSS and I love the flexibility of it. But the gaps between the h tags were driving me insane. But now I've fixed that.

CSS is great though. I had no idea it was so flexible. Not a table to be seen. Not to mention relatively simple to understand.
__________________
White Macbook 2.16GHz C2D, Superdrive, 2GB RAM, 160GB HD
5G 60GB Black Video iPod + 1GB Shuffle
cooknwitha is offline   Reply With Quote

Reply

Mac Forums > Special Interests > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:14 AM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC