Jump to content

H2 is too tall


rain13

Recommended Posts

Hello. How can I make h2 only as tall as needed? In other words how do I minimize h2 height?

<div><h2>heading 2</h2>abcd</div>

post-29208-0-06643900-1356815393_thumb.pngLeft side of image is as it is now. Right side of image is how I want it to be.

Edited by SoItBegins
Link to comment
Share on other sites

Seems like you want to reduce the margin and padding.

<html><head><style>.nm {margin: 0;}</style></head><body><div><h2 class="nm">heading 2</h2>abcd</div><div><h2>heading 2</h2>abcd</div></body></html>

Link to comment
Share on other sites

You should use a CSS reset every time :)

html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed,figure, figcaption, footer, header, hgroup,menu, nav, output, ruby, section, summary,time, mark, audio, video {margin: 0;padding: 0;border: 0;font-size: 100%;font: inherit;vertical-align: baseline;}/* HTML5 display-role reset for older browsers */article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display: block;}body {line-height: 1;}ol, ul {list-style: none;}blockquote, q {quotes: none;}blockquote:before, blockquote:after,q:before, q:after {content: '';content: none;}table {border-collapse: collapse;border-spacing: 0;}

This is an example

Edited by Robertmw
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...