This is a discussion on "[SOLVED] The Gap between the P tag" within the Web Page Design section. This forum, and the thread "[SOLVED] The Gap between the P tag are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] The Gap between the P tag
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] The Gap between the P tag
Hi all,
I've been learning CSS for a couple of weeks now and I have been enjoying it. I've come to a problem which I think you maybe able to help me out with. Currenrtly I have a
Kind Regards Madball. |
|
|
|
#2
|
|||
|
|||
|
Re: The Gap between the P tag
could you just paste the code please? Easier to read..
|
|
#3
|
||||
|
||||
|
Re: The Gap between the P tag
You can adjust the margin on the h1 or the p or both..
For example...
Cheers EDIT : Just looked at your code, you have a 25px top margin on the p tag, and 6 px padding on top and bottom of both h1 and p tags.. this totals 37 px of space between them Look at decreasing this
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Last edited by Rakuli; Nov 6th, 2007 at 10:44. |
|
#4
|
|||
|
|||
|
Re: The Gap between the P tag
Quote:
|
|
#5
|
|||
|
|||
|
Re: The Gap between the P tag
OK I think I have it working, just so you can see what I've done here is my code.
HTML
|
|
#6
|
||||
|
||||
|
Re: The Gap between the P tag
Yeah, that should reduce it to about 29 px, but if it works for you great!
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#7
|
|||
|
|||
|
Re: The Gap between the P tag
You can also specify a different margin for <p>s that immediately follow an <h1>. For example, suppose you don't want the <h1> bottom margin and <p> top margin to "stack":
|
|
#8
|
|||
|
|||
|
Re: The Gap between the P tag
Hey Madball.. I'm going to butt into this thread...
Since you are just learning, please do NOT use absolute positioning. Yes absolute positioning is a tool that we have in css but it is not the best tool to use because it is an advanced tool. To avoid using absolute positioning I normally have one giant wrap div that is centered on the screen. Everything else goes inside. Header first (for example), Followed by navigation, followed by a left column, then a right column. None of which would need absolute positioning because they are placed in order, and fall inside the wrap. Absolute positioning can mess up stuff when viewed on a screen resolution other than what you are using. |
|
#9
|
|||
|
|||
|
Re: The Gap between the P tag
Hi Lchad, Thanks a lot for the information, just want to query you with the absolute positioning stuff. What I want to see on my webpage is a black bar along the top of the screen which displays time & date plus some other information about the person logging in. Then a couple of line breaks down have the head, content and footer. How would I go about using relative positioning in this case? if you don't understand what I mean, I've attached the 2 files I'm working on to my first post. Also I would like to thank the other people for replying to my post about the gap between tags, got that working
Kind Regards Madball |
|
#10
|
|||
|
|||
|
Re: The Gap between the P tag
Well you don't need relative positioning either.
Here is an example for you to play with. Load it into your software and see what I did. This is how you should attempt to style all basic sites in my opinion. Here is the css:
|
|
#11
|
|||
|
|||
|
Re: The Gap between the P tag
As Linda said, avoid absolute positioning.
In fact, avoid using the CSS "position" attribute altogether. That means:
|
|
#12
|
|||
|
|||
|
Re: The Gap between the P tag
Thanks a lot all, that has made me learn quite a lot there, I did see someone's website a couple of weeks ago and said I wonder how he did that, now you've explained and it looks/works great.
|
|
#13
|
|||
|
|||
|
Re: [SOLVED] The Gap between the P tag
You're welcome!!
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] 1 solved problem causes another | delusion | Web Page Design | 9 | Dec 21st, 2007 08:12 |
| Adding "Topic Solved" for solved topics | AdRock | Webforumz Suggestions and Feedback | 21 | Oct 4th, 2007 15:08 |