PDA

View Full Version : Stupid little CSS Question.


AlienAssKicker
03-24-2005, 10:17 AM
Hello,

Would anyone know how do I get rid of the white space between my "h1" element and my "h2" element? Same thing between "h2" and "p";

Obviously, my HTML code is something like:


<h1>Title</h1>
<h2>Description</h2>
<p>Paragraph</p>


I want to avoid having to do tables under HTML so that's why I'm using CSS.

AlienAssKicker
03-24-2005, 10:45 AM
Nevermind, I just ended up creating my own tags so that I wouldn't have the deal with the headings settings on h1, h2, h3...

Stilll curious about it though.

AlienAssKicker
03-24-2005, 03:40 PM
Just for the record. To get rid of the line break of a heading or paragraph, simply reset the default margin value.
For instance:

h1 {
background: #ddd;
margin: 0;
}

I stumbled upon this answer to my original question by accident while looking for something else. Of course, I don't need it anymore...

Yay for me. http://forums.3drealms.com/ubbthreads/images/graemlins/rolleyes.gif

AlienAssKicker
03-24-2005, 03:41 PM
Thank you AAK, you have been very useful today.

John
03-24-2005, 07:15 PM
http://forums.3drealms.com/ubbthreads/images/icons/thumbsup.gif http://forums.3drealms.com/ubbthreads/images/graemlins/grin.gif You're VERY welcome.

Ivan
03-24-2005, 07:20 PM
AlienAssKicker said:
Thank you AAK, you have been very useful today.



I wonder if my informatic teacher even knows that. He told us that one of his HTML pages took him 50 hours to do. Yeah right.

Yay for you AAK. http://forums.3drealms.com/ubbthreads/images/graemlins/love.gif

ADM
03-24-2005, 09:17 PM
AlienAssKicker said:
Thank you AAK, you have been very useful today.



Seriously though you have been useful.. I never knew that even.

But mainly because I always avoided preset tags like that.

NetNessie
03-25-2005, 06:51 PM
AlienAssKicker said:
h1 {
background: #ddd;
margin: 0;
}




Doesnt

h1 {
display: inline;
clear: right;
}


Do the same thing?

(not that it matters, my approach is probably the worlds worst CSS http://forums.3drealms.com/ubbthreads/images/graemlins/rolleyes.gif )

Usurper
03-25-2005, 09:32 PM
It likely does if you don't apply any additional formatting to the header tag. However, once you get into borders and background colors and such, you may prefer to keep it as a block level element.

NetNessie
03-26-2005, 05:05 AM
Yah, my thoughts exactly.