![]() |
How to eliminate gap below "<h3>"
I try in vain to eliminate the vertical space between <h3> and
the following text. What style tags or other tags will help? http://www.cavea.yoyo.pl/index2.html Currently I have displayed: "Main Menu aaa" And I need: "Main Menu aaa" There will be a list (<ul>) in place of "aaa" and I don't want to have vertical gap between the title of menu and the <ul> list. Please advise how to achieve this as I have checked a lot of style tags and don't know how to manage to do that. Thanks, Mark |
Re: How to eliminate gap below "<h3>"
In article <493cde53$0$29452$f69f905@mamut2.aster.pl>,
"Netx" <user72cut-it-out@go2.pl> wrote: > I try in vain to eliminate the vertical space between <h3> and > the following text. What style tags or other tags will help? > http://www.cavea.yoyo.pl/index2.html > Currently I have displayed: > "Main Menu > > > aaa" > And I need: > "Main Menu > aaa" > > There will be a list (<ul>) in place of "aaa" and I don't want to > have vertical gap between the title of menu and the <ul> list. > Please advise how to achieve this as I have checked a lot of > style tags and don't know how to manage to do that. > <h3>Main Menu</h3> <p>aaa</p> h3 {margin-bottom: 0;} p {margin-top: 0;} -- dorayme |
Re: How to eliminate gap below "<h3>"
dorayme wrote:
> In article <493cde53$0$29452$f69f905@mamut2.aster.pl>, > "Netx" <user72cut-it-out@go2.pl> wrote: > >> I try in vain to eliminate the vertical space between <h3> and >> the following text. What style tags or other tags will help? >> http://www.cavea.yoyo.pl/index2.html >> Currently I have displayed: >> "Main Menu >> >> >> aaa" >> And I need: >> "Main Menu >> aaa" >> >> There will be a list (<ul>) in place of "aaa" and I don't want to >> have vertical gap between the title of menu and the <ul> list. >> Please advise how to achieve this as I have checked a lot of >> style tags and don't know how to manage to do that. >> > > > > <h3>Main Menu</h3> > <p>aaa</p> > > > h3 {margin-bottom: 0;} > p {margin-top: 0;} > Or if you do not want to get rid of the top margin on *all* P elements but just the ones following an H3 element then use an adjacent sibling selector: h3 + p {margin-top: 0;} *Of course you guessed it...no <= IE6 support -- Take care, Jonathan ------------------- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com |
Re: How to eliminate gap below "<h3>"
Jonathan N. Little kirjoitti seuraavasti:
> Or if you do not want to get rid of the top margin on *all* P elements > but just the ones following an H3 element then use an adjacent sibling > selector: > > h3 + p {margin-top: 0;} And to be precise, OP will put a list after the h3, so h3 + ul { margin-top: 0; } Specific list and/or header identifiers can also be used to make it work also in IE6 etc. -- Ari http://users.utu.fi/athein/ |
Re: How to eliminate gap below "<h3>"
Ari Heino wrote:
> Jonathan N. Little kirjoitti seuraavasti: >> Or if you do not want to get rid of the top margin on *all* P elements >> but just the ones following an H3 element then use an adjacent sibling >> selector: >> >> h3 + p {margin-top: 0;} > > And to be precise, OP will put a list after the h3, so > h3 + ul { margin-top: 0; } > Yes, had to go back in the thread, that info was not carried through... > Specific list and/or header identifiers can also be used to make it work > also in IE6 etc. > Yes IE6 requires to to add an extra class or id... -- Take care, Jonathan ------------------- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com |
Re: How to eliminate gap below "<h3>"
Ari Heino wrote:
> And to be precise, OP will put a list after the h3, so > h3 + ul { margin-top: 0; } > > Specific list and/or header identifiers can also be used to make it > work also in IE6 etc. I think it is generally questionable whether lists should have top margin by default. Why should they? There is quite often a block with default bottom margin before the list anyway. If there isn't, the odds are that the list logically associates with the preceding text (like a list header) so closely that a gap is undesirable. So maybe it's best to set ul, ol, dl { margin-top: 0; } and specify, using class attributes or otherwise, a top margin for a list in the rare cases where a margin is needed. -- Yucca, http://www.cs.tut.fi/~jkorpela/ |
Re: How to eliminate gap below "<h3>"
Jonathan N. Little wrote: > Ari Heino wrote: >> h3 + ul { margin-top: 0; } >> >> Specific list and/or header identifiers can also be used to make it work >> also in IE6 etc. > > Yes IE6 requires to to add an extra class or id... Or just leave IE6 with the extra space and forget about it. I'd rather keep the code leaner than have a bunch of excess selectors just for IE6. Its numbers dwindle a little more each month and I'm personally sick of catering to it. -- Berg |
Re: How to eliminate gap below "<h3>"
Bergamot wrote:
> > Jonathan N. Little wrote: >> Ari Heino wrote: >>> h3 + ul { margin-top: 0; } >>> >>> Specific list and/or header identifiers can also be used to make it >>> work also in IE6 etc. >> >> Yes IE6 requires to to add an extra class or id... > > Or just leave IE6 with the extra space and forget about it. I'd rather > keep the code leaner than have a bunch of excess selectors just for IE6. > Its numbers dwindle a little more each month and I'm personally sick of > catering to it. > Amen to that...I have begun to take the same tack -- Take care, Jonathan ------------------- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com |
Re: How to eliminate gap below "<h3>"
On Mon, 8 Dec 2008 09:44:06 +0100, Netx wrote:
> I try in vain to eliminate the vertical space between <h3> and > the following text. What style tags or other tags will help? for me: <h3 style="line-height: 80%;"> Adjust the % as necessary. Works here in konqueror, Firefox, Opera, and in IE6 running under wine. Jonesy -- Marvin L Jones | jonz | W3DHJ | linux 38.24N 104.55W | @ config.com | Jonesy | OS/2 * Killfiling google & XXXXbanter.com: jonz.net/ng.htm |
Re: How to eliminate gap below "<h3>"
In article <1ae16$493d6fb0$40cba7b7$11851@NAXS.COM>,
"Jonathan N. Little" <lws4art@central.net> wrote: > Bergamot wrote: > > > > Jonathan N. Little wrote: > >> Ari Heino wrote: > >>> h3 + ul { margin-top: 0; } > >>> > >>> Specific list and/or header identifiers can also be used to make it > >>> work also in IE6 etc. > >> > >> Yes IE6 requires to to add an extra class or id... > > > > Or just leave IE6 with the extra space and forget about it. I'd rather > > keep the code leaner than have a bunch of excess selectors just for IE6. > > Its numbers dwindle a little more each month and I'm personally sick of > > catering to it. > > > Amen to that...I have begun to take the same tack The revolutionary movement has started in earnest, you few serious minded cadres as seed and the world will be yours... no, ours, (I think I'll join) -- dorayme |
| All times are GMT. The time now is 05:30 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.